Lines Matching +full:rom +full:- +full:14 +full:h

1 // SPDX-License-Identifier: GPL-2.0-or-later
6 #include <asm/io.h>
8 #include <linux/delay.h>
9 #include <linux/moduleparam.h>
10 #include <linux/module.h>
12 #include "w1_internal.h"
30 17, 79, 173, 243, 112, 46, 204, 146, 211, 141, 111, 49, 178, 236, 14, 80,
48 * w1_touch_bit() - Generates a write-0 or write-1 cycle and samples the level.
50 * @bit: 0 - write a 0, 1 - write a 0 read the level
54 if (dev->bus_master->touch_bit) in w1_touch_bit()
55 return dev->bus_master->touch_bit(dev->bus_master->data, bit); in w1_touch_bit()
66 * w1_write_bit() - Generates a write-0 or write-1 cycle.
70 * Only call if dev->bus_master->touch_bit is NULL
79 dev->bus_master->write_bit(dev->bus_master->data, 0); in w1_write_bit()
81 dev->bus_master->write_bit(dev->bus_master->data, 1); in w1_write_bit()
84 dev->bus_master->write_bit(dev->bus_master->data, 0); in w1_write_bit()
86 dev->bus_master->write_bit(dev->bus_master->data, 1); in w1_write_bit()
94 * w1_pre_write() - pre-write operations
97 * Pre-write operation, currently only supporting strong pullups.
103 if (dev->pullup_duration && in w1_pre_write()
104 dev->enable_pullup && dev->bus_master->set_pullup) { in w1_pre_write()
105 dev->bus_master->set_pullup(dev->bus_master->data, in w1_pre_write()
106 dev->pullup_duration); in w1_pre_write()
111 * w1_post_write() - post-write options
114 * Post-write operation, currently only supporting strong pullups.
120 if (dev->pullup_duration) { in w1_post_write()
121 if (dev->enable_pullup && dev->bus_master->set_pullup) in w1_post_write()
122 dev->bus_master->set_pullup(dev->bus_master->data, 0); in w1_post_write()
124 msleep(dev->pullup_duration); in w1_post_write()
125 dev->pullup_duration = 0; in w1_post_write()
130 * w1_write_8() - Writes 8 bits.
138 if (dev->bus_master->write_byte) { in w1_write_8()
140 dev->bus_master->write_byte(dev->bus_master->data, byte); in w1_write_8()
154 * w1_read_bit() - Generates a write-1 cycle and samples the level.
157 * Only call if dev->bus_master->touch_bit is NULL
166 dev->bus_master->write_bit(dev->bus_master->data, 0); in w1_read_bit()
168 dev->bus_master->write_bit(dev->bus_master->data, 1); in w1_read_bit()
171 result = dev->bus_master->read_bit(dev->bus_master->data); in w1_read_bit()
180 * w1_triplet() - * Does a triplet - used for searching ROM addresses.
191 * Return: bit fields - see above
195 if (dev->bus_master->triplet) in w1_triplet()
196 return dev->bus_master->triplet(dev->bus_master->data, bdir); in w1_triplet()
214 if (dev->bus_master->touch_bit) in w1_triplet()
224 * w1_read_8() - Reads 8 bits.
234 if (dev->bus_master->read_byte) in w1_read_8()
235 res = dev->bus_master->read_byte(dev->bus_master->data); in w1_read_8()
245 * w1_write_block() - Writes a series of bytes.
254 if (dev->bus_master->write_block) { in w1_write_block()
256 dev->bus_master->write_block(dev->bus_master->data, buf, len); in w1_write_block()
266 * w1_touch_block() - Touches a series of bytes.
290 * w1_read_block() - Reads a series of bytes.
301 if (dev->bus_master->read_block) in w1_read_block()
302 ret = dev->bus_master->read_block(dev->bus_master->data, buf, len); in w1_read_block()
314 * w1_reset_bus() - Issues a reset bus sequence.
325 if (dev->bus_master->reset_bus) in w1_reset_bus()
326 result = dev->bus_master->reset_bus(dev->bus_master->data) & 0x1; in w1_reset_bus()
328 dev->bus_master->write_bit(dev->bus_master->data, 0); in w1_reset_bus()
337 dev->bus_master->write_bit(dev->bus_master->data, 1); in w1_reset_bus()
340 result = dev->bus_master->read_bit(dev->bus_master->data) & 0x1; in w1_reset_bus()
359 while (len--) in w1_calc_crc8()
368 dev->attempts++; in w1_search_devices()
369 if (dev->bus_master->search) in w1_search_devices()
370 dev->bus_master->search(dev->bus_master->data, dev, in w1_search_devices()
377 * w1_reset_select_slave() - reset and select a slave
380 * Resets the bus and then selects the slave by sending either a skip rom
381 * or a rom match. A skip rom is issued if there is only one device
389 if (w1_reset_bus(sl->master)) in w1_reset_select_slave()
390 return -1; in w1_reset_select_slave()
392 if (sl->master->slave_count == 1) in w1_reset_select_slave()
393 w1_write_8(sl->master, W1_SKIP_ROM); in w1_reset_select_slave()
396 u64 rn = le64_to_cpu(*((u64*)&sl->reg_num)); in w1_reset_select_slave()
399 w1_write_block(sl->master, match, 9); in w1_reset_select_slave()
406 * w1_reset_resume_command() - resume instead of another match ROM
411 * to doing a reset then a match ROM for the last matched ROM. The
412 * advantage being that the matched ROM step is skipped in favor of the
415 * If the bus has only one slave, traditionnaly the match ROM is skipped
416 * and a "SKIP ROM" is done for efficiency. On multi-slave busses, this
424 return -1; in w1_reset_resume_command()
426 w1_write_8(dev, dev->slave_count > 1 ? W1_RESUME_CMD : W1_SKIP_ROM); in w1_reset_resume_command()
432 * w1_next_pullup() - register for a strong pullup
436 * Put out a strong pull-up of the specified duration after the next write
447 dev->pullup_duration = delay; in w1_next_pullup()