diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-26 08:52:52 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-10-26 08:52:52 -0400 |
commit | 3cb603284b3d256ae9ae9e65887cee8416bfef15 (patch) | |
tree | a7012e9ca585c4ada1ff8896de326f540b460f80 /drivers/hwmon/pmbus/pmbus.h | |
parent | 2355e4290336fcda4b4a799448f745155a000226 (diff) | |
parent | c5794cfac09a585945e1632451900594db19393b (diff) |
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging: (26 commits)
hwmon: (w83627ehf) Better fix for negative temperature values
hwmon: (w83627ehf) Uninline is_word_sized
hwmon: (lm75) Document why clones are not detected
hwmon: (w83627ehf) Move fan pins check to a separate function
hwmon: (w83627ehf) Skip reading unused voltage registers
hwmon: (lm75) Add support for Analog Devices ADT75
hwmon: (pmbus_core) Simplify sign extensions
hwmon: (pmbus) Add support for Lineage Power DC-DC converters
hwmon: (pmbus/ltc2978) Add support for LTC3880 to LTC2978 driver
hwmon: (pmbus/ltc2978) Explicit driver for LTC2978
hwmon: (pmbus) Add support for TEMP2 peak attributes
hwmon: AD7314 driver (ported from IIO)
hwmon: (pmbus) Add support for Intersil power management chips
hwmon: (pmbus) Always call _pmbus_read_byte in core driver
hwmon: (pmbus) Replace EINVAL return codes with more appropriate errors
hwmon: (pmbus) Provide more documentation
hwmon/f71882fg: Make the decision wether to register fan attr. per fan
hwmon/f71882fg: Add a f71882fg_create_fan_sysfs_files helper function
hwmon/f71882fg: Make all fan/pwm attr tables 2 dimensional
hwmon: (exynos4_tmu) Remove IRQF_DISABLED
...
Diffstat (limited to 'drivers/hwmon/pmbus/pmbus.h')
-rw-r--r-- | drivers/hwmon/pmbus/pmbus.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/drivers/hwmon/pmbus/pmbus.h b/drivers/hwmon/pmbus/pmbus.h index a6ae20ffef6b..5d31d1c2c0f5 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) |
@@ -160,6 +168,9 @@ | |||
160 | #define PMBUS_VIRT_READ_IOUT_MIN (PMBUS_VIRT_BASE + 19) | 168 | #define PMBUS_VIRT_READ_IOUT_MIN (PMBUS_VIRT_BASE + 19) |
161 | #define PMBUS_VIRT_READ_IOUT_MAX (PMBUS_VIRT_BASE + 20) | 169 | #define PMBUS_VIRT_READ_IOUT_MAX (PMBUS_VIRT_BASE + 20) |
162 | #define PMBUS_VIRT_RESET_IOUT_HISTORY (PMBUS_VIRT_BASE + 21) | 170 | #define PMBUS_VIRT_RESET_IOUT_HISTORY (PMBUS_VIRT_BASE + 21) |
171 | #define PMBUS_VIRT_READ_TEMP2_MIN (PMBUS_VIRT_BASE + 22) | ||
172 | #define PMBUS_VIRT_READ_TEMP2_MAX (PMBUS_VIRT_BASE + 23) | ||
173 | #define PMBUS_VIRT_RESET_TEMP2_HISTORY (PMBUS_VIRT_BASE + 24) | ||
163 | 174 | ||
164 | /* | 175 | /* |
165 | * CAPABILITY | 176 | * CAPABILITY |
@@ -320,6 +331,12 @@ struct pmbus_driver_info { | |||
320 | * The following functions map manufacturing specific register values | 331 | * The following functions map manufacturing specific register values |
321 | * to PMBus standard register values. Specify only if mapping is | 332 | * to PMBus standard register values. Specify only if mapping is |
322 | * necessary. | 333 | * necessary. |
334 | * Functions return the register value (read) or zero (write) if | ||
335 | * successful. A return value of -ENODATA indicates that there is no | ||
336 | * manufacturer specific register, but that a standard PMBus register | ||
337 | * may exist. Any other negative return value indicates that the | ||
338 | * register does not exist, and that no attempt should be made to read | ||
339 | * the standard register. | ||
323 | */ | 340 | */ |
324 | int (*read_byte_data)(struct i2c_client *client, int page, int reg); | 341 | 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); | 342 | int (*read_word_data)(struct i2c_client *client, int page, int reg); |
@@ -347,7 +364,7 @@ bool pmbus_check_byte_register(struct i2c_client *client, int page, int reg); | |||
347 | bool pmbus_check_word_register(struct i2c_client *client, int page, int reg); | 364 | bool pmbus_check_word_register(struct i2c_client *client, int page, int reg); |
348 | int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id, | 365 | int pmbus_do_probe(struct i2c_client *client, const struct i2c_device_id *id, |
349 | struct pmbus_driver_info *info); | 366 | struct pmbus_driver_info *info); |
350 | int pmbus_do_remove(struct i2c_client *client); | 367 | void pmbus_do_remove(struct i2c_client *client); |
351 | const struct pmbus_driver_info *pmbus_get_driver_info(struct i2c_client | 368 | const struct pmbus_driver_info *pmbus_get_driver_info(struct i2c_client |
352 | *client); | 369 | *client); |
353 | 370 | ||