• Home
  • Raw
  • Download

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()
160 static int w1_f1C_write(struct w1_slave *sl, int addr, int len, const u8 *data) in w1_f1C_write() argument
167 struct w1_f1C_data *f1C = sl->family_data; in w1_f1C_write()
170 if (w1_reset_select_slave(sl)) in w1_f1C_write()
177 w1_write_block(sl->master, wrbuf, 3); in w1_f1C_write()
178 w1_write_block(sl->master, data, len); in w1_f1C_write()
181 if (w1_reset_select_slave(sl)) in w1_f1C_write()
184 w1_write_8(sl->master, W1_F1C_READ_SCRATCH); in w1_f1C_write()
185 w1_read_block(sl->master, rdbuf, len + 3); in w1_f1C_write()
193 if (w1_reset_select_slave(sl)) in w1_f1C_write()
203 w1_next_pullup(sl->master, tm); in w1_f1C_write()
205 w1_write_8(sl->master, wrbuf[i]); in w1_f1C_write()
217 w1_reset_bus(sl->master); in w1_f1C_write()
227 struct w1_slave *sl = kobj_to_w1_slave(kobj); in eeprom_write() local
237 dev_err(&sl->dev, "invalid offset/count off=%d cnt=%zd\n", in eeprom_write()
246 dev_err(&sl->dev, "bad CRC at offset %d\n", in eeprom_write()
253 mutex_lock(&sl->master->mutex); in eeprom_write()
263 if (w1_f1C_write(sl, addr, len, &buf[idx]) < 0) { in eeprom_write()
271 mutex_unlock(&sl->master->mutex); in eeprom_write()
283 struct w1_slave *sl = kobj_to_w1_slave(kobj); in pio_read() local
290 mutex_lock(&sl->master->mutex); in pio_read()
291 ret = w1_f1C_read(sl, W1_1C_REG_LOGIC_STATE, count, buf); in pio_read()
292 mutex_unlock(&sl->master->mutex); in pio_read()
302 struct w1_slave *sl = kobj_to_w1_slave(kobj); in pio_write() local
310 mutex_lock(&sl->master->mutex); in pio_write()
313 if (w1_reset_select_slave(sl)) { in pio_write()
314 mutex_unlock(&sl->master->mutex); in pio_write()
324 w1_write_block(sl->master, wrbuf, 3); in pio_write()
326 w1_read_block(sl->master, &ack, sizeof(ack)); in pio_write()
328 mutex_unlock(&sl->master->mutex); in pio_write()
379 static int w1_f1C_add_slave(struct w1_slave *sl) in w1_f1C_add_slave() argument
387 sl->family_data = data; in w1_f1C_add_slave()
393 static void w1_f1C_remove_slave(struct w1_slave *sl) in w1_f1C_remove_slave() argument
395 kfree(sl->family_data); in w1_f1C_remove_slave()
396 sl->family_data = NULL; in w1_f1C_remove_slave()