diff options
author | Jean Delvare <khali@linux-fr.org> | 2005-07-31 22:12:09 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2005-09-05 09:14:24 -0700 |
commit | 19f673eddb5a406be72989fb57b7f286772b8cf4 (patch) | |
tree | d552112cd0721467e6ff0a13f8eef7c3491c847c /drivers/hwmon/lm78.c | |
parent | d0f282706df877f8fd8869419e308d24eedb523b (diff) | |
download | kernel_samsung_espresso10-19f673eddb5a406be72989fb57b7f286772b8cf4.zip kernel_samsung_espresso10-19f673eddb5a406be72989fb57b7f286772b8cf4.tar.gz kernel_samsung_espresso10-19f673eddb5a406be72989fb57b7f286772b8cf4.tar.bz2 |
[PATCH] hwmon: hwmon vs i2c, second round (11/11)
Use the common vid_from_reg function in lm78 rather than
reimplementing it.
Signed-off-by: Jean Delvare <khali@linux-fr.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/hwmon/lm78.c')
-rw-r--r-- | drivers/hwmon/lm78.c | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/drivers/hwmon/lm78.c b/drivers/hwmon/lm78.c index 51c0b37..f6730dc 100644 --- a/drivers/hwmon/lm78.c +++ b/drivers/hwmon/lm78.c @@ -25,6 +25,7 @@ #include <linux/i2c.h> #include <linux/i2c-isa.h> #include <linux/hwmon.h> +#include <linux/hwmon-vid.h> #include <linux/err.h> #include <asm/io.h> @@ -106,13 +107,6 @@ static inline int TEMP_FROM_REG(s8 val) return val * 1000; } -/* VID: mV - REG: (see doc/vid) */ -static inline int VID_FROM_REG(u8 val) -{ - return val==0x1f ? 0 : val>=0x10 ? 5100-val*100 : 2050-val*50; -} - #define DIV_FROM_REG(val) (1 << (val)) /* There are some complications in a module like this. First off, LM78 chips @@ -457,7 +451,7 @@ static DEVICE_ATTR(fan3_div, S_IRUGO, show_fan_3_div, NULL); static ssize_t show_vid(struct device *dev, struct device_attribute *attr, char *buf) { struct lm78_data *data = lm78_update_device(dev); - return sprintf(buf, "%d\n", VID_FROM_REG(data->vid)); + return sprintf(buf, "%d\n", vid_from_reg(82, data->vid)); } static DEVICE_ATTR(cpu0_vid, S_IRUGO, show_vid, NULL); |