Skip to contentSkip to conversation

hwmon: (pmbus) Add support for

PATCH New Guenter Roeck 1 participant 1 message Jul 14, 2011 Hardware monitoring

lore
Share & tools
lore
#0 lore raw

PATCH v2 7/15 hwmon: (pmbus) Add support for

Some PMBus chips have non-standard sensor registers. An easy way to support such sensors is to introduce virtual pages and map the non-standard registers into standard registers on an extra page.

For this to work, the code verifying if the configured number of pages exists has to be removed. Since a wrong number of pages can only be configured in a front-end driver, this should not have a practical impact since the resulting errors should be found during development and testing.

Also, functions to read the chip status while checking if a command register exists must be modified to no longer set the page register before reading the status, since the physical page associated with the checked register may not exist. This does not make a functional difference since the page was already set when the attempt to read the register was made.

---
v2: Improved status register handling

 drivers/hwmon/pmbus/pmbus.h      |    2 +-
 drivers/hwmon/pmbus/pmbus_core.c |   46 +++++++++++++++----------------------
 2 files changed, 20 insertions(+), 28 deletions(-)
drivers/hwmon/pmbus/pmbus.h +1 -1
index d631cae..ceb71f7 100644
@@ -303,7 +303,7 @@ struct pmbus_driver_info {
 int pmbus_set_page(struct i2c_client *client, u8 page);
 int pmbus_read_word_data(struct i2c_client *client, u8 page, u8 reg);
 int pmbus_write_word_data(struct i2c_client *client, u8 page, u8 reg, u16 word);
-int pmbus_read_byte_data(struct i2c_client *client, u8 page, u8 reg);
+int pmbus_read_byte_data(struct i2c_client *client, int page, u8 reg);
 void pmbus_clear_faults(struct i2c_client *client);
 bool pmbus_check_byte_register(struct i2c_client *client, int page, int reg);
 bool pmbus_check_word_register(struct i2c_client *client, int page, int reg);
drivers/hwmon/pmbus/pmbus_core.c +19 -27

92 lines not on this page · raw message

Signature · 7 lines
1.7.3.1


_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors