diff options
author | Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org> | 2016-01-28 23:09:30 +0530 |
---|---|---|
committer | Kyle Yan <kyan@codeaurora.org> | 2016-07-05 15:33:53 -0700 |
commit | be375a03c7952baf7bfce6032365de392762972f (patch) | |
tree | 94d1a015d3b8ab034530532347db6253773f7b29 /drivers | |
parent | 86eb5bd26d8b18e4e98fee497828933a53ce48dd (diff) |
msm: thermal: Add support to monitor only one tsens for MX restriction
Currently VDD MX restriction feature monitors all tsens for low
temperature condition. Some targets which has higher MX restriction
thresholds shows frequent interrupts from multiple sensors causing
power impact.
Add support to monitor only one sensor for VDD MX restriction feature.
Add an optional device tree property "qcom,mx-restriction-sensor_id"
to specify sensor id for monitor. If not defined, monitor all tsens
for VDD MX restriction.
Change-Id: Ib709b00c27f43c2603ac8a08b75f2fbd5800983b
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manafm@codeaurora.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/thermal/msm_thermal.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/thermal/msm_thermal.c b/drivers/thermal/msm_thermal.c index f36108542738..bbc6a8e96d41 100644 --- a/drivers/thermal/msm_thermal.c +++ b/drivers/thermal/msm_thermal.c @@ -5879,6 +5879,13 @@ static int probe_vdd_mx(struct device_node *node, if (ret) goto read_node_done; + /* + * Monitor only this sensor if defined, otherwise monitor all tsens + */ + key = "qcom,mx-restriction-sensor_id"; + if (of_property_read_u32(node, key, &data->vdd_mx_sensor_id)) + data->vdd_mx_sensor_id = MONITOR_ALL_TSENS; + vdd_mx = devm_regulator_get(&pdev->dev, "vdd-mx"); if (IS_ERR_OR_NULL(vdd_mx)) { ret = PTR_ERR(vdd_mx); @@ -5905,7 +5912,7 @@ static int probe_vdd_mx(struct device_node *node, } ret = sensor_mgr_init_threshold(&thresh[MSM_VDD_MX_RESTRICTION], - MONITOR_ALL_TSENS, + data->vdd_mx_sensor_id, data->vdd_mx_temp_degC + data->vdd_mx_temp_hyst_degC, data->vdd_mx_temp_degC, vdd_mx_notify); @@ -6878,6 +6885,9 @@ static void thermal_mx_config_read(struct seq_file *m, void *data) if (vdd_cx) seq_printf(m, "cx retention value:%d\n", msm_thermal_info.vdd_cx_min); + if (msm_thermal_info.vdd_mx_sensor_id != MONITOR_ALL_TSENS) + seq_printf(m, "tsens sensor:tsens_tz_sensor%d\n", + msm_thermal_info.vdd_mx_sensor_id); } } |