aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Coady <grant_lkml@dodo.com.au>2005-05-11 23:41:51 -0400
committerGreg Kroah-Hartman <gregkh@suse.de>2005-06-22 00:51:56 -0400
commitabc01922477104e8d72b494902aff37135c409e7 (patch)
tree7ef178b1a14e89c88bac1a976c238c91fc1697ee
parentb9826b3ee8faa468a26782e3bf37716a73d96730 (diff)
[PATCH] I2C: Setting w83627hf fan divisor 128 fails.
Jarkko Lavinen provided patch to fix: "couldn't set the divisor 128 through fan1_div sysfs entry even though the chip supports it and setting divisors 1..64 worked. This was due to POWER_TO_REG() only checking 2's powers 0 till 5 but not 6." This patch applies that fix to w83627hf and w83781d drivers. Signed-off-by: Grant Coady <gcoady@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
-rw-r--r--drivers/i2c/chips/w83627hf.c2
-rw-r--r--drivers/i2c/chips/w83781d.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/drivers/i2c/chips/w83627hf.c b/drivers/i2c/chips/w83627hf.c
index 4f1bff572c1c..bd87a42e068a 100644
--- a/drivers/i2c/chips/w83627hf.c
+++ b/drivers/i2c/chips/w83627hf.c
@@ -264,7 +264,7 @@ static inline u8 DIV_TO_REG(long val)
264{ 264{
265 int i; 265 int i;
266 val = SENSORS_LIMIT(val, 1, 128) >> 1; 266 val = SENSORS_LIMIT(val, 1, 128) >> 1;
267 for (i = 0; i < 6; i++) { 267 for (i = 0; i < 7; i++) {
268 if (val == 0) 268 if (val == 0)
269 break; 269 break;
270 val >>= 1; 270 val >>= 1;
diff --git a/drivers/i2c/chips/w83781d.c b/drivers/i2c/chips/w83781d.c
index 8912390d3017..f47aee88e20c 100644
--- a/drivers/i2c/chips/w83781d.c
+++ b/drivers/i2c/chips/w83781d.c
@@ -192,7 +192,7 @@ DIV_TO_REG(long val, enum chips type)
192 val = SENSORS_LIMIT(val, 1, 192 val = SENSORS_LIMIT(val, 1,
193 ((type == w83781d 193 ((type == w83781d
194 || type == as99127f) ? 8 : 128)) >> 1; 194 || type == as99127f) ? 8 : 128)) >> 1;
195 for (i = 0; i < 6; i++) { 195 for (i = 0; i < 7; i++) {
196 if (val == 0) 196 if (val == 0)
197 break; 197 break;
198 val >>= 1; 198 val >>= 1;