aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/w1/slaves/w1_therm13
-rw-r--r--drivers/w1/slaves/w1_therm.c11
2 files changed, 20 insertions, 4 deletions
diff --git a/Documentation/w1/slaves/w1_therm b/Documentation/w1/slaves/w1_therm
index 874a8ca93feb..cc62a95e4776 100644
--- a/Documentation/w1/slaves/w1_therm
+++ b/Documentation/w1/slaves/w1_therm
@@ -34,9 +34,16 @@ currently supported. The driver also doesn't support reduced
34precision (which would also reduce the conversion time). 34precision (which would also reduce the conversion time).
35 35
36The module parameter strong_pullup can be set to 0 to disable the 36The module parameter strong_pullup can be set to 0 to disable the
37strong pullup or 1 to enable. If enabled the 5V strong pullup will be 37strong pullup, 1 to enable autodetection or 2 to force strong pullup.
38enabled when the conversion is taking place provided the master driver 38In case of autodetection, the driver will use the "READ POWER SUPPLY"
39must support the strong pullup (or it falls back to a pullup 39command to check if there are pariste powered devices on the bus.
40If so, it will activate the master's strong pullup.
41In case the detection of parasite devices using this command fails
42(seems to be the case with some DS18S20) the strong pullup can
43be force-enabled.
44If the strong pullup is enabled, the master's strong pullup will be
45driven when the conversion is taking place, provided the master driver
46does support the strong pullup (or it falls back to a pullup
40resistor). The DS18b20 temperature sensor specification lists a 47resistor). The DS18b20 temperature sensor specification lists a
41maximum current draw of 1.5mA and that a 5k pullup resistor is not 48maximum current draw of 1.5mA and that a 5k pullup resistor is not
42sufficient. The strong pullup is designed to provide the additional 49sufficient. The strong pullup is designed to provide the additional
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 */
45static int w1_strong_pullup = 1; 53static int w1_strong_pullup = 1;
46module_param_named(strong_pullup, w1_strong_pullup, int, 0); 54module_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);