diff options
author | Eddie James <eajames@linux.vnet.ibm.com> | 2018-11-09 00:05:29 +0300 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2018-12-17 02:13:10 +0300 |
commit | df04ced684d48f6ec5729ccd034702952160c6b3 (patch) | |
tree | c036e0a54bcbaf44c0d1a973646b3070f9623e69 /drivers/hwmon/occ/common.h | |
parent | 54076cb3b5ff21f6474f5fd254a0b018b24771df (diff) | |
download | linux-df04ced684d48f6ec5729ccd034702952160c6b3.tar.xz |
hwmon (occ): Add sysfs attributes for additional OCC data
The OCC provides a variety of additional information about the state of
the host processor, such as throttling, error conditions, and the number
of OCCs detected in the system. This information is essential to service
processor applications such as fan control and host management.
Therefore, export this data in the form of sysfs attributes attached to
the platform device (to which the hwmon device is also attached).
Signed-off-by: Eddie James <eajames@linux.ibm.com>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'drivers/hwmon/occ/common.h')
-rw-r--r-- | drivers/hwmon/occ/common.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/hwmon/occ/common.h b/drivers/hwmon/occ/common.h index 9d01973d93d8..7c44df3f5631 100644 --- a/drivers/hwmon/occ/common.h +++ b/drivers/hwmon/occ/common.h @@ -104,8 +104,25 @@ struct occ { struct occ_attribute *attrs; struct attribute_group group; const struct attribute_group *groups[2]; + + int error; /* latest transfer error */ + unsigned int error_count; /* number of xfr errors observed */ + unsigned long last_safe; /* time OCC entered "safe" state */ + + /* + * Store the previous state data for comparison in order to notify + * sysfs readers of state changes. + */ + int prev_error; + u8 prev_stat; + u8 prev_ext_stat; + u8 prev_occs_present; }; int occ_setup(struct occ *occ, const char *name); +int occ_setup_sysfs(struct occ *occ); +void occ_shutdown(struct occ *occ); +void occ_sysfs_poll_done(struct occ *occ); +int occ_update_response(struct occ *occ); #endif /* OCC_COMMON_H */ |