Loading Documentation/devicetree/bindings/arm/msm/msm_thermal.txt +4 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,9 @@ Optional properties key voltage rails, in degC. - qcom,vdd-restriction-temp-hysteresis: When temperature is above this threshold 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 rail, in degC. If this property exists, qcom,pmic-sw-mode-temp-hysteresis and Loading Loading @@ -273,6 +276,7 @@ Example: qcom,pmic-sw-mode-regs = "vdd-dig"; qcom,vdd-restriction-temp = <5>; qcom,vdd-restriction-temp-hysteresis = <10>; qcom,vdd-restriction-sensor-id = <0>; vdd-dig-supply=<&pm8841_s2_floor_corner> qcom,mx-restriction-temp = <5>; qcom,mx-restriction-temp-hysteresis = <10>; Loading drivers/thermal/msm_thermal.c +12 −1 Original line number Diff line number Diff line Loading @@ -6102,6 +6102,13 @@ static int probe_vdd_rstr(struct device_node *node, if (ret) 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) { rails_cnt++; } Loading Loading @@ -6174,7 +6181,7 @@ static int probe_vdd_rstr(struct device_node *node, goto read_node_fail; } 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, vdd_restriction_notify); if (ret) { Loading Loading @@ -7110,6 +7117,10 @@ static void thermal_vdd_config_read(struct seq_file *m, void *data) msm_thermal_info.vdd_rstr_temp_degC); seq_printf(m, "threshold clear:%d degC\n", 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++) { if (!strcmp(rails[i].name, "vdd-dig") && rails[i].num_levels) Loading include/linux/msm_thermal.h +2 −1 Original line number Diff line number Diff line /* * 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 * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -54,6 +54,7 @@ struct msm_thermal_data { uint32_t freq_limit; int32_t vdd_rstr_temp_degC; int32_t vdd_rstr_temp_hyst_degC; int32_t vdd_rstr_sensor_id; int32_t vdd_mx_min; int32_t vdd_cx_min; int32_t psm_temp_degC; Loading Loading
Documentation/devicetree/bindings/arm/msm/msm_thermal.txt +4 −0 Original line number Diff line number Diff line Loading @@ -55,6 +55,9 @@ Optional properties key voltage rails, in degC. - qcom,vdd-restriction-temp-hysteresis: When temperature is above this threshold 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 rail, in degC. If this property exists, qcom,pmic-sw-mode-temp-hysteresis and Loading Loading @@ -273,6 +276,7 @@ Example: qcom,pmic-sw-mode-regs = "vdd-dig"; qcom,vdd-restriction-temp = <5>; qcom,vdd-restriction-temp-hysteresis = <10>; qcom,vdd-restriction-sensor-id = <0>; vdd-dig-supply=<&pm8841_s2_floor_corner> qcom,mx-restriction-temp = <5>; qcom,mx-restriction-temp-hysteresis = <10>; Loading
drivers/thermal/msm_thermal.c +12 −1 Original line number Diff line number Diff line Loading @@ -6102,6 +6102,13 @@ static int probe_vdd_rstr(struct device_node *node, if (ret) 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) { rails_cnt++; } Loading Loading @@ -6174,7 +6181,7 @@ static int probe_vdd_rstr(struct device_node *node, goto read_node_fail; } 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, vdd_restriction_notify); if (ret) { Loading Loading @@ -7110,6 +7117,10 @@ static void thermal_vdd_config_read(struct seq_file *m, void *data) msm_thermal_info.vdd_rstr_temp_degC); seq_printf(m, "threshold clear:%d degC\n", 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++) { if (!strcmp(rails[i].name, "vdd-dig") && rails[i].num_levels) Loading
include/linux/msm_thermal.h +2 −1 Original line number Diff line number Diff line /* * 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 * it under the terms of the GNU General Public License version 2 and Loading Loading @@ -54,6 +54,7 @@ struct msm_thermal_data { uint32_t freq_limit; int32_t vdd_rstr_temp_degC; int32_t vdd_rstr_temp_hyst_degC; int32_t vdd_rstr_sensor_id; int32_t vdd_mx_min; int32_t vdd_cx_min; int32_t psm_temp_degC; Loading