summaryrefslogtreecommitdiff
path: root/drivers/thermal
diff options
context:
space:
mode:
authorZhang Rui <rui.zhang@intel.com>2012-06-27 09:51:12 +0800
committerSimone Willett <swillett@nvidia.com>2012-11-05 10:09:57 -0800
commitbce136a33b8a73683b2097bfc5961263e12662b3 (patch)
tree8cc5f5e609e8ff1b45e4c43303124157760aa8b4 /drivers/thermal
parent594e7fef602d51b856816d53642a354371810dd6 (diff)
Thermal: Remove tc1/tc2 in generic thermal layer.
Remove tc1/tc2 in generic thermal layer. .get_trend() callback starts to take effect from this patch. bug 1059470 Change-Id: I69ea5306c9e76b0dae8eb6ad4b89335068e78f9b Signed-off-by: Zhang Rui <rui.zhang@intel.com> Reviewed-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Valentin, Eduardo <eduardo.valentin@ti.com> Reviewed-on: http://git-master/r/159966 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Joshua Primero <jprimero@nvidia.com> Tested-by: Joshua Primero <jprimero@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
Diffstat (limited to 'drivers/thermal')
-rw-r--r--drivers/thermal/spear_thermal.c2
-rw-r--r--drivers/thermal/thermal_sys.c26
2 files changed, 8 insertions, 20 deletions
diff --git a/drivers/thermal/spear_thermal.c b/drivers/thermal/spear_thermal.c
index 69a55d46aaa6..b55840add3ed 100644
--- a/drivers/thermal/spear_thermal.c
+++ b/drivers/thermal/spear_thermal.c
@@ -148,7 +148,7 @@ static int spear_thermal_probe(struct platform_device *pdev)
writel_relaxed(stdev->flags, stdev->thermal_base);
spear_thermal = thermal_zone_device_register("spear_thermal", 0, 0,
- stdev, &ops, 0, 0, 0, 0);
+ stdev, &ops, 0, 0);
if (IS_ERR(spear_thermal)) {
dev_err(&pdev->dev, "thermal zone device is NULL\n");
ret = PTR_ERR(spear_thermal);
diff --git a/drivers/thermal/thermal_sys.c b/drivers/thermal/thermal_sys.c
index 07b1add0930e..db76fffa36bd 100644
--- a/drivers/thermal/thermal_sys.c
+++ b/drivers/thermal/thermal_sys.c
@@ -335,9 +335,6 @@ passive_store(struct device *dev, struct device_attribute *attr,
tz->passive_delay = 0;
}
- tz->tc1 = 1;
- tz->tc2 = 1;
-
tz->forced_passive = state;
thermal_zone_device_update(tz);
@@ -718,13 +715,12 @@ static void thermal_zone_device_set_polling(struct thermal_zone_device *tz,
static void thermal_zone_device_passive(struct thermal_zone_device *tz,
int temp, int trip_temp, int trip)
{
- int trend = 0;
+ enum thermal_trend trend;
struct thermal_cooling_device_instance *instance;
struct thermal_cooling_device *cdev;
long state, max_state;
- if (!tz->ops->get_trend ||
- tz->ops->get_trend(tz, trip, (enum thermal_trend *)&trend)) {
+ if (!tz->ops->get_trend || tz->ops->get_trend(tz, trip, &trend)) {
/*
* compare the current temperature and previous temperature
* to get the thermal trend, if no special requirement
@@ -747,11 +743,8 @@ static void thermal_zone_device_passive(struct thermal_zone_device *tz,
if (temp >= trip_temp) {
tz->passive = true;
- trend = (tz->tc1 * (temp - tz->last_temperature)) +
- (tz->tc2 * (temp - trip_temp));
-
/* Heating up? */
- if (trend > 0) {
+ if (trend == THERMAL_TREND_RAISING) {
list_for_each_entry(instance, &tz->cooling_devices,
node) {
if (instance->trip != trip)
@@ -762,7 +755,7 @@ static void thermal_zone_device_passive(struct thermal_zone_device *tz,
if (state++ < max_state)
cdev->ops->set_cur_state(cdev, state);
}
- } else if (trend < 0) { /* Cooling off? */
+ } else if (trend == THERMAL_TREND_DROPPING) { /* Cooling off? */
list_for_each_entry(instance, &tz->cooling_devices,
node) {
if (instance->trip != trip)
@@ -1305,8 +1298,6 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
* @mask: a bit string indicating the writeablility of trip points
* @devdata: private device data
* @ops: standard thermal zone device callbacks
- * @tc1: thermal coefficient 1 for passive calculations
- * @tc2: thermal coefficient 2 for passive calculations
* @passive_delay: number of milliseconds to wait between polls when
* performing passive cooling
* @polling_delay: number of milliseconds to wait between polls when checking
@@ -1314,13 +1305,12 @@ static void remove_trip_attrs(struct thermal_zone_device *tz)
* driven systems)
*
* thermal_zone_device_unregister() must be called when the device is no
- * longer needed. The passive cooling formula uses tc1 and tc2 as described in
- * section 11.1.5.1 of the ACPI specification 3.0.
+ * longer needed. The passive cooling depends on the .get_trend() return value.
*/
-struct thermal_zone_device *thermal_zone_device_register(char *type,
+struct thermal_zone_device *thermal_zone_device_register(const char *type,
int trips, int mask, void *devdata,
const struct thermal_zone_device_ops *ops,
- int tc1, int tc2, int passive_delay, int polling_delay)
+ int passive_delay, int polling_delay)
{
struct thermal_zone_device *tz;
struct thermal_cooling_device *pos;
@@ -1356,8 +1346,6 @@ struct thermal_zone_device *thermal_zone_device_register(char *type,
tz->device.class = &thermal_class;
tz->devdata = devdata;
tz->trips = trips;
- tz->tc1 = tc1;
- tz->tc2 = tc2;
tz->passive_delay = passive_delay;
tz->polling_delay = polling_delay;