From 0f29ddf522f3a7a630cff633a37a8025f314130d Mon Sep 17 00:00:00 2001 From: Guenter Roeck Date: Fri, 26 Aug 2011 08:01:51 -0700 Subject: [PATCH] --- yaml --- r: 267260 b: refs/heads/master c: 20fcfe172190704918969695a16cf621e2f4ce25 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/hwmon/pmbus/pmbus.h | 18 ++++++++++++++++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index 33d512b7de24..f7ef1a49baec 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 363a12a49968103ea2c5493932d417d73bc099b7 +refs/heads/master: 20fcfe172190704918969695a16cf621e2f4ce25 diff --git a/trunk/drivers/hwmon/pmbus/pmbus.h b/trunk/drivers/hwmon/pmbus/pmbus.h index a6ae20ffef6b..8751f4073ec2 100644 --- a/trunk/drivers/hwmon/pmbus/pmbus.h +++ b/trunk/drivers/hwmon/pmbus/pmbus.h @@ -134,8 +134,16 @@ * Semantics: * Virtual registers are all word size. * READ registers are read-only; writes are either ignored or return an error. - * RESET registers are read/write. Reading returns zero (used for detection), - * writing any value causes the associated history to be reset. + * RESET registers are read/write. Reading reset registers returns zero + * (used for detection), writing any value causes the associated history to be + * reset. + * Virtual registers have to be handled in device specific driver code. Chip + * driver code returns non-negative register values if a virtual register is + * supported, or a negative error code if not. The chip driver may return + * -ENODATA or any other error code in this case, though an error code other + * than -ENODATA is handled more efficiently and thus preferred. Either case, + * the calling PMBus core code will abort if the chip driver returns an error + * code when reading or writing virtual registers. */ #define PMBUS_VIRT_BASE 0x100 #define PMBUS_VIRT_READ_TEMP_MIN (PMBUS_VIRT_BASE + 0) @@ -320,6 +328,12 @@ struct pmbus_driver_info { * The following functions map manufacturing specific register values * to PMBus standard register values. Specify only if mapping is * necessary. + * Functions return the register value (read) or zero (write) if + * successful. A return value of -ENODATA indicates that there is no + * manufacturer specific register, but that a standard PMBus register + * may exist. Any other negative return value indicates that the + * register does not exist, and that no attempt should be made to read + * the standard register. */ int (*read_byte_data)(struct i2c_client *client, int page, int reg); int (*read_word_data)(struct i2c_client *client, int page, int reg);