diff options
author | Michael Arndt <michael@scriptkiller.de> | 2013-02-17 14:51:20 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-02-18 16:55:24 -0500 |
commit | 29e5507ae4ab34397f538f06b7070c81a4e4a2bf (patch) | |
tree | 6ac51b0113c909e2e5f7fabe8fdabc33bfee04da /drivers/w1 | |
parent | 9c95bb6f25ff802081125f24bf0c756252fa27b2 (diff) |
w1: w1_therm: Add force-pullup option for "broken" sensors
Signed-off-by: Michael Arndt <michael@scriptkiller.de>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r-- | drivers/w1/slaves/w1_therm.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index 5ef583d520fa..c1a702f8c803 100644 --- a/drivers/w1/slaves/w1_therm.c +++ b/drivers/w1/slaves/w1_therm.c | |||
@@ -41,6 +41,14 @@ MODULE_DESCRIPTION("Driver for 1-wire Dallas network protocol, temperature famil | |||
41 | * If it was disabled a parasite powered device might not get the require | 41 | * If it was disabled a parasite powered device might not get the require |
42 | * current to do a temperature conversion. If it is enabled parasite powered | 42 | * current to do a temperature conversion. If it is enabled parasite powered |
43 | * devices have a better chance of getting the current required. | 43 | * devices have a better chance of getting the current required. |
44 | * In case the parasite power-detection is not working (seems to be the case | ||
45 | * for some DS18S20) the strong pullup can also be forced, regardless of the | ||
46 | * power state of the devices. | ||
47 | * | ||
48 | * Summary of options: | ||
49 | * - strong_pullup = 0 Disable strong pullup completely | ||
50 | * - strong_pullup = 1 Enable automatic strong pullup detection | ||
51 | * - strong_pullup = 2 Force strong pullup | ||
44 | */ | 52 | */ |
45 | static int w1_strong_pullup = 1; | 53 | static int w1_strong_pullup = 1; |
46 | module_param_named(strong_pullup, w1_strong_pullup, int, 0); | 54 | module_param_named(strong_pullup, w1_strong_pullup, int, 0); |
@@ -197,7 +205,8 @@ static ssize_t w1_therm_read(struct device *device, | |||
197 | continue; | 205 | continue; |
198 | 206 | ||
199 | /* 750ms strong pullup (or delay) after the convert */ | 207 | /* 750ms strong pullup (or delay) after the convert */ |
200 | if (!external_power && w1_strong_pullup) | 208 | if (w1_strong_pullup == 2 || |
209 | (!external_power && w1_strong_pullup)) | ||
201 | w1_next_pullup(dev, tm); | 210 | w1_next_pullup(dev, tm); |
202 | 211 | ||
203 | w1_write_8(dev, W1_CONVERT_TEMP); | 212 | w1_write_8(dev, W1_CONVERT_TEMP); |