diff options
author | Pritesh Raithatha <praithatha@nvidia.com> | 2011-08-19 17:58:55 +0530 |
---|---|---|
committer | Rohan Somvanshi <rsomvanshi@nvidia.com> | 2011-08-24 23:24:57 -0700 |
commit | 933f305e68d5a256b0de9d388fc9f12448c862c4 (patch) | |
tree | 7ba7416de007a4adc11aa5bccfb5bfe91552daa9 /drivers/hwmon | |
parent | ab74fe58d10435a6f0f6dcd6e86513dd611a5474 (diff) |
hwmon: ina219: add rail_name sensor attribute
Bug 844743
Change-Id: Ib6c40bbce942ad43679a63a7729e932e4525043f
Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-on: http://git-master/r/48176
Reviewed-by: Venu Byravarasu <vbyravarasu@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>
Reviewed-by: Varun Wadekar <vwadekar@nvidia.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/ina219.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/hwmon/ina219.c b/drivers/hwmon/ina219.c index cd7dbdf10589..cc5b85fdcf84 100644 --- a/drivers/hwmon/ina219.c +++ b/drivers/hwmon/ina219.c @@ -106,6 +106,14 @@ static s32 power_down_INA219(struct i2c_client *client) return retval; } +static s32 show_rail_name(struct device *dev, + struct device_attribute *attr, + char *buf) +{ + struct i2c_client *client = to_i2c_client(dev); + struct ina219_data *data = i2c_get_clientdata(client); + return sprintf(buf, "%s\n", data->pInfo->rail_name); +} static s32 show_voltage(struct device *dev, struct device_attribute *attr, @@ -304,6 +312,7 @@ error: } static struct sensor_device_attribute ina219[] = { + SENSOR_ATTR(rail_name, S_IRUGO, show_rail_name, NULL, 0), SENSOR_ATTR(in1_input, S_IRUGO, show_voltage, NULL, 0), SENSOR_ATTR(curr1_input, S_IRUGO, show_current, NULL, 0), SENSOR_ATTR(power1_input, S_IRUGO, show_power, NULL, 0), |