aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1_io.c
diff options
context:
space:
mode:
authorDavid Fries <David@Fries.net>2014-01-15 23:29:25 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-02-07 18:40:18 -0500
commitb3be177a19f0f9e4f0deb473cef0e95e1254f2e9 (patch)
treee124f5b65942b7883fb2dcdc29e8e4ffca2625a7 /drivers/w1/w1_io.c
parenteb2c0da4ac2f4614b0bd3a1b6a0e9b82d0802e08 (diff)
w1: format for DocBook and fixes
Switch the code documentation format style to DocBook format, enable DocBook documentation generation, and fix some comments. Signed-off-by: David Fries <David@Fries.net> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1/w1_io.c')
-rw-r--r--drivers/w1/w1_io.c102
1 files changed, 57 insertions, 45 deletions
diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c
index e10acc237733..282092421cc9 100644
--- a/drivers/w1/w1_io.c
+++ b/drivers/w1/w1_io.c
@@ -62,7 +62,9 @@ static void w1_write_bit(struct w1_master *dev, int bit);
62static u8 w1_read_bit(struct w1_master *dev); 62static u8 w1_read_bit(struct w1_master *dev);
63 63
64/** 64/**
65 * Generates a write-0 or write-1 cycle and samples the level. 65 * w1_touch_bit() - Generates a write-0 or write-1 cycle and samples the level.
66 * @dev: the master device
67 * @bit: 0 - write a 0, 1 - write a 0 read the level
66 */ 68 */
67static u8 w1_touch_bit(struct w1_master *dev, int bit) 69static u8 w1_touch_bit(struct w1_master *dev, int bit)
68{ 70{
@@ -77,7 +79,10 @@ static u8 w1_touch_bit(struct w1_master *dev, int bit)
77} 79}
78 80
79/** 81/**
80 * Generates a write-0 or write-1 cycle. 82 * w1_write_bit() - Generates a write-0 or write-1 cycle.
83 * @dev: the master device
84 * @bit: bit to write
85 *
81 * Only call if dev->bus_master->touch_bit is NULL 86 * Only call if dev->bus_master->touch_bit is NULL
82 */ 87 */
83static void w1_write_bit(struct w1_master *dev, int bit) 88static void w1_write_bit(struct w1_master *dev, int bit)
@@ -102,11 +107,12 @@ static void w1_write_bit(struct w1_master *dev, int bit)
102} 107}
103 108
104/** 109/**
110 * w1_pre_write() - pre-write operations
111 * @dev: the master device
112 *
105 * Pre-write operation, currently only supporting strong pullups. 113 * Pre-write operation, currently only supporting strong pullups.
106 * Program the hardware for a strong pullup, if one has been requested and 114 * Program the hardware for a strong pullup, if one has been requested and
107 * the hardware supports it. 115 * the hardware supports it.
108 *
109 * @param dev the master device
110 */ 116 */
111static void w1_pre_write(struct w1_master *dev) 117static void w1_pre_write(struct w1_master *dev)
112{ 118{
@@ -118,11 +124,12 @@ static void w1_pre_write(struct w1_master *dev)
118} 124}
119 125
120/** 126/**
127 * w1_post_write() - post-write options
128 * @dev: the master device
129 *
121 * Post-write operation, currently only supporting strong pullups. 130 * Post-write operation, currently only supporting strong pullups.
122 * If a strong pullup was requested, clear it if the hardware supports 131 * If a strong pullup was requested, clear it if the hardware supports
123 * them, or execute the delay otherwise, in either case clear the request. 132 * them, or execute the delay otherwise, in either case clear the request.
124 *
125 * @param dev the master device
126 */ 133 */
127static void w1_post_write(struct w1_master *dev) 134static void w1_post_write(struct w1_master *dev)
128{ 135{
@@ -136,10 +143,9 @@ static void w1_post_write(struct w1_master *dev)
136} 143}
137 144
138/** 145/**
139 * Writes 8 bits. 146 * w1_write_8() - Writes 8 bits.
140 * 147 * @dev: the master device
141 * @param dev the master device 148 * @byte: the byte to write
142 * @param byte the byte to write
143 */ 149 */
144void w1_write_8(struct w1_master *dev, u8 byte) 150void w1_write_8(struct w1_master *dev, u8 byte)
145{ 151{
@@ -161,7 +167,9 @@ EXPORT_SYMBOL_GPL(w1_write_8);
161 167
162 168
163/** 169/**
164 * Generates a write-1 cycle and samples the level. 170 * w1_read_bit() - Generates a write-1 cycle and samples the level.
171 * @dev: the master device
172 *
165 * Only call if dev->bus_master->touch_bit is NULL 173 * Only call if dev->bus_master->touch_bit is NULL
166 */ 174 */
167static u8 w1_read_bit(struct w1_master *dev) 175static u8 w1_read_bit(struct w1_master *dev)
@@ -185,16 +193,17 @@ static u8 w1_read_bit(struct w1_master *dev)
185} 193}
186 194
187/** 195/**
188 * Does a triplet - used for searching ROM addresses. 196 * w1_triplet() - * Does a triplet - used for searching ROM addresses.
197 * @dev: the master device
198 * @bdir: the bit to write if both id_bit and comp_bit are 0
199 *
189 * Return bits: 200 * Return bits:
190 * bit 0 = id_bit 201 * bit 0 = id_bit
191 * bit 1 = comp_bit 202 * bit 1 = comp_bit
192 * bit 2 = dir_taken 203 * bit 2 = dir_taken
193 * If both bits 0 & 1 are set, the search should be restarted. 204 * If both bits 0 & 1 are set, the search should be restarted.
194 * 205 *
195 * @param dev the master device 206 * Return: bit fields - see above
196 * @param bdir the bit to write if both id_bit and comp_bit are 0
197 * @return bit fields - see above
198 */ 207 */
199u8 w1_triplet(struct w1_master *dev, int bdir) 208u8 w1_triplet(struct w1_master *dev, int bdir)
200{ 209{
@@ -226,10 +235,10 @@ u8 w1_triplet(struct w1_master *dev, int bdir)
226} 235}
227 236
228/** 237/**
229 * Reads 8 bits. 238 * w1_read_8() - Reads 8 bits.
239 * @dev: the master device
230 * 240 *
231 * @param dev the master device 241 * Return: the byte read
232 * @return the byte read
233 */ 242 */
234u8 w1_read_8(struct w1_master *dev) 243u8 w1_read_8(struct w1_master *dev)
235{ 244{
@@ -247,11 +256,10 @@ u8 w1_read_8(struct w1_master *dev)
247EXPORT_SYMBOL_GPL(w1_read_8); 256EXPORT_SYMBOL_GPL(w1_read_8);
248 257
249/** 258/**
250 * Writes a series of bytes. 259 * w1_write_block() - Writes a series of bytes.
251 * 260 * @dev: the master device
252 * @param dev the master device 261 * @buf: pointer to the data to write
253 * @param buf pointer to the data to write 262 * @len: the number of bytes to write
254 * @param len the number of bytes to write
255 */ 263 */
256void w1_write_block(struct w1_master *dev, const u8 *buf, int len) 264void w1_write_block(struct w1_master *dev, const u8 *buf, int len)
257{ 265{
@@ -269,11 +277,10 @@ void w1_write_block(struct w1_master *dev, const u8 *buf, int len)
269EXPORT_SYMBOL_GPL(w1_write_block); 277EXPORT_SYMBOL_GPL(w1_write_block);
270 278
271/** 279/**
272 * Touches a series of bytes. 280 * w1_touch_block() - Touches a series of bytes.
273 * 281 * @dev: the master device
274 * @param dev the master device 282 * @buf: pointer to the data to write
275 * @param buf pointer to the data to write 283 * @len: the number of bytes to write
276 * @param len the number of bytes to write
277 */ 284 */
278void w1_touch_block(struct w1_master *dev, u8 *buf, int len) 285void w1_touch_block(struct w1_master *dev, u8 *buf, int len)
279{ 286{
@@ -294,12 +301,11 @@ void w1_touch_block(struct w1_master *dev, u8 *buf, int len)
294EXPORT_SYMBOL_GPL(w1_touch_block); 301EXPORT_SYMBOL_GPL(w1_touch_block);
295 302
296/** 303/**
297 * Reads a series of bytes. 304 * w1_read_block() - Reads a series of bytes.
298 * 305 * @dev: the master device
299 * @param dev the master device 306 * @buf: pointer to the buffer to fill
300 * @param buf pointer to the buffer to fill 307 * @len: the number of bytes to read
301 * @param len the number of bytes to read 308 * Return: the number of bytes read
302 * @return the number of bytes read
303 */ 309 */
304u8 w1_read_block(struct w1_master *dev, u8 *buf, int len) 310u8 w1_read_block(struct w1_master *dev, u8 *buf, int len)
305{ 311{
@@ -319,10 +325,9 @@ u8 w1_read_block(struct w1_master *dev, u8 *buf, int len)
319EXPORT_SYMBOL_GPL(w1_read_block); 325EXPORT_SYMBOL_GPL(w1_read_block);
320 326
321/** 327/**
322 * Issues a reset bus sequence. 328 * w1_reset_bus() - Issues a reset bus sequence.
323 * 329 * @dev: the master device
324 * @param dev The bus master pointer 330 * Return: 0=Device present, 1=No device present or error
325 * @return 0=Device present, 1=No device present or error
326 */ 331 */
327int w1_reset_bus(struct w1_master *dev) 332int w1_reset_bus(struct w1_master *dev)
328{ 333{
@@ -383,12 +388,15 @@ void w1_search_devices(struct w1_master *dev, u8 search_type, w1_slave_found_cal
383} 388}
384 389
385/** 390/**
391 * w1_reset_select_slave() - reset and select a slave
392 * @sl: the slave to select
393 *
386 * Resets the bus and then selects the slave by sending either a skip rom 394 * Resets the bus and then selects the slave by sending either a skip rom
387 * or a rom match. 395 * or a rom match. A skip rom is issued if there is only one device
396 * registered on the bus.
388 * The w1 master lock must be held. 397 * The w1 master lock must be held.
389 * 398 *
390 * @param sl the slave to select 399 * Return: 0=success, anything else=error
391 * @return 0=success, anything else=error
392 */ 400 */
393int w1_reset_select_slave(struct w1_slave *sl) 401int w1_reset_select_slave(struct w1_slave *sl)
394{ 402{
@@ -409,6 +417,9 @@ int w1_reset_select_slave(struct w1_slave *sl)
409EXPORT_SYMBOL_GPL(w1_reset_select_slave); 417EXPORT_SYMBOL_GPL(w1_reset_select_slave);
410 418
411/** 419/**
420 * w1_reset_resume_command() - resume instead of another match ROM
421 * @dev: the master device
422 *
412 * When the workflow with a slave amongst many requires several 423 * When the workflow with a slave amongst many requires several
413 * successive commands a reset between each, this function is similar 424 * successive commands a reset between each, this function is similar
414 * to doing a reset then a match ROM for the last matched ROM. The 425 * to doing a reset then a match ROM for the last matched ROM. The
@@ -420,8 +431,6 @@ EXPORT_SYMBOL_GPL(w1_reset_select_slave);
420 * doesn't work of course, but the resume command is the next best thing. 431 * doesn't work of course, but the resume command is the next best thing.
421 * 432 *
422 * The w1 master lock must be held. 433 * The w1 master lock must be held.
423 *
424 * @param dev the master device
425 */ 434 */
426int w1_reset_resume_command(struct w1_master *dev) 435int w1_reset_resume_command(struct w1_master *dev)
427{ 436{
@@ -435,6 +444,10 @@ int w1_reset_resume_command(struct w1_master *dev)
435EXPORT_SYMBOL_GPL(w1_reset_resume_command); 444EXPORT_SYMBOL_GPL(w1_reset_resume_command);
436 445
437/** 446/**
447 * w1_next_pullup() - register for a strong pullup
448 * @dev: the master device
449 * @delay: time in milliseconds
450 *
438 * Put out a strong pull-up of the specified duration after the next write 451 * Put out a strong pull-up of the specified duration after the next write
439 * operation. Not all hardware supports strong pullups. Hardware that 452 * operation. Not all hardware supports strong pullups. Hardware that
440 * doesn't support strong pullups will sleep for the given time after the 453 * doesn't support strong pullups will sleep for the given time after the
@@ -442,8 +455,7 @@ EXPORT_SYMBOL_GPL(w1_reset_resume_command);
442 * the next write, specifying zero will clear a previous request. 455 * the next write, specifying zero will clear a previous request.
443 * The w1 master lock must be held. 456 * The w1 master lock must be held.
444 * 457 *
445 * @param delay time in milliseconds 458 * Return: 0=success, anything else=error
446 * @return 0=success, anything else=error
447 */ 459 */
448void w1_next_pullup(struct w1_master *dev, int delay) 460void w1_next_pullup(struct w1_master *dev, int delay)
449{ 461{