diff options
author | Zhang Rui <rui.zhang@intel.com> | 2014-12-08 22:38:34 -0500 |
---|---|---|
committer | Zhang Rui <rui.zhang@intel.com> | 2014-12-08 22:38:34 -0500 |
commit | c89d99546dc5b076ccd6692c48ada9a92820a4ac (patch) | |
tree | 30788930f8c3fca80c0e5d8a377786d4a4a863bd /drivers/hwmon | |
parent | 5a530ff0d88a366736ae4d1021e7358b52e55756 (diff) | |
parent | 9c1e4550b5cbe17ff68ce631356190ef9a565386 (diff) |
Merge branch 'eduardo-soc-thermal' into thermal-soc
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/lm75.c | 9 | ||||
-rw-r--r-- | drivers/hwmon/ntc_thermistor.c | 6 | ||||
-rw-r--r-- | drivers/hwmon/tmp102.c | 6 |
3 files changed, 16 insertions, 5 deletions
diff --git a/drivers/hwmon/lm75.c b/drivers/hwmon/lm75.c index d16dbb33a531..e7c8bf9093ea 100644 --- a/drivers/hwmon/lm75.c +++ b/drivers/hwmon/lm75.c | |||
@@ -176,6 +176,10 @@ static struct attribute *lm75_attrs[] = { | |||
176 | }; | 176 | }; |
177 | ATTRIBUTE_GROUPS(lm75); | 177 | ATTRIBUTE_GROUPS(lm75); |
178 | 178 | ||
179 | static const struct thermal_zone_of_device_ops lm75_of_thermal_ops = { | ||
180 | .get_temp = lm75_read_temp, | ||
181 | }; | ||
182 | |||
179 | /*-----------------------------------------------------------------------*/ | 183 | /*-----------------------------------------------------------------------*/ |
180 | 184 | ||
181 | /* device probe and removal */ | 185 | /* device probe and removal */ |
@@ -291,10 +295,9 @@ lm75_probe(struct i2c_client *client, const struct i2c_device_id *id) | |||
291 | if (IS_ERR(data->hwmon_dev)) | 295 | if (IS_ERR(data->hwmon_dev)) |
292 | return PTR_ERR(data->hwmon_dev); | 296 | return PTR_ERR(data->hwmon_dev); |
293 | 297 | ||
294 | data->tz = thermal_zone_of_sensor_register(data->hwmon_dev, | 298 | data->tz = thermal_zone_of_sensor_register(data->hwmon_dev, 0, |
295 | 0, | ||
296 | data->hwmon_dev, | 299 | data->hwmon_dev, |
297 | lm75_read_temp, NULL); | 300 | &lm75_of_thermal_ops); |
298 | if (IS_ERR(data->tz)) | 301 | if (IS_ERR(data->tz)) |
299 | data->tz = NULL; | 302 | data->tz = NULL; |
300 | 303 | ||
diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c index 4ff89b2482e4..bca8521c8a9b 100644 --- a/drivers/hwmon/ntc_thermistor.c +++ b/drivers/hwmon/ntc_thermistor.c | |||
@@ -486,6 +486,10 @@ static const struct attribute_group ntc_attr_group = { | |||
486 | .attrs = ntc_attributes, | 486 | .attrs = ntc_attributes, |
487 | }; | 487 | }; |
488 | 488 | ||
489 | static const struct thermal_zone_of_device_ops ntc_of_thermal_ops = { | ||
490 | .get_temp = ntc_read_temp, | ||
491 | }; | ||
492 | |||
489 | static int ntc_thermistor_probe(struct platform_device *pdev) | 493 | static int ntc_thermistor_probe(struct platform_device *pdev) |
490 | { | 494 | { |
491 | const struct of_device_id *of_id = | 495 | const struct of_device_id *of_id = |
@@ -579,7 +583,7 @@ static int ntc_thermistor_probe(struct platform_device *pdev) | |||
579 | pdev_id->name); | 583 | pdev_id->name); |
580 | 584 | ||
581 | data->tz = thermal_zone_of_sensor_register(data->dev, 0, data->dev, | 585 | data->tz = thermal_zone_of_sensor_register(data->dev, 0, data->dev, |
582 | ntc_read_temp, NULL); | 586 | &ntc_of_thermal_ops); |
583 | if (IS_ERR(data->tz)) { | 587 | if (IS_ERR(data->tz)) { |
584 | dev_dbg(&pdev->dev, "Failed to register to thermal fw.\n"); | 588 | dev_dbg(&pdev->dev, "Failed to register to thermal fw.\n"); |
585 | data->tz = NULL; | 589 | data->tz = NULL; |
diff --git a/drivers/hwmon/tmp102.c b/drivers/hwmon/tmp102.c index 51719956cc03..ba9f478f64ee 100644 --- a/drivers/hwmon/tmp102.c +++ b/drivers/hwmon/tmp102.c | |||
@@ -158,6 +158,10 @@ ATTRIBUTE_GROUPS(tmp102); | |||
158 | #define TMP102_CONFIG (TMP102_CONF_TM | TMP102_CONF_EM | TMP102_CONF_CR1) | 158 | #define TMP102_CONFIG (TMP102_CONF_TM | TMP102_CONF_EM | TMP102_CONF_CR1) |
159 | #define TMP102_CONFIG_RD_ONLY (TMP102_CONF_R0 | TMP102_CONF_R1 | TMP102_CONF_AL) | 159 | #define TMP102_CONFIG_RD_ONLY (TMP102_CONF_R0 | TMP102_CONF_R1 | TMP102_CONF_AL) |
160 | 160 | ||
161 | static const struct thermal_zone_of_device_ops tmp102_of_thermal_ops = { | ||
162 | .get_temp = tmp102_read_temp, | ||
163 | }; | ||
164 | |||
161 | static int tmp102_probe(struct i2c_client *client, | 165 | static int tmp102_probe(struct i2c_client *client, |
162 | const struct i2c_device_id *id) | 166 | const struct i2c_device_id *id) |
163 | { | 167 | { |
@@ -215,7 +219,7 @@ static int tmp102_probe(struct i2c_client *client, | |||
215 | } | 219 | } |
216 | tmp102->hwmon_dev = hwmon_dev; | 220 | tmp102->hwmon_dev = hwmon_dev; |
217 | tmp102->tz = thermal_zone_of_sensor_register(hwmon_dev, 0, hwmon_dev, | 221 | tmp102->tz = thermal_zone_of_sensor_register(hwmon_dev, 0, hwmon_dev, |
218 | tmp102_read_temp, NULL); | 222 | &tmp102_of_thermal_ops); |
219 | if (IS_ERR(tmp102->tz)) | 223 | if (IS_ERR(tmp102->tz)) |
220 | tmp102->tz = NULL; | 224 | tmp102->tz = NULL; |
221 | 225 | ||