Lines Matching refs:sl

71 static int w1_f1C_refresh_block(struct w1_slave *sl, struct w1_f1C_data *data,  in w1_f1C_refresh_block()  argument
80 if (w1_reset_select_slave(sl)) { in w1_f1C_refresh_block()
88 w1_write_block(sl->master, wrbuf, 3); in w1_f1C_refresh_block()
89 w1_read_block(sl->master, &data->memory[off], W1_PAGE_SIZE); in w1_f1C_refresh_block()
98 static int w1_f1C_read(struct w1_slave *sl, int addr, int len, char *data) in w1_f1C_read() argument
103 if (w1_reset_select_slave(sl)) in w1_f1C_read()
110 w1_write_block(sl->master, wrbuf, sizeof(wrbuf)); in w1_f1C_read()
111 return w1_read_block(sl->master, data, len); in w1_f1C_read()
118 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_read() local
119 struct w1_f1C_data *data = sl->family_data; in eeprom_read()
126 mutex_lock(&sl->master->mutex); in eeprom_read()
132 if (w1_f1C_refresh_block(sl, data, i)) { in eeprom_read()
139 count = w1_f1C_read(sl, off, count, buf); in eeprom_read()
143 mutex_unlock(&sl->master->mutex); in eeprom_read()
161 static int w1_f1C_write(struct w1_slave *sl, int addr, int len, const u8 *data) in w1_f1C_write() argument
168 struct w1_f1C_data *f1C = sl->family_data; in w1_f1C_write()
171 if (w1_reset_select_slave(sl)) in w1_f1C_write()
178 w1_write_block(sl->master, wrbuf, 3); in w1_f1C_write()
179 w1_write_block(sl->master, data, len); in w1_f1C_write()
182 if (w1_reset_select_slave(sl)) in w1_f1C_write()
185 w1_write_8(sl->master, W1_F1C_READ_SCRATCH); in w1_f1C_write()
186 w1_read_block(sl->master, rdbuf, len + 3); in w1_f1C_write()
194 if (w1_reset_select_slave(sl)) in w1_f1C_write()
206 w1_next_pullup(sl->master, tm); in w1_f1C_write()
208 w1_write_8(sl->master, wrbuf[i]); in w1_f1C_write()
220 w1_reset_bus(sl->master); in w1_f1C_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()
249 dev_err(&sl->dev, "bad CRC at offset %d\n", in eeprom_write()
256 mutex_lock(&sl->master->mutex); in eeprom_write()
266 if (w1_f1C_write(sl, addr, len, &buf[idx]) < 0) { in eeprom_write()
274 mutex_unlock(&sl->master->mutex); in eeprom_write()
286 struct w1_slave *sl = kobj_to_w1_slave(kobj); in pio_read() local
293 mutex_lock(&sl->master->mutex); in pio_read()
294 ret = w1_f1C_read(sl, W1_1C_REG_LOGIC_STATE, count, buf); in pio_read()
295 mutex_unlock(&sl->master->mutex); in pio_read()
305 struct w1_slave *sl = kobj_to_w1_slave(kobj); in pio_write() local
313 mutex_lock(&sl->master->mutex); in pio_write()
316 if (w1_reset_select_slave(sl)) { in pio_write()
317 mutex_unlock(&sl->master->mutex); in pio_write()
327 w1_write_block(sl->master, wrbuf, 3); in pio_write()
329 w1_read_block(sl->master, &ack, sizeof(ack)); in pio_write()
331 mutex_unlock(&sl->master->mutex); in pio_write()
382 static int w1_f1C_add_slave(struct w1_slave *sl) in w1_f1C_add_slave() argument
390 sl->family_data = data; in w1_f1C_add_slave()
396 static void w1_f1C_remove_slave(struct w1_slave *sl) in w1_f1C_remove_slave() argument
398 kfree(sl->family_data); in w1_f1C_remove_slave()
399 sl->family_data = NULL; in w1_f1C_remove_slave()