aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1/w1.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.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.c')
-rw-r--r--drivers/w1/w1.c30
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/w1/w1.c b/drivers/w1/w1.c
index 53846c7f24ff..9eb816b2ea5e 100644
--- a/drivers/w1/w1.c
+++ b/drivers/w1/w1.c
@@ -50,8 +50,21 @@ int w1_max_slave_count = 64;
50int w1_max_slave_ttl = 10; 50int w1_max_slave_ttl = 10;
51 51
52module_param_named(timeout, w1_timeout, int, 0); 52module_param_named(timeout, w1_timeout, int, 0);
53MODULE_PARM_DESC(timeout, "time in seconds between automatic slave searches");
54/* A search stops when w1_max_slave_count devices have been found in that
55 * search. The next search will start over and detect the same set of devices
56 * on a static 1-wire bus. Memory is not allocated based on this number, just
57 * on the number of devices known to the kernel. Having a high number does not
58 * consume additional resources. As a special case, if there is only one
59 * device on the network and w1_max_slave_count is set to 1, the device id can
60 * be read directly skipping the normal slower search process.
61 */
53module_param_named(max_slave_count, w1_max_slave_count, int, 0); 62module_param_named(max_slave_count, w1_max_slave_count, int, 0);
63MODULE_PARM_DESC(max_slave_count,
64 "maximum number of slaves detected in a search");
54module_param_named(slave_ttl, w1_max_slave_ttl, int, 0); 65module_param_named(slave_ttl, w1_max_slave_ttl, int, 0);
66MODULE_PARM_DESC(slave_ttl,
67 "Number of searches not seeing a slave before it will be removed");
55 68
56DEFINE_MUTEX(w1_mlock); 69DEFINE_MUTEX(w1_mlock);
57LIST_HEAD(w1_masters); 70LIST_HEAD(w1_masters);
@@ -920,7 +933,12 @@ void w1_slave_found(struct w1_master *dev, u64 rn)
920} 933}
921 934
922/** 935/**
923 * Performs a ROM Search & registers any devices found. 936 * w1_search() - Performs a ROM Search & registers any devices found.
937 * @dev: The master device to search
938 * @search_type: W1_SEARCH to search all devices, or W1_ALARM_SEARCH
939 * to return only devices in the alarmed state
940 * @cb: Function to call when a device is found
941 *
924 * The 1-wire search is a simple binary tree search. 942 * The 1-wire search is a simple binary tree search.
925 * For each bit of the address, we read two bits and write one bit. 943 * For each bit of the address, we read two bits and write one bit.
926 * The bit written will put to sleep all devies that don't match that bit. 944 * The bit written will put to sleep all devies that don't match that bit.
@@ -930,8 +948,6 @@ void w1_slave_found(struct w1_master *dev, u64 rn)
930 * 948 *
931 * See "Application note 187 1-wire search algorithm" at www.maxim-ic.com 949 * See "Application note 187 1-wire search algorithm" at www.maxim-ic.com
932 * 950 *
933 * @dev The master device to search
934 * @cb Function to call when a device is found
935 */ 951 */
936void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb) 952void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb)
937{ 953{
@@ -990,7 +1006,7 @@ void w1_search(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb
990 else 1006 else
991 search_bit = ((last_rn >> i) & 0x1); 1007 search_bit = ((last_rn >> i) & 0x1);
992 1008
993 /** Read two bits and write one bit */ 1009 /* Read two bits and write one bit */
994 triplet_ret = w1_triplet(dev, search_bit); 1010 triplet_ret = w1_triplet(dev, search_bit);
995 1011
996 /* quit if no device responded */ 1012 /* quit if no device responded */
@@ -1074,6 +1090,12 @@ static void w1_search_process(struct w1_master *dev, u8 search_type)
1074 w1_search_process_cb(dev, search_type, w1_slave_found); 1090 w1_search_process_cb(dev, search_type, w1_slave_found);
1075} 1091}
1076 1092
1093/**
1094 * w1_process_callbacks() - execute each dev->async_list callback entry
1095 * @dev: w1_master device
1096 *
1097 * Return: 1 if there were commands to executed 0 otherwise
1098 */
1077int w1_process_callbacks(struct w1_master *dev) 1099int w1_process_callbacks(struct w1_master *dev)
1078{ 1100{
1079 int ret = 0; 1101 int ret = 0;