diff options
Diffstat (limited to 'include/linux/hwmon.h')
-rw-r--r-- | include/linux/hwmon.h | 32 |
1 files changed, 24 insertions, 8 deletions
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h index 9d2f8bde7d12..88b673749121 100644 --- a/include/linux/hwmon.h +++ b/include/linux/hwmon.h | |||
@@ -88,6 +88,7 @@ enum hwmon_temp_attributes { | |||
88 | #define HWMON_T_CRIT_HYST BIT(hwmon_temp_crit_hyst) | 88 | #define HWMON_T_CRIT_HYST BIT(hwmon_temp_crit_hyst) |
89 | #define HWMON_T_EMERGENCY BIT(hwmon_temp_emergency) | 89 | #define HWMON_T_EMERGENCY BIT(hwmon_temp_emergency) |
90 | #define HWMON_T_EMERGENCY_HYST BIT(hwmon_temp_emergency_hyst) | 90 | #define HWMON_T_EMERGENCY_HYST BIT(hwmon_temp_emergency_hyst) |
91 | #define HWMON_T_ALARM BIT(hwmon_temp_alarm) | ||
91 | #define HWMON_T_MIN_ALARM BIT(hwmon_temp_min_alarm) | 92 | #define HWMON_T_MIN_ALARM BIT(hwmon_temp_min_alarm) |
92 | #define HWMON_T_MAX_ALARM BIT(hwmon_temp_max_alarm) | 93 | #define HWMON_T_MAX_ALARM BIT(hwmon_temp_max_alarm) |
93 | #define HWMON_T_CRIT_ALARM BIT(hwmon_temp_crit_alarm) | 94 | #define HWMON_T_CRIT_ALARM BIT(hwmon_temp_crit_alarm) |
@@ -298,8 +299,8 @@ enum hwmon_pwm_attributes { | |||
298 | * Channel number | 299 | * Channel number |
299 | * The function returns the file permissions. | 300 | * The function returns the file permissions. |
300 | * If the return value is 0, no attribute will be created. | 301 | * If the return value is 0, no attribute will be created. |
301 | * @read: Read callback. Optional. If not provided, attributes | 302 | * @read: Read callback for data attributes. Mandatory if readable |
302 | * will not be readable. | 303 | * data attributes are present. |
303 | * Parameters are: | 304 | * Parameters are: |
304 | * @dev: Pointer to hardware monitoring device | 305 | * @dev: Pointer to hardware monitoring device |
305 | * @type: Sensor type | 306 | * @type: Sensor type |
@@ -308,8 +309,19 @@ enum hwmon_pwm_attributes { | |||
308 | * Channel number | 309 | * Channel number |
309 | * @val: Pointer to returned value | 310 | * @val: Pointer to returned value |
310 | * The function returns 0 on success or a negative error number. | 311 | * The function returns 0 on success or a negative error number. |
311 | * @write: Write callback. Optional. If not provided, attributes | 312 | * @read_string: |
312 | * will not be writable. | 313 | * Read callback for string attributes. Mandatory if string |
314 | * attributes are present. | ||
315 | * Parameters are: | ||
316 | * @dev: Pointer to hardware monitoring device | ||
317 | * @type: Sensor type | ||
318 | * @attr: Sensor attribute | ||
319 | * @channel: | ||
320 | * Channel number | ||
321 | * @str: Pointer to returned string | ||
322 | * The function returns 0 on success or a negative error number. | ||
323 | * @write: Write callback for data attributes. Mandatory if writeable | ||
324 | * data attributes are present. | ||
313 | * Parameters are: | 325 | * Parameters are: |
314 | * @dev: Pointer to hardware monitoring device | 326 | * @dev: Pointer to hardware monitoring device |
315 | * @type: Sensor type | 327 | * @type: Sensor type |
@@ -324,6 +336,8 @@ struct hwmon_ops { | |||
324 | u32 attr, int channel); | 336 | u32 attr, int channel); |
325 | int (*read)(struct device *dev, enum hwmon_sensor_types type, | 337 | int (*read)(struct device *dev, enum hwmon_sensor_types type, |
326 | u32 attr, int channel, long *val); | 338 | u32 attr, int channel, long *val); |
339 | int (*read_string)(struct device *dev, enum hwmon_sensor_types type, | ||
340 | u32 attr, int channel, char **str); | ||
327 | int (*write)(struct device *dev, enum hwmon_sensor_types type, | 341 | int (*write)(struct device *dev, enum hwmon_sensor_types type, |
328 | u32 attr, int channel, long val); | 342 | u32 attr, int channel, long val); |
329 | }; | 343 | }; |
@@ -349,7 +363,9 @@ struct hwmon_chip_info { | |||
349 | const struct hwmon_channel_info **info; | 363 | const struct hwmon_channel_info **info; |
350 | }; | 364 | }; |
351 | 365 | ||
366 | /* hwmon_device_register() is deprecated */ | ||
352 | struct device *hwmon_device_register(struct device *dev); | 367 | struct device *hwmon_device_register(struct device *dev); |
368 | |||
353 | struct device * | 369 | struct device * |
354 | hwmon_device_register_with_groups(struct device *dev, const char *name, | 370 | hwmon_device_register_with_groups(struct device *dev, const char *name, |
355 | void *drvdata, | 371 | void *drvdata, |
@@ -362,12 +378,12 @@ struct device * | |||
362 | hwmon_device_register_with_info(struct device *dev, | 378 | hwmon_device_register_with_info(struct device *dev, |
363 | const char *name, void *drvdata, | 379 | const char *name, void *drvdata, |
364 | const struct hwmon_chip_info *info, | 380 | const struct hwmon_chip_info *info, |
365 | const struct attribute_group **groups); | 381 | const struct attribute_group **extra_groups); |
366 | struct device * | 382 | struct device * |
367 | devm_hwmon_device_register_with_info(struct device *dev, | 383 | devm_hwmon_device_register_with_info(struct device *dev, |
368 | const char *name, void *drvdata, | 384 | const char *name, void *drvdata, |
369 | const struct hwmon_chip_info *info, | 385 | const struct hwmon_chip_info *info, |
370 | const struct attribute_group **groups); | 386 | const struct attribute_group **extra_groups); |
371 | 387 | ||
372 | void hwmon_device_unregister(struct device *dev); | 388 | void hwmon_device_unregister(struct device *dev); |
373 | void devm_hwmon_device_unregister(struct device *dev); | 389 | void devm_hwmon_device_unregister(struct device *dev); |