summaryrefslogtreecommitdiff
path: root/drivers/hwmon/pmbus
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2012-02-24 08:13:31 -0800
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-03-18 18:27:49 -0700
commit56aad5d143cbce620c079e1acf761b71f59758a0 (patch)
tree39705a8f7d580d9d1b352aac5d5bc5e69393db15 /drivers/hwmon/pmbus
parentf15df57ded710bd018794a264b900975ce3599a0 (diff)
downloadlwn-56aad5d143cbce620c079e1acf761b71f59758a0.tar.gz
lwn-56aad5d143cbce620c079e1acf761b71f59758a0.zip
hwmon: (max34440) Add support for 'lowest' output voltage attribute
MAX34440 and compatibles support reporting the lowest measured output voltage. Add support for it. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Acked-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/pmbus')
-rw-r--r--drivers/hwmon/pmbus/max34440.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/max34440.c b/drivers/hwmon/pmbus/max34440.c
index 7d830c1e7032..95ee9e195cb6 100644
--- a/drivers/hwmon/pmbus/max34440.c
+++ b/drivers/hwmon/pmbus/max34440.c
@@ -30,6 +30,7 @@ enum chips { max34440, max34441 };
#define MAX34440_MFR_VOUT_PEAK 0xd4
#define MAX34440_MFR_IOUT_PEAK 0xd5
#define MAX34440_MFR_TEMPERATURE_PEAK 0xd6
+#define MAX34440_MFR_VOUT_MIN 0xd7
#define MAX34440_STATUS_OC_WARN (1 << 0)
#define MAX34440_STATUS_OC_FAULT (1 << 1)
@@ -41,6 +42,10 @@ static int max34440_read_word_data(struct i2c_client *client, int page, int reg)
int ret;
switch (reg) {
+ case PMBUS_VIRT_READ_VOUT_MIN:
+ ret = pmbus_read_word_data(client, page,
+ MAX34440_MFR_VOUT_MIN);
+ break;
case PMBUS_VIRT_READ_VOUT_MAX:
ret = pmbus_read_word_data(client, page,
MAX34440_MFR_VOUT_PEAK);
@@ -73,6 +78,10 @@ static int max34440_write_word_data(struct i2c_client *client, int page,
switch (reg) {
case PMBUS_VIRT_RESET_VOUT_HISTORY:
ret = pmbus_write_word_data(client, page,
+ MAX34440_MFR_VOUT_MIN, 0x7fff);
+ if (ret)
+ break;
+ ret = pmbus_write_word_data(client, page,
MAX34440_MFR_VOUT_PEAK, 0);
break;
case PMBUS_VIRT_RESET_IOUT_HISTORY: