diff options
author | Guenter Roeck <linux@roeck-us.net> | 2012-02-24 11:13:31 -0500 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2012-03-18 21:27:49 -0400 |
commit | 56aad5d143cbce620c079e1acf761b71f59758a0 (patch) | |
tree | 39705a8f7d580d9d1b352aac5d5bc5e69393db15 | |
parent | f15df57ded710bd018794a264b900975ce3599a0 (diff) |
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>
-rw-r--r-- | Documentation/hwmon/max34440 | 1 | ||||
-rw-r--r-- | drivers/hwmon/pmbus/max34440.c | 9 |
2 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/hwmon/max34440 b/Documentation/hwmon/max34440 index 8ab51536a1eb..36b335c461dc 100644 --- a/Documentation/hwmon/max34440 +++ b/Documentation/hwmon/max34440 | |||
@@ -56,6 +56,7 @@ in[1-6]_min_alarm Voltage low alarm. From VOLTAGE_UV_WARNING status. | |||
56 | in[1-6]_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status. | 56 | in[1-6]_max_alarm Voltage high alarm. From VOLTAGE_OV_WARNING status. |
57 | in[1-6]_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status. | 57 | in[1-6]_lcrit_alarm Voltage critical low alarm. From VOLTAGE_UV_FAULT status. |
58 | in[1-6]_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status. | 58 | in[1-6]_crit_alarm Voltage critical high alarm. From VOLTAGE_OV_FAULT status. |
59 | in[1-6]_lowest Historical minimum voltage. | ||
59 | in[1-6]_highest Historical maximum voltage. | 60 | in[1-6]_highest Historical maximum voltage. |
60 | in[1-6]_reset_history Write any value to reset history. | 61 | in[1-6]_reset_history Write any value to reset history. |
61 | 62 | ||
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 }; | |||
30 | #define MAX34440_MFR_VOUT_PEAK 0xd4 | 30 | #define MAX34440_MFR_VOUT_PEAK 0xd4 |
31 | #define MAX34440_MFR_IOUT_PEAK 0xd5 | 31 | #define MAX34440_MFR_IOUT_PEAK 0xd5 |
32 | #define MAX34440_MFR_TEMPERATURE_PEAK 0xd6 | 32 | #define MAX34440_MFR_TEMPERATURE_PEAK 0xd6 |
33 | #define MAX34440_MFR_VOUT_MIN 0xd7 | ||
33 | 34 | ||
34 | #define MAX34440_STATUS_OC_WARN (1 << 0) | 35 | #define MAX34440_STATUS_OC_WARN (1 << 0) |
35 | #define MAX34440_STATUS_OC_FAULT (1 << 1) | 36 | #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) | |||
41 | int ret; | 42 | int ret; |
42 | 43 | ||
43 | switch (reg) { | 44 | switch (reg) { |
45 | case PMBUS_VIRT_READ_VOUT_MIN: | ||
46 | ret = pmbus_read_word_data(client, page, | ||
47 | MAX34440_MFR_VOUT_MIN); | ||
48 | break; | ||
44 | case PMBUS_VIRT_READ_VOUT_MAX: | 49 | case PMBUS_VIRT_READ_VOUT_MAX: |
45 | ret = pmbus_read_word_data(client, page, | 50 | ret = pmbus_read_word_data(client, page, |
46 | MAX34440_MFR_VOUT_PEAK); | 51 | MAX34440_MFR_VOUT_PEAK); |
@@ -73,6 +78,10 @@ static int max34440_write_word_data(struct i2c_client *client, int page, | |||
73 | switch (reg) { | 78 | switch (reg) { |
74 | case PMBUS_VIRT_RESET_VOUT_HISTORY: | 79 | case PMBUS_VIRT_RESET_VOUT_HISTORY: |
75 | ret = pmbus_write_word_data(client, page, | 80 | ret = pmbus_write_word_data(client, page, |
81 | MAX34440_MFR_VOUT_MIN, 0x7fff); | ||
82 | if (ret) | ||
83 | break; | ||
84 | ret = pmbus_write_word_data(client, page, | ||
76 | MAX34440_MFR_VOUT_PEAK, 0); | 85 | MAX34440_MFR_VOUT_PEAK, 0); |
77 | break; | 86 | break; |
78 | case PMBUS_VIRT_RESET_IOUT_HISTORY: | 87 | case PMBUS_VIRT_RESET_IOUT_HISTORY: |