Lines Matching refs:off
49 static inline size_t w1_f23_fix_count(loff_t off, size_t count, size_t size) in w1_f23_fix_count() argument
51 if (off > size) in w1_f23_fix_count()
54 if ((off + count) > size) in w1_f23_fix_count()
55 return (size - off); in w1_f23_fix_count()
65 int off = block * W1_PAGE_SIZE; in w1_f23_refresh_block() local
76 wrbuf[1] = off & 0xff; in w1_f23_refresh_block()
77 wrbuf[2] = off >> 8; in w1_f23_refresh_block()
79 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE); in w1_f23_refresh_block()
82 if (crc16(CRC16_INIT, &data->memory[off], W1_PAGE_SIZE) == CRC16_VALID) in w1_f23_refresh_block()
91 loff_t off, size_t count) in eeprom_read() argument
101 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) in eeprom_read()
108 min_page = (off >> W1_PAGE_BITS); in eeprom_read()
109 max_page = (off + count - 1) >> W1_PAGE_BITS; in eeprom_read()
116 memcpy(buf, &data->memory[off], count); in eeprom_read()
127 wrbuf[1] = off & 0xff; in eeprom_read()
128 wrbuf[2] = off >> 8; in eeprom_read()
205 loff_t off, size_t count) in eeprom_write() argument
210 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) in eeprom_write()
215 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) { in eeprom_write()
217 (int)off, count); in eeprom_write()
224 dev_err(&sl->dev, "bad CRC at offset %d\n", (int)off); in eeprom_write()
235 addr = off + idx; in eeprom_write()