Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 363836
b: refs/heads/master
c: 03b7f67
h: refs/heads/master
v: v3
  • Loading branch information
J Keerthy authored and Greg Kroah-Hartman committed Apr 1, 2013
1 parent 893dde8 commit 36ce146
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 2f440b0622085a130ff723bb037066c9cbfc8cd7
refs/heads/master: 03b7f67bd1a085572539788d07c4630489108a35
27 changes: 26 additions & 1 deletion trunk/drivers/staging/ti-soc-thermal/ti-thermal-common.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,31 @@ static int ti_thermal_get_trip_temp(struct thermal_zone_device *thermal,
return 0;
}

/* Get the temperature trend callback functions for thermal zone */
static int ti_thermal_get_trend(struct thermal_zone_device *thermal,
int trip, enum thermal_trend *trend)
{
struct ti_thermal_data *data = thermal->devdata;
struct ti_bandgap *bgp;
int id, tr, ret = 0;

bgp = data->bgp;
id = data->sensor_id;

ret = ti_bandgap_get_trend(bgp, id, &tr);
if (ret)
return ret;

if (tr > 0)
*trend = THERMAL_TREND_RAISING;
else if (tr < 0)
*trend = THERMAL_TREND_DROPPING;
else
*trend = THERMAL_TREND_STABLE;

return 0;
}

/* Get critical temperature callback functions for thermal zone */
static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,
unsigned long *temp)
Expand All @@ -225,7 +250,7 @@ static int ti_thermal_get_crit_temp(struct thermal_zone_device *thermal,

static struct thermal_zone_device_ops ti_thermal_ops = {
.get_temp = ti_thermal_get_temp,
/* TODO: add .get_trend */
.get_trend = ti_thermal_get_trend,
.bind = ti_thermal_bind,
.unbind = ti_thermal_unbind,
.get_mode = ti_thermal_get_mode,
Expand Down

0 comments on commit 36ce146

Please sign in to comment.