aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hwmon
diff options
context:
space:
mode:
authorGuenter Roeck <guenter.roeck@ericsson.com>2011-10-01 19:50:36 -0400
committerGuenter Roeck <guenter.roeck@ericsson.com>2012-01-05 11:19:27 -0500
commitbc581e6fcc3bd901d20765638422ef957559a8d1 (patch)
tree6109bd949447be039d4dd4630b9456ec2281d27e /drivers/hwmon
parent87102808d03948c825c3bdc48316e48f6422fd7e (diff)
hwmon: (pmbus/zl6100) Add support for ZL2005
Add explicit support for ZL2005. Functionality is almost the same as with other Zilker Labs / Intersil chips, but limit register detection does not work reliably. Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com> Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r--drivers/hwmon/pmbus/Kconfig4
-rw-r--r--drivers/hwmon/pmbus/zl6100.c19
2 files changed, 19 insertions, 4 deletions
diff --git a/drivers/hwmon/pmbus/Kconfig b/drivers/hwmon/pmbus/Kconfig
index 4b26f51920ba..d357ab280263 100644
--- a/drivers/hwmon/pmbus/Kconfig
+++ b/drivers/hwmon/pmbus/Kconfig
@@ -113,8 +113,8 @@ config SENSORS_ZL6100
113 default n 113 default n
114 help 114 help
115 If you say yes here you get hardware monitoring support for Intersil 115 If you say yes here you get hardware monitoring support for Intersil
116 ZL2004, ZL2006, ZL2008, ZL2105, ZL2106, ZL6100, and ZL6105 Digital 116 ZL2004, ZL2005, ZL2006, ZL2008, ZL2105, ZL2106, ZL6100, and ZL6105
117 DC/DC Controllers. 117 Digital DC/DC Controllers.
118 118
119 This driver can also be built as a module. If so, the module will 119 This driver can also be built as a module. If so, the module will
120 be called zl6100. 120 be called zl6100.
diff --git a/drivers/hwmon/pmbus/zl6100.c b/drivers/hwmon/pmbus/zl6100.c
index 2bc980006f83..d78bdcf467f3 100644
--- a/drivers/hwmon/pmbus/zl6100.c
+++ b/drivers/hwmon/pmbus/zl6100.c
@@ -28,7 +28,7 @@
28#include <linux/delay.h> 28#include <linux/delay.h>
29#include "pmbus.h" 29#include "pmbus.h"
30 30
31enum chips { zl2004, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105 }; 31enum chips { zl2004, zl2005, zl2006, zl2008, zl2105, zl2106, zl6100, zl6105 };
32 32
33struct zl6100_data { 33struct zl6100_data {
34 int id; 34 int id;
@@ -65,6 +65,19 @@ static int zl6100_read_word_data(struct i2c_client *client, int page, int reg)
65 if (page || reg >= PMBUS_VIRT_BASE) 65 if (page || reg >= PMBUS_VIRT_BASE)
66 return -ENXIO; 66 return -ENXIO;
67 67
68 if (data->id == zl2005) {
69 /*
70 * Limit register detection is not reliable on ZL2005.
71 * Make sure registers are not erroneously detected.
72 */
73 switch (reg) {
74 case PMBUS_VOUT_OV_WARN_LIMIT:
75 case PMBUS_VOUT_UV_WARN_LIMIT:
76 case PMBUS_IOUT_OC_WARN_LIMIT:
77 return -ENXIO;
78 }
79 }
80
68 zl6100_wait(data); 81 zl6100_wait(data);
69 ret = pmbus_read_word_data(client, page, reg); 82 ret = pmbus_read_word_data(client, page, reg);
70 data->access = ktime_get(); 83 data->access = ktime_get();
@@ -123,6 +136,7 @@ static int zl6100_write_byte(struct i2c_client *client, int page, u8 value)
123 136
124static const struct i2c_device_id zl6100_id[] = { 137static const struct i2c_device_id zl6100_id[] = {
125 {"zl2004", zl2004}, 138 {"zl2004", zl2004},
139 {"zl2005", zl2005},
126 {"zl2006", zl2006}, 140 {"zl2006", zl2006},
127 {"zl2008", zl2008}, 141 {"zl2008", zl2008},
128 {"zl2105", zl2105}, 142 {"zl2105", zl2105},
@@ -177,8 +191,9 @@ static int zl6100_probe(struct i2c_client *client,
177 data->id = mid->driver_data; 191 data->id = mid->driver_data;
178 192
179 /* 193 /*
180 * ZL2008, ZL2105, and ZL6100 are known to require a wait time 194 * ZL2005, ZL2008, ZL2105, and ZL6100 are known to require a wait time
181 * between I2C accesses. ZL2004 and ZL6105 are known to be safe. 195 * between I2C accesses. ZL2004 and ZL6105 are known to be safe.
196 * Other chips have not yet been tested.
182 * 197 *
183 * Only clear the wait time for chips known to be safe. The wait time 198 * Only clear the wait time for chips known to be safe. The wait time
184 * can be cleared later for additional chips if tests show that it 199 * can be cleared later for additional chips if tests show that it