diff options
author | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-08-26 11:01:51 -0400 |
---|---|---|
committer | Guenter Roeck <guenter.roeck@ericsson.com> | 2011-10-24 14:09:33 -0400 |
commit | 20fcfe172190704918969695a16cf621e2f4ce25 (patch) | |
tree | 603eeef49ea33bdb4817666f718356cc215e3ea4 /drivers/hwmon/pmbus | |
parent | 363a12a49968103ea2c5493932d417d73bc099b7 (diff) |
hwmon: (pmbus) Add comments explaining internal driver API return values
Return values for functions reading/writing manufacturer specific registers are
poorly explained. Add comments to improve documentation.
Signed-off-by: Guenter Roeck <guenter.roeck@ericsson.com>
Acked-by: Jean Delvare <khali@linux-fr.org>
Diffstat (limited to 'drivers/hwmon/pmbus')
-rw-r--r-- | drivers/hwmon/pmbus/pmbus.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h index a6ae20ffef6b..8751f4073ec2 100644 --- a/drivers/hwmon/pmbus/pmbus.h +++ b/drivers/hwmon/pmbus/pmbus.h | |||
@@ -134,8 +134,16 @@ | |||
134 | * Semantics: | 134 | * Semantics: |
135 | * Virtual registers are all word size. | 135 | * Virtual registers are all word size. |
136 | * READ registers are read-only; writes are either ignored or return an error. | 136 | * READ registers are read-only; writes are either ignored or return an error. |
137 | * RESET registers are read/write. Reading returns zero (used for detection), | 137 | * RESET registers are read/write. Reading reset registers returns zero |
138 | * writing any value causes the associated history to be reset. | 138 | * (used for detection), writing any value causes the associated history to be |
139 | * reset. | ||
140 | * Virtual registers have to be handled in device specific driver code. Chip | ||
141 | * driver code returns non-negative register values if a virtual register is | ||
142 | * supported, or a negative error code if not. The chip driver may return | ||
143 | * -ENODATA or any other error code in this case, though an error code other | ||
144 | * than -ENODATA is handled more efficiently and thus preferred. Either case, | ||
145 | * the calling PMBus core code will abort if the chip driver returns an error | ||
146 | * code when reading or writing virtual registers. | ||
139 | */ | 147 | */ |
140 | #define PMBUS_VIRT_BASE 0x100 | 148 | #define PMBUS_VIRT_BASE 0x100 |
141 | #define PMBUS_VIRT_READ_TEMP_MIN (PMBUS_VIRT_BASE + 0) | 149 | #define PMBUS_VIRT_READ_TEMP_MIN (PMBUS_VIRT_BASE + 0) |
@@ -320,6 +328,12 @@ struct pmbus_driver_info { | |||
320 | * The following functions map manufacturing specific register values | 328 | * The following functions map manufacturing specific register values |
321 | * to PMBus standard register values. Specify only if mapping is | 329 | * to PMBus standard register values. Specify only if mapping is |
322 | * necessary. | 330 | * necessary. |
331 | * Functions return the register value (read) or zero (write) if | ||
332 | * successful. A return value of -ENODATA indicates that there is no | ||
333 | * manufacturer specific register, but that a standard PMBus register | ||
334 | * may exist. Any other negative return value indicates that the | ||
335 | * register does not exist, and that no attempt should be made to read | ||
336 | * the standard register. | ||
323 | */ | 337 | */ |
324 | int (*read_byte_data)(struct i2c_client *client, int page, int reg); | 338 | int (*read_byte_data)(struct i2c_client *client, int page, int reg); |
325 | int (*read_word_data)(struct i2c_client *client, int page, int reg); | 339 | int (*read_word_data)(struct i2c_client *client, int page, int reg); |