diff options
author | sreenivasulu velpula <svelpula@nvidia.com> | 2013-02-22 00:41:05 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2013-09-14 13:02:34 -0700 |
commit | a16de9db781ef4c45a0041009215798de34b930f (patch) | |
tree | b8f11d69cff86dc76bb5c1835b19d44d2d290bc5 /drivers/hwmon | |
parent | 594ea619011505f191e55b9f957a36e422ea6110 (diff) |
driver: tmon: tegra: update rtemp functionality
Bug 1182410
Reviewed-on: http://git-master/r/203014
(cherry picked from commit 57e260678b3c59b22c0999e267387661aa4feca0)
Change-Id: I530c6e07e8a18c6b972ad531c45bb8b6c2817042
Signed-off-by: sreenivasulu velpula <svelpula@nvidia.com>
Reviewed-on: http://git-master/r/206273
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>
Diffstat (limited to 'drivers/hwmon')
-rw-r--r-- | drivers/hwmon/tmon-tmp411.c | 34 |
1 files changed, 7 insertions, 27 deletions
diff --git a/drivers/hwmon/tmon-tmp411.c b/drivers/hwmon/tmon-tmp411.c index 4bbec982ed88..6c68a5e082fb 100644 --- a/drivers/hwmon/tmon-tmp411.c +++ b/drivers/hwmon/tmon-tmp411.c @@ -175,33 +175,17 @@ static int tmon_check_local_temp(struct i2c_client *client, return TMON_NOCHANGE; } -static int tmon_rtemp_boundary_check(struct i2c_client *client, - int rtemp_low_boundary, - int rtemp_high_boundary, int *low_to_high) +static int tmon_check_remote_temp(struct i2c_client *client, + u32 delta_temp) { static int last_temp; int err; int curr_temp = 0; - - *low_to_high = -1; - err = tmon_read_remote_temp(client, &curr_temp); if (err) return TMON_ERR; - /* If remote temp is changing from < rtemp_high_boundary - to >= rtemp_high_boundary. */ - if (last_temp < rtemp_high_boundary && - curr_temp >= rtemp_high_boundary) - *low_to_high = 1; - - /* If remote temp is changing from >= rtemp_low_boundary - to < rtemp_low_boundary */ - else if (last_temp >= rtemp_low_boundary && - curr_temp < rtemp_low_boundary) - *low_to_high = 0; - - if (*low_to_high == 0 || *low_to_high == 1) { + if (abs(curr_temp - last_temp) >= delta_temp) { last_temp = curr_temp; return curr_temp; } @@ -235,7 +219,6 @@ device_attr(local_temp); static void tmon_update(struct work_struct *work) { int ret; - int low_to_high; struct tmon_info *tmon_data = container_of(to_delayed_work(work), struct tmon_info, @@ -256,15 +239,12 @@ static void tmon_update(struct work_struct *work) pdata->ltemp_dependent_reg_update) pdata->ltemp_dependent_reg_update(ret); - ret = - tmon_rtemp_boundary_check(tmon_data->client, - pdata->rtemp_low_boundary, - pdata->rtemp_high_boundary, - &low_to_high); + ret = tmon_check_remote_temp(tmon_data->client, + pdata->delta_temp); if (ret != TMON_ERR && ret != TMON_NOCHANGE && - pdata->rtemp_dependent_reg_update) - pdata->rtemp_dependent_reg_update(ret, low_to_high); + pdata->utmip_temp_dep_update) + pdata->utmip_temp_dep_update(ret, pdata->utmip_temp_bound); schedule_delayed_work(&tmon_data->tmon_work, msecs_to_jiffies(pdata->delta_time)); |