summaryrefslogtreecommitdiffstats
path: root/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/intel/int340x_thermal/int3400_thermal.c')
-rw-r--r--drivers/thermal/intel/int340x_thermal/int3400_thermal.c38
1 files changed, 7 insertions, 31 deletions
diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
index 12448ccd27f1..4f5859d4c780 100644
--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
+++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
@@ -48,7 +48,6 @@ struct int3400_thermal_priv {
struct acpi_device *adev;
struct platform_device *pdev;
struct thermal_zone_device *thermal;
- int mode;
int art_count;
struct art *arts;
int trt_count;
@@ -383,42 +382,20 @@ static int int3400_thermal_get_temp(struct thermal_zone_device *thermal,
return 0;
}
-static int int3400_thermal_get_mode(struct thermal_zone_device *thermal,
- enum thermal_device_mode *mode)
+static int int3400_thermal_change_mode(struct thermal_zone_device *thermal,
+ enum thermal_device_mode mode)
{
struct int3400_thermal_priv *priv = thermal->devdata;
-
- if (!priv)
- return -EINVAL;
-
- *mode = priv->mode;
-
- return 0;
-}
-
-static int int3400_thermal_set_mode(struct thermal_zone_device *thermal,
- enum thermal_device_mode mode)
-{
- struct int3400_thermal_priv *priv = thermal->devdata;
- bool enable;
int result = 0;
if (!priv)
return -EINVAL;
- if (mode == THERMAL_DEVICE_ENABLED)
- enable = true;
- else if (mode == THERMAL_DEVICE_DISABLED)
- enable = false;
- else
- return -EINVAL;
-
- if (enable != priv->mode) {
- priv->mode = enable;
+ if (mode != thermal->mode)
result = int3400_thermal_run_osc(priv->adev->handle,
- priv->current_uuid_index,
- enable);
- }
+ priv->current_uuid_index,
+ mode == THERMAL_DEVICE_ENABLED);
+
evaluate_odvp(priv);
@@ -427,8 +404,7 @@ static int int3400_thermal_set_mode(struct thermal_zone_device *thermal,
static struct thermal_zone_device_ops int3400_thermal_ops = {
.get_temp = int3400_thermal_get_temp,
- .get_mode = int3400_thermal_get_mode,
- .set_mode = int3400_thermal_set_mode,
+ .change_mode = int3400_thermal_change_mode,
};
static struct thermal_zone_params int3400_thermal_params = {