Lines Matching refs:sl

64 static int w1_f2d_readblock(struct w1_slave *sl, int off, int count, char *buf)  in w1_f2d_readblock()  argument
75 if (w1_reset_select_slave(sl)) in w1_f2d_readblock()
78 w1_write_block(sl->master, wrbuf, 3); in w1_f2d_readblock()
79 w1_read_block(sl->master, buf, count); in w1_f2d_readblock()
81 if (w1_reset_select_slave(sl)) in w1_f2d_readblock()
84 w1_write_block(sl->master, wrbuf, 3); in w1_f2d_readblock()
85 w1_read_block(sl->master, cmp, count); in w1_f2d_readblock()
91 dev_err(&sl->dev, "proof reading failed %d times\n", in w1_f2d_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_f2d_readblock(sl, off, block_read, buf) < 0) in eeprom_read()
127 mutex_unlock(&sl->master->bus_mutex); in eeprom_read()
145 static int w1_f2d_write(struct w1_slave *sl, int addr, int len, const u8 *data) in w1_f2d_write() argument
155 if (w1_reset_select_slave(sl)) in w1_f2d_write()
162 w1_write_block(sl->master, wrbuf, 3); in w1_f2d_write()
163 w1_write_block(sl->master, data, len); in w1_f2d_write()
166 if (w1_reset_select_slave(sl)) in w1_f2d_write()
169 w1_write_8(sl->master, W1_F2D_READ_SCRATCH); in w1_f2d_write()
170 w1_read_block(sl->master, rdbuf, len + 3); in w1_f2d_write()
179 dev_err(&sl->dev, in w1_f2d_write()
187 if (w1_reset_select_slave(sl)) in w1_f2d_write()
192 w1_write_block(sl->master, wrbuf, 4); in w1_f2d_write()
198 w1_reset_bus(sl->master); in w1_f2d_write()
207 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_write() local
215 mutex_lock(&sl->master->bus_mutex); in eeprom_write()
227 if (w1_f2d_readblock(sl, addr & ~W1_F2D_SCRATCH_MASK, in eeprom_write()
241 if (w1_f2d_write(sl, addr & ~W1_F2D_SCRATCH_MASK, in eeprom_write()
249 if (w1_f2d_write(sl, addr, copy, buf) < 0) { in eeprom_write()
260 mutex_unlock(&sl->master->bus_mutex); in eeprom_write()