diff options
author | Eddie James <eajames@linux.vnet.ibm.com> | 2018-11-08 15:05:29 -0600 |
---|---|---|
committer | Guenter Roeck <linux@roeck-us.net> | 2018-12-16 15:13:10 -0800 |
commit | df04ced684d48f6ec5729ccd034702952160c6b3 (patch) | |
tree | c036e0a54bcbaf44c0d1a973646b3070f9623e69 /drivers/hwmon/occ/p8_i2c.c | |
parent | 54076cb3b5ff21f6474f5fd254a0b018b24771df (diff) |
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/p8_i2c.c')
-rw-r--r-- | drivers/hwmon/occ/p8_i2c.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/hwmon/occ/p8_i2c.c b/drivers/hwmon/occ/p8_i2c.c index e4c2c047b99c..b59efc945e54 100644 --- a/drivers/hwmon/occ/p8_i2c.c +++ b/drivers/hwmon/occ/p8_i2c.c @@ -223,6 +223,15 @@ static int p8_i2c_occ_probe(struct i2c_client *client, return occ_setup(occ, "p8_occ"); } +static int p8_i2c_occ_remove(struct i2c_client *client) +{ + struct occ *occ = dev_get_drvdata(&client->dev); + + occ_shutdown(occ); + + return 0; +} + static const struct of_device_id p8_i2c_occ_of_match[] = { { .compatible = "ibm,p8-occ-hwmon" }, {} @@ -236,6 +245,7 @@ static struct i2c_driver p8_i2c_occ_driver = { .of_match_table = p8_i2c_occ_of_match, }, .probe = p8_i2c_occ_probe, + .remove = p8_i2c_occ_remove, }; module_i2c_driver(p8_i2c_occ_driver); |