Lines Matching refs:off
55 static inline size_t w1_f23_fix_count(loff_t off, size_t count, size_t size) in w1_f23_fix_count() argument
57 if (off > size) in w1_f23_fix_count()
60 if ((off + count) > size) in w1_f23_fix_count()
61 return (size - off); in w1_f23_fix_count()
71 int off = block * W1_PAGE_SIZE; in w1_f23_refresh_block() local
82 wrbuf[1] = off & 0xff; in w1_f23_refresh_block()
83 wrbuf[2] = off >> 8; in w1_f23_refresh_block()
85 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE); in w1_f23_refresh_block()
88 if (crc16(CRC16_INIT, &data->memory[off], W1_PAGE_SIZE) == CRC16_VALID) in w1_f23_refresh_block()
97 char *buf, loff_t off, size_t count) in w1_f23_read_bin() argument
107 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) in w1_f23_read_bin()
114 min_page = (off >> W1_PAGE_BITS); in w1_f23_read_bin()
115 max_page = (off + count - 1) >> W1_PAGE_BITS; in w1_f23_read_bin()
122 memcpy(buf, &data->memory[off], count); in w1_f23_read_bin()
133 wrbuf[1] = off & 0xff; in w1_f23_read_bin()
134 wrbuf[2] = off >> 8; in w1_f23_read_bin()
211 char *buf, loff_t off, size_t count) in w1_f23_write_bin() argument
216 if ((count = w1_f23_fix_count(off, count, W1_EEPROM_SIZE)) == 0) in w1_f23_write_bin()
221 if ((off & W1_PAGE_MASK) || (count & W1_PAGE_MASK)) { in w1_f23_write_bin()
223 (int)off, count); in w1_f23_write_bin()
230 dev_err(&sl->dev, "bad CRC at offset %d\n", (int)off); in w1_f23_write_bin()
241 addr = off + idx; in w1_f23_write_bin()