From 6c28948e606160bd82194779d4b40187fa80f881 Mon Sep 17 00:00:00 2001 From: Ram Chandrasekar Date: Mon, 25 Apr 2016 15:54:17 -0600 Subject: [PATCH] msm: lmh_interface: Support new thermal core framework APIs Thermal core framework allows reading negative temperature and to support that, thermal core APIs will read temperature in integer. Inline with thermal core changes, modify the parameters to read temperature to integer from signed long. CRs-Fixed: 1010120 Change-Id: I975c11aa4e63e01ee3274a577b51b37c1c0f78cd Signed-off-by: Ram Chandrasekar --- drivers/thermal/lmh_interface.c | 10 +++++----- drivers/thermal/lmh_interface.h | 6 +++--- drivers/thermal/lmh_lite.c | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/thermal/lmh_interface.c b/drivers/thermal/lmh_interface.c index e4888f9e5175..a5858ec23d0c 100644 --- a/drivers/thermal/lmh_interface.c +++ b/drivers/thermal/lmh_interface.c @@ -41,7 +41,7 @@ #define LMH_POLLING_MSEC 30 struct lmh_mon_threshold { - long value; + int value; bool active; }; @@ -320,7 +320,7 @@ static struct lmh_mon_sensor_data *lmh_match_sensor_name(char *sensor_name) } static void lmh_evaluate_and_notify(struct lmh_mon_sensor_data *lmh_sensor, - long val) + int val) { int idx = 0, trip = 0; bool cond = false; @@ -342,7 +342,7 @@ static void lmh_evaluate_and_notify(struct lmh_mon_sensor_data *lmh_sensor, } } -void lmh_update_reading(struct lmh_sensor_ops *ops, long trip_val) +void lmh_update_reading(struct lmh_sensor_ops *ops, int trip_val) { struct lmh_mon_sensor_data *lmh_sensor = NULL; @@ -358,7 +358,7 @@ void lmh_update_reading(struct lmh_sensor_ops *ops, long trip_val) goto interrupt_exit; } down_write(&lmh_sensor->lock); - pr_debug("Sensor:[%s] intensity:%ld\n", lmh_sensor->sensor_name, + pr_debug("Sensor:[%s] intensity:%d\n", lmh_sensor->sensor_name, trip_val); lmh_evaluate_and_notify(lmh_sensor, trip_val); interrupt_exit: @@ -380,7 +380,7 @@ static int lmh_sensor_read(struct thermal_zone_device *dev, int *val) lmh_sensor = dev->devdata; down_read(&lmh_mon_access_lock); down_read(&lmh_sensor->lock); - ret = lmh_sensor->sensor_ops->read(lmh_sensor->sensor_ops, (long *)val); + ret = lmh_sensor->sensor_ops->read(lmh_sensor->sensor_ops, val); if (ret) { pr_err("Error reading sensor:%s. err:%d\n", lmh_sensor->sensor_name, ret); diff --git a/drivers/thermal/lmh_interface.h b/drivers/thermal/lmh_interface.h index 801eb1216211..521be767a430 100644 --- a/drivers/thermal/lmh_interface.h +++ b/drivers/thermal/lmh_interface.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2016, The Linux Foundation. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and @@ -31,10 +31,10 @@ enum lmh_monitor_state { }; struct lmh_sensor_ops { - int (*read)(struct lmh_sensor_ops *, long *); + int (*read)(struct lmh_sensor_ops *, int *); int (*enable_hw_log)(uint32_t, uint32_t); int (*disable_hw_log)(void); - void (*new_value_notify)(struct lmh_sensor_ops *, long); + void (*new_value_notify)(struct lmh_sensor_ops *, int); }; struct lmh_device_ops { diff --git a/drivers/thermal/lmh_lite.c b/drivers/thermal/lmh_lite.c index 541a106a6bdb..2935dbaab3f0 100644 --- a/drivers/thermal/lmh_lite.c +++ b/drivers/thermal/lmh_lite.c @@ -169,7 +169,7 @@ struct lmh_sensor_data { uint32_t sensor_hw_node_id; int sensor_sw_id; struct lmh_sensor_ops ops; - long last_read_value; + int last_read_value; struct list_head list_ptr; }; @@ -198,7 +198,7 @@ static DEFINE_MUTEX(lmh_sensor_read); static DEFINE_MUTEX(lmh_odcm_access); static LIST_HEAD(lmh_sensor_list); -static int lmh_read(struct lmh_sensor_ops *ops, long *val) +static int lmh_read(struct lmh_sensor_ops *ops, int *val) { struct lmh_sensor_data *lmh_sensor = container_of(ops, struct lmh_sensor_data, ops); -- 2.11.0