Lines Matching refs:sl
65 static int w1_f14_readblock(struct w1_slave *sl, int off, int count, char *buf) in w1_f14_readblock() argument
75 if (w1_reset_select_slave(sl)) in w1_f14_readblock()
78 w1_write_block(sl->master, wrbuf, 2); in w1_f14_readblock()
79 w1_read_block(sl->master, buf, count); in w1_f14_readblock()
81 if (w1_reset_select_slave(sl)) in w1_f14_readblock()
84 w1_write_block(sl->master, wrbuf, 2); in w1_f14_readblock()
85 w1_read_block(sl->master, cmp, count); in w1_f14_readblock()
91 dev_err(&sl->dev, "proof reading failed %d times\n", in w1_f14_readblock()
101 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_read() local
108 mutex_lock(&sl->master->bus_mutex); in eeprom_read()
119 if (w1_f14_readblock(sl, off, block_read, buf) < 0) in eeprom_read()
127 mutex_unlock(&sl->master->bus_mutex); in eeprom_read()
145 static int w1_f14_write(struct w1_slave *sl, int addr, int len, const u8 *data) in w1_f14_write() argument
154 if (w1_reset_select_slave(sl)) in w1_f14_write()
160 w1_write_block(sl->master, wrbuf, 2); in w1_f14_write()
161 w1_write_block(sl->master, data, len); in w1_f14_write()
164 if (w1_reset_select_slave(sl)) in w1_f14_write()
167 w1_write_8(sl->master, W1_F14_READ_SCRATCH); in w1_f14_write()
168 w1_read_block(sl->master, rdbuf, len + 2); in w1_f14_write()
180 dev_err(&sl->dev, in w1_f14_write()
188 if (w1_reset_select_slave(sl)) in w1_f14_write()
193 w1_write_block(sl->master, wrbuf, 2); in w1_f14_write()
199 w1_reset_bus(sl->master); in w1_f14_write()
208 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_write() local
216 mutex_lock(&sl->master->bus_mutex); in eeprom_write()
228 if (w1_f14_readblock(sl, addr & ~W1_F14_SCRATCH_MASK, in eeprom_write()
242 if (w1_f14_write(sl, addr & ~W1_F14_SCRATCH_MASK, in eeprom_write()
250 if (w1_f14_write(sl, addr, copy, buf) < 0) { in eeprom_write()
261 mutex_unlock(&sl->master->bus_mutex); in eeprom_write()