Lines Matching full:sl

84 static int w1_f23_refresh_block(struct w1_slave *sl, struct w1_f23_data *data,  in w1_f23_refresh_block()  argument
93 if (w1_reset_select_slave(sl)) { in w1_f23_refresh_block()
101 w1_write_block(sl->master, wrbuf, 3); in w1_f23_refresh_block()
102 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE); in w1_f23_refresh_block()
116 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_read() local
118 struct w1_f23_data *data = sl->family_data; in eeprom_read()
128 mutex_lock(&sl->master->bus_mutex); in eeprom_read()
135 if (w1_f23_refresh_block(sl, data, i)) { in eeprom_read()
145 if (w1_reset_select_slave(sl)) { in eeprom_read()
153 w1_write_block(sl->master, wrbuf, 3); in eeprom_read()
154 w1_read_block(sl->master, buf, count); in eeprom_read()
159 mutex_unlock(&sl->master->bus_mutex); in eeprom_read()
166 * @sl: The slave structure
177 static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data) in w1_f23_write() argument
179 struct w1_f23_data *f23 = sl->family_data; in w1_f23_write()
185 if (w1_reset_select_slave(sl)) in w1_f23_write()
192 w1_write_block(sl->master, wrbuf, 3); in w1_f23_write()
193 w1_write_block(sl->master, data, len); in w1_f23_write()
196 if (w1_reset_select_slave(sl)) in w1_f23_write()
199 w1_write_8(sl->master, W1_F23_READ_SCRATCH); in w1_f23_write()
200 w1_read_block(sl->master, rdbuf, len + 3); in w1_f23_write()
208 if (w1_reset_select_slave(sl)) in w1_f23_write()
213 w1_write_block(sl->master, wrbuf, 4); in w1_f23_write()
219 w1_reset_bus(sl->master); in w1_f23_write()
230 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_write() local
240 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n", in eeprom_write()
248 dev_err(&sl->dev, "bad CRC at offset %d\n", (int)off); in eeprom_write()
254 mutex_lock(&sl->master->bus_mutex); in eeprom_write()
264 if (w1_f23_write(sl, addr, len, &buf[idx]) < 0) { in eeprom_write()
272 mutex_unlock(&sl->master->bus_mutex); in eeprom_write()
319 static int w1_f23_add_slave(struct w1_slave *sl) in w1_f23_add_slave() argument
327 switch (sl->family->fid) { in w1_f23_add_slave()
338 dev_err(&sl->dev, "page count too big for crc bitmap\n"); in w1_f23_add_slave()
349 sl->family_data = data; in w1_f23_add_slave()
354 static void w1_f23_remove_slave(struct w1_slave *sl) in w1_f23_remove_slave() argument
356 struct w1_f23_data *data = sl->family_data; in w1_f23_remove_slave()
357 sl->family_data = NULL; in w1_f23_remove_slave()