diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-07-30 02:05:25 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-08-11 13:14:12 -0400 |
commit | 3a2805e845761ea76a6ad5688d637b2624de0cab (patch) | |
tree | cef5521d2223fe2ab9a686699c52a4c2c6d045f2 | |
parent | 044cd3a574be5cd97ab80d0c6d06f5fab327541d (diff) |
hwmon: (pmbus/lm25066) Ignore byte writes to non-zero pages
pmbus_clear_faults() attempts to clear faults on non-existing real pages.
As a result, the command error bit in the status register is set, and faults
are not really cleared.
All byte writes to non-zero pages are requests to clear the status register
on that page. Since non-zero pages are virtual and do not exist on the chip,
there is nothing to do, and such requests have to be ignored. This fixes
above problem.
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Reviewed-by: Robert Coulson <robert.coulson@ericsson.com>
-rw-r--r-- | drivers/hwmon/pmbus/lm25066.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hwmon/pmbus/lm25066.c b/drivers/hwmon/pmbus/lm25066.c index d4bc114572de..ac254fba551b 100644 --- a/drivers/hwmon/pmbus/lm25066.c +++ b/drivers/hwmon/pmbus/lm25066.c | |||
@@ -161,6 +161,17 @@ static int lm25066_write_word_data(struct i2c_client *client, int page, int reg, | |||
161 | return ret; | 161 | return ret; |
162 | } | 162 | } |
163 | 163 | ||
164 | static int lm25066_write_byte(struct i2c_client *client, int page, u8 value) | ||
165 | { | ||
166 | if (page > 1) | ||
167 | return -EINVAL; | ||
168 | |||
169 | if (page == 0) | ||
170 | return pmbus_write_byte(client, 0, value); | ||
171 | |||
172 | return 0; | ||
173 | } | ||
174 | |||
164 | static int lm25066_probe(struct i2c_client *client, | 175 | static int lm25066_probe(struct i2c_client *client, |
165 | const struct i2c_device_id *id) | 176 | const struct i2c_device_id *id) |
166 | { | 177 | { |
@@ -204,6 +215,7 @@ static int lm25066_probe(struct i2c_client *client, | |||
204 | 215 | ||
205 | info->read_word_data = lm25066_read_word_data; | 216 | info->read_word_data = lm25066_read_word_data; |
206 | info->write_word_data = lm25066_write_word_data; | 217 | info->write_word_data = lm25066_write_word_data; |
218 | info->write_byte = lm25066_write_byte; | ||
207 | 219 | ||
208 | switch (id->driver_data) { | 220 | switch (id->driver_data) { |
209 | case lm25066: | 221 | case lm25066: |