summaryrefslogtreecommitdiff
path: root/drivers/w1/slaves
diff options
context:
space:
mode:
authorMichael Arndt <michael@scriptkiller.de>2013-02-17 20:51:20 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-02-18 13:55:24 -0800
commit29e5507ae4ab34397f538f06b7070c81a4e4a2bf (patch)
tree6ac51b0113c909e2e5f7fabe8fdabc33bfee04da /drivers/w1/slaves
parent9c95bb6f25ff802081125f24bf0c756252fa27b2 (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/slaves')
-rw-r--r--drivers/w1/slaves/w1_therm.c11
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
* If it was disabled a parasite powered device might not get the require
* current to do a temperature conversion. If it is enabled parasite powered
* devices have a better chance of getting the current required.
+ * In case the parasite power-detection is not working (seems to be the case
+ * for some DS18S20) the strong pullup can also be forced, regardless of the
+ * power state of the devices.
+ *
+ * Summary of options:
+ * - strong_pullup = 0 Disable strong pullup completely
+ * - strong_pullup = 1 Enable automatic strong pullup detection
+ * - strong_pullup = 2 Force strong pullup
*/
static int w1_strong_pullup = 1;
module_param_named(strong_pullup, w1_strong_pullup, int, 0);
@@ -197,7 +205,8 @@ static ssize_t w1_therm_read(struct device *device,
continue;
/* 750ms strong pullup (or delay) after the convert */
- if (!external_power && w1_strong_pullup)
+ if (w1_strong_pullup == 2 ||
+ (!external_power && w1_strong_pullup))
w1_next_pullup(dev, tm);
w1_write_8(dev, W1_CONVERT_TEMP);