Lines Matching refs:sl
61 static int w1_f23_refresh_block(struct w1_slave *sl, struct w1_f23_data *data, in w1_f23_refresh_block() argument
70 if (w1_reset_select_slave(sl)) { in w1_f23_refresh_block()
78 w1_write_block(sl->master, wrbuf, 3); in w1_f23_refresh_block()
79 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE); in w1_f23_refresh_block()
93 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_read() local
95 struct w1_f23_data *data = sl->family_data; in eeprom_read()
104 mutex_lock(&sl->master->bus_mutex); in eeprom_read()
111 if (w1_f23_refresh_block(sl, data, i)) { in eeprom_read()
121 if (w1_reset_select_slave(sl)) { in eeprom_read()
129 w1_write_block(sl->master, wrbuf, 3); in eeprom_read()
130 w1_read_block(sl->master, buf, count); in eeprom_read()
135 mutex_unlock(&sl->master->bus_mutex); in eeprom_read()
152 static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data) in w1_f23_write() argument
155 struct w1_f23_data *f23 = sl->family_data; in w1_f23_write()
162 if (w1_reset_select_slave(sl)) in w1_f23_write()
169 w1_write_block(sl->master, wrbuf, 3); in w1_f23_write()
170 w1_write_block(sl->master, data, len); in w1_f23_write()
173 if (w1_reset_select_slave(sl)) in w1_f23_write()
176 w1_write_8(sl->master, W1_F23_READ_SCRATCH); in w1_f23_write()
177 w1_read_block(sl->master, rdbuf, len + 3); in w1_f23_write()
185 if (w1_reset_select_slave(sl)) in w1_f23_write()
190 w1_write_block(sl->master, wrbuf, 4); in w1_f23_write()
196 w1_reset_bus(sl->master); in w1_f23_write()
207 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_write() local
216 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n", in eeprom_write()
224 dev_err(&sl->dev, "bad CRC at offset %d\n", (int)off); in eeprom_write()
230 mutex_lock(&sl->master->bus_mutex); in eeprom_write()
240 if (w1_f23_write(sl, addr, len, &buf[idx]) < 0) { in eeprom_write()
248 mutex_unlock(&sl->master->bus_mutex); in eeprom_write()
269 static int w1_f23_add_slave(struct w1_slave *sl) in w1_f23_add_slave() argument
277 sl->family_data = data; in w1_f23_add_slave()
283 static void w1_f23_remove_slave(struct w1_slave *sl) in w1_f23_remove_slave() argument
286 kfree(sl->family_data); in w1_f23_remove_slave()
287 sl->family_data = NULL; in w1_f23_remove_slave()