Commit 205c2efe authored by Martin Schlemmer's avatar Martin Schlemmer Committed by Greg Kroah-Hartman

[PATCH] i2c: Fix w83781d sensor to use Milli-Volt for in_* in sysfs

I did the w83781d sysfs update as per the old spec, which was not
milli-volt.  This patch should fix it.
parent affdf6c2
...@@ -364,7 +364,7 @@ static ssize_t show_##reg (struct device *dev, char *buf, int nr) \ ...@@ -364,7 +364,7 @@ static ssize_t show_##reg (struct device *dev, char *buf, int nr) \
\ \
w83781d_update_client(client); \ w83781d_update_client(client); \
\ \
return sprintf(buf,"%ld\n", (long)IN_FROM_REG(data->reg[nr])); \ return sprintf(buf,"%ld\n", (long)IN_FROM_REG(data->reg[nr] * 10)); \
} }
show_in_reg(in); show_in_reg(in);
show_in_reg(in_min); show_in_reg(in_min);
...@@ -378,7 +378,7 @@ static ssize_t store_in_##reg (struct device *dev, const char *buf, size_t count ...@@ -378,7 +378,7 @@ static ssize_t store_in_##reg (struct device *dev, const char *buf, size_t count
u32 val; \ u32 val; \
\ \
val = simple_strtoul(buf, NULL, 10); \ val = simple_strtoul(buf, NULL, 10); \
data->in_##reg[nr] = IN_TO_REG(val); \ data->in_##reg[nr] = (IN_TO_REG(val) / 10); \
w83781d_write_value(client, W83781D_REG_IN_##REG(nr), data->in_##reg[nr]); \ w83781d_write_value(client, W83781D_REG_IN_##REG(nr), data->in_##reg[nr]); \
\ \
return count; \ return count; \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment