diff options
Diffstat (limited to 'drivers/w1/w1_io.c')
-rw-r--r-- | drivers/w1/w1_io.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/drivers/w1/w1_io.c b/drivers/w1/w1_io.c index f7f7e8bec30e..30b6fbf83bd4 100644 --- a/drivers/w1/w1_io.c +++ b/drivers/w1/w1_io.c | |||
@@ -23,10 +23,10 @@ | |||
23 | 23 | ||
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/moduleparam.h> | 25 | #include <linux/moduleparam.h> |
26 | #include <linux/module.h> | ||
26 | 27 | ||
27 | #include "w1.h" | 28 | #include "w1.h" |
28 | #include "w1_log.h" | 29 | #include "w1_log.h" |
29 | #include "w1_io.h" | ||
30 | 30 | ||
31 | static int w1_delay_parm = 1; | 31 | static int w1_delay_parm = 1; |
32 | module_param_named(delay_coef, w1_delay_parm, int, 0); | 32 | module_param_named(delay_coef, w1_delay_parm, int, 0); |
@@ -50,7 +50,7 @@ static u8 w1_crc8_table[] = { | |||
50 | 116, 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53 | 50 | 116, 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53 |
51 | }; | 51 | }; |
52 | 52 | ||
53 | void w1_delay(unsigned long tm) | 53 | static void w1_delay(unsigned long tm) |
54 | { | 54 | { |
55 | udelay(tm * w1_delay_parm); | 55 | udelay(tm * w1_delay_parm); |
56 | } | 56 | } |
@@ -61,7 +61,7 @@ static u8 w1_read_bit(struct w1_master *dev); | |||
61 | /** | 61 | /** |
62 | * Generates a write-0 or write-1 cycle and samples the level. | 62 | * Generates a write-0 or write-1 cycle and samples the level. |
63 | */ | 63 | */ |
64 | u8 w1_touch_bit(struct w1_master *dev, int bit) | 64 | static u8 w1_touch_bit(struct w1_master *dev, int bit) |
65 | { | 65 | { |
66 | if (dev->bus_master->touch_bit) | 66 | if (dev->bus_master->touch_bit) |
67 | return dev->bus_master->touch_bit(dev->bus_master->data, bit); | 67 | return dev->bus_master->touch_bit(dev->bus_master->data, bit); |
@@ -108,6 +108,7 @@ void w1_write_8(struct w1_master *dev, u8 byte) | |||
108 | for (i = 0; i < 8; ++i) | 108 | for (i = 0; i < 8; ++i) |
109 | w1_touch_bit(dev, (byte >> i) & 0x1); | 109 | w1_touch_bit(dev, (byte >> i) & 0x1); |
110 | } | 110 | } |
111 | EXPORT_SYMBOL_GPL(w1_write_8); | ||
111 | 112 | ||
112 | 113 | ||
113 | /** | 114 | /** |
@@ -176,7 +177,7 @@ u8 w1_triplet(struct w1_master *dev, int bdir) | |||
176 | * @param dev the master device | 177 | * @param dev the master device |
177 | * @return the byte read | 178 | * @return the byte read |
178 | */ | 179 | */ |
179 | u8 w1_read_8(struct w1_master * dev) | 180 | static u8 w1_read_8(struct w1_master * dev) |
180 | { | 181 | { |
181 | int i; | 182 | int i; |
182 | u8 res = 0; | 183 | u8 res = 0; |
@@ -208,6 +209,7 @@ void w1_write_block(struct w1_master *dev, const u8 *buf, int len) | |||
208 | for (i = 0; i < len; ++i) | 209 | for (i = 0; i < len; ++i) |
209 | w1_write_8(dev, buf[i]); | 210 | w1_write_8(dev, buf[i]); |
210 | } | 211 | } |
212 | EXPORT_SYMBOL_GPL(w1_write_block); | ||
211 | 213 | ||
212 | /** | 214 | /** |
213 | * Reads a series of bytes. | 215 | * Reads a series of bytes. |
@@ -232,6 +234,7 @@ u8 w1_read_block(struct w1_master *dev, u8 *buf, int len) | |||
232 | 234 | ||
233 | return ret; | 235 | return ret; |
234 | } | 236 | } |
237 | EXPORT_SYMBOL_GPL(w1_read_block); | ||
235 | 238 | ||
236 | /** | 239 | /** |
237 | * Issues a reset bus sequence. | 240 | * Issues a reset bus sequence. |
@@ -257,6 +260,7 @@ int w1_reset_bus(struct w1_master *dev) | |||
257 | 260 | ||
258 | return result; | 261 | return result; |
259 | } | 262 | } |
263 | EXPORT_SYMBOL_GPL(w1_reset_bus); | ||
260 | 264 | ||
261 | u8 w1_calc_crc8(u8 * data, int len) | 265 | u8 w1_calc_crc8(u8 * data, int len) |
262 | { | 266 | { |
@@ -267,14 +271,15 @@ u8 w1_calc_crc8(u8 * data, int len) | |||
267 | 271 | ||
268 | return crc; | 272 | return crc; |
269 | } | 273 | } |
274 | EXPORT_SYMBOL_GPL(w1_calc_crc8); | ||
270 | 275 | ||
271 | void w1_search_devices(struct w1_master *dev, w1_slave_found_callback cb) | 276 | void w1_search_devices(struct w1_master *dev, u8 search_type, w1_slave_found_callback cb) |
272 | { | 277 | { |
273 | dev->attempts++; | 278 | dev->attempts++; |
274 | if (dev->bus_master->search) | 279 | if (dev->bus_master->search) |
275 | dev->bus_master->search(dev->bus_master->data, cb); | 280 | dev->bus_master->search(dev->bus_master->data, search_type, cb); |
276 | else | 281 | else |
277 | w1_search(dev, cb); | 282 | w1_search(dev, search_type, cb); |
278 | } | 283 | } |
279 | 284 | ||
280 | /** | 285 | /** |
@@ -299,14 +304,4 @@ int w1_reset_select_slave(struct w1_slave *sl) | |||
299 | } | 304 | } |
300 | return 0; | 305 | return 0; |
301 | } | 306 | } |
302 | 307 | EXPORT_SYMBOL_GPL(w1_reset_select_slave); | |
303 | EXPORT_SYMBOL(w1_touch_bit); | ||
304 | EXPORT_SYMBOL(w1_write_8); | ||
305 | EXPORT_SYMBOL(w1_read_8); | ||
306 | EXPORT_SYMBOL(w1_reset_bus); | ||
307 | EXPORT_SYMBOL(w1_calc_crc8); | ||
308 | EXPORT_SYMBOL(w1_delay); | ||
309 | EXPORT_SYMBOL(w1_read_block); | ||
310 | EXPORT_SYMBOL(w1_write_block); | ||
311 | EXPORT_SYMBOL(w1_search_devices); | ||
312 | EXPORT_SYMBOL(w1_reset_select_slave); | ||