Lines Matching refs:off
56 static inline size_t w1_f23_fix_count(loff_t off, size_t count, size_t size) in w1_f23_fix_count() argument
58 if (off > size) in w1_f23_fix_count()
61 if ((off + count) > size) in w1_f23_fix_count()
62 return (size - off); in w1_f23_fix_count()
72 int off = block * W1_PAGE_SIZE; in w1_f23_refresh_block() local
83 wrbuf[1] = off & 0xff; in w1_f23_refresh_block()
84 wrbuf[2] = off >> 8; in w1_f23_refresh_block()
86 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE); in w1_f23_refresh_block()
89 if (crc16(CRC16_INIT, &data->memory[off], W1_PAGE_SIZE) == CRC16_VALID) in w1_f23_refresh_block()
98 loff_t off, size_t count) in eeprom_read() argument
108 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) in eeprom_read()
115 min_page = (off >> W1_PAGE_BITS); in eeprom_read()
116 max_page = (off + count - 1) >> W1_PAGE_BITS; in eeprom_read()
123 memcpy(buf, &data->memory[off], count); in eeprom_read()
134 wrbuf[1] = off & 0xff; in eeprom_read()
135 wrbuf[2] = off >> 8; in eeprom_read()
212 loff_t off, size_t count) in eeprom_write() argument
217 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) in eeprom_write()
222 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) { in eeprom_write()
224 (int)off, count); in eeprom_write()
231 dev_err(&sl->dev, "bad CRC at offset %d\n", (int)off); in eeprom_write()
242 addr = off + idx; in eeprom_write()