Merge "msm: thermal: Add support to monitor only one tsens for VDD restriction"
This commit is contained in:
commit
d0c522b2ff
3 changed files with 18 additions and 2 deletions
|
@ -55,6 +55,9 @@ Optional properties
|
||||||
key voltage rails, in degC.
|
key voltage rails, in degC.
|
||||||
- qcom,vdd-restriction-temp-hysteresis: When temperature is above this threshold
|
- qcom,vdd-restriction-temp-hysteresis: When temperature is above this threshold
|
||||||
will disable vdd restriction on key rails, in degC.
|
will disable vdd restriction on key rails, in degC.
|
||||||
|
- qcom,vdd-restriction-sensor-id: sensor id, which needs to be monitored for vdd restriction.
|
||||||
|
If this optional property is defined, msm_thermal will monitor only this
|
||||||
|
sensor, otherwise by default it will monitor all TSENS for this feature.
|
||||||
- qcom,pmic-sw-mode-temp: Threshold temperature to disable auto mode on the
|
- qcom,pmic-sw-mode-temp: Threshold temperature to disable auto mode on the
|
||||||
rail, in degC. If this property exists,
|
rail, in degC. If this property exists,
|
||||||
qcom,pmic-sw-mode-temp-hysteresis and
|
qcom,pmic-sw-mode-temp-hysteresis and
|
||||||
|
@ -273,6 +276,7 @@ Example:
|
||||||
qcom,pmic-sw-mode-regs = "vdd-dig";
|
qcom,pmic-sw-mode-regs = "vdd-dig";
|
||||||
qcom,vdd-restriction-temp = <5>;
|
qcom,vdd-restriction-temp = <5>;
|
||||||
qcom,vdd-restriction-temp-hysteresis = <10>;
|
qcom,vdd-restriction-temp-hysteresis = <10>;
|
||||||
|
qcom,vdd-restriction-sensor-id = <0>;
|
||||||
vdd-dig-supply=<&pm8841_s2_floor_corner>
|
vdd-dig-supply=<&pm8841_s2_floor_corner>
|
||||||
qcom,mx-restriction-temp = <5>;
|
qcom,mx-restriction-temp = <5>;
|
||||||
qcom,mx-restriction-temp-hysteresis = <10>;
|
qcom,mx-restriction-temp-hysteresis = <10>;
|
||||||
|
|
|
@ -6102,6 +6102,13 @@ static int probe_vdd_rstr(struct device_node *node,
|
||||||
if (ret)
|
if (ret)
|
||||||
goto read_node_fail;
|
goto read_node_fail;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Monitor only this sensor if defined, otherwise monitor all tsens
|
||||||
|
*/
|
||||||
|
key = "qcom,vdd-restriction-sensor-id";
|
||||||
|
if (of_property_read_u32(node, key, &data->vdd_rstr_sensor_id))
|
||||||
|
data->vdd_rstr_sensor_id = MONITOR_ALL_TSENS;
|
||||||
|
|
||||||
for_each_child_of_node(node, child_node) {
|
for_each_child_of_node(node, child_node) {
|
||||||
rails_cnt++;
|
rails_cnt++;
|
||||||
}
|
}
|
||||||
|
@ -6174,7 +6181,7 @@ static int probe_vdd_rstr(struct device_node *node,
|
||||||
goto read_node_fail;
|
goto read_node_fail;
|
||||||
}
|
}
|
||||||
ret = sensor_mgr_init_threshold(&thresh[MSM_VDD_RESTRICTION],
|
ret = sensor_mgr_init_threshold(&thresh[MSM_VDD_RESTRICTION],
|
||||||
MONITOR_ALL_TSENS,
|
data->vdd_rstr_sensor_id,
|
||||||
data->vdd_rstr_temp_hyst_degC, data->vdd_rstr_temp_degC,
|
data->vdd_rstr_temp_hyst_degC, data->vdd_rstr_temp_degC,
|
||||||
vdd_restriction_notify);
|
vdd_restriction_notify);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
|
@ -7110,6 +7117,10 @@ static void thermal_vdd_config_read(struct seq_file *m, void *data)
|
||||||
msm_thermal_info.vdd_rstr_temp_degC);
|
msm_thermal_info.vdd_rstr_temp_degC);
|
||||||
seq_printf(m, "threshold clear:%d degC\n",
|
seq_printf(m, "threshold clear:%d degC\n",
|
||||||
msm_thermal_info.vdd_rstr_temp_hyst_degC);
|
msm_thermal_info.vdd_rstr_temp_hyst_degC);
|
||||||
|
if (msm_thermal_info.vdd_rstr_sensor_id != MONITOR_ALL_TSENS)
|
||||||
|
seq_printf(m, "tsens sensor:tsens_tz_sensor%d\n",
|
||||||
|
msm_thermal_info.vdd_rstr_sensor_id);
|
||||||
|
|
||||||
for (i = 0; i < rails_cnt; i++) {
|
for (i = 0; i < rails_cnt; i++) {
|
||||||
if (!strcmp(rails[i].name, "vdd-dig")
|
if (!strcmp(rails[i].name, "vdd-dig")
|
||||||
&& rails[i].num_levels)
|
&& rails[i].num_levels)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2012-2016, The Linux Foundation. All rights reserved.
|
* Copyright (c) 2012-2016,2018, The Linux Foundation. All rights reserved.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* 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
|
* it under the terms of the GNU General Public License version 2 and
|
||||||
|
@ -54,6 +54,7 @@ struct msm_thermal_data {
|
||||||
uint32_t freq_limit;
|
uint32_t freq_limit;
|
||||||
int32_t vdd_rstr_temp_degC;
|
int32_t vdd_rstr_temp_degC;
|
||||||
int32_t vdd_rstr_temp_hyst_degC;
|
int32_t vdd_rstr_temp_hyst_degC;
|
||||||
|
int32_t vdd_rstr_sensor_id;
|
||||||
int32_t vdd_mx_min;
|
int32_t vdd_mx_min;
|
||||||
int32_t vdd_cx_min;
|
int32_t vdd_cx_min;
|
||||||
int32_t psm_temp_degC;
|
int32_t psm_temp_degC;
|
||||||
|
|
Loading…
Add table
Reference in a new issue