summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2016-12-20 23:45:10 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2016-12-20 23:45:10 -0800
commit18f836e9081878f4e1e0bf41601a2690826afe95 (patch)
tree8ed687933f75ef189c7797ce8388f8151d36123b
parent11418bd51ed9e740cc91653db3beaa0d9bb75c8e (diff)
parente9a8a791daa5f3b662aafbd8b433b1594a12aae8 (diff)
Merge "thermal: tsens: Add support to parse critical interrupt properties"
-rw-r--r--Documentation/devicetree/bindings/thermal/tsens.txt7
-rw-r--r--drivers/thermal/msm-tsens.c27
2 files changed, 32 insertions, 2 deletions
diff --git a/Documentation/devicetree/bindings/thermal/tsens.txt b/Documentation/devicetree/bindings/thermal/tsens.txt
index fc697e843fbb..ada060d19a9b 100644
--- a/Documentation/devicetree/bindings/thermal/tsens.txt
+++ b/Documentation/devicetree/bindings/thermal/tsens.txt
@@ -82,10 +82,13 @@ Optional properties:
total number of supported sensors with each controller instance.
- qcom,valid-status-check: If property is present, check the VALID bit is set
before reporting the temperature data.
-- qcom,temp1-offset: If property is present, Use these offset values
+- qcom,temp1-offset: If flag is present, Use these offset values
to be added for 30 deg calib points.
-- qcom,temp2-offset: If property is present, Use these offset values
+- qcom,temp2-offset: If flag is present, Use these offset values
to be added for 120 deg calib points.
+- qcom,cycle-monitor: If flag is present, Use the value for cycle
+ completion monitoring.
+- qcom,wd-bark: If flag is present, Use the value for watchdog bark.
Example:
diff --git a/drivers/thermal/msm-tsens.c b/drivers/thermal/msm-tsens.c
index 7592bcb984ff..0a9e561268b6 100644
--- a/drivers/thermal/msm-tsens.c
+++ b/drivers/thermal/msm-tsens.c
@@ -832,8 +832,12 @@ struct tsens_tm_device {
bool calibration_less_mode;
bool tsens_local_init;
bool gain_offset_programmed;
+ bool cycle_compltn_monitor;
+ bool wd_bark;
int tsens_factor;
uint32_t tsens_num_sensor;
+ uint32_t cycle_compltn_monitor_val;
+ uint32_t wd_bark_val;
int tsens_irq;
int tsens_critical_irq;
void *tsens_addr;
@@ -5331,6 +5335,7 @@ static int get_device_tree_data(struct platform_device *pdev,
u32 *tsens_slope_data, *sensor_id, *client_id;
u32 *temp1_calib_offset_factor, *temp2_calib_offset_factor;
u32 rc = 0, i, tsens_num_sensors = 0;
+ u32 cycle_monitor = 0, wd_bark = 0;
const struct of_device_id *id;
rc = of_property_read_u32(of_node,
@@ -5428,6 +5433,28 @@ static int get_device_tree_data(struct platform_device *pdev,
}
}
+ rc = of_property_read_u32(of_node,
+ "qcom,cycle-monitor", &cycle_monitor);
+ if (rc) {
+ pr_debug("Default cycle completion monitor\n");
+ tmdev->cycle_compltn_monitor = false;
+ } else {
+ pr_debug("Use specified cycle completion monitor\n");
+ tmdev->cycle_compltn_monitor = true;
+ tmdev->cycle_compltn_monitor_val = cycle_monitor;
+ }
+
+ rc = of_property_read_u32(of_node,
+ "qcom,wd-bark", &wd_bark);
+ if (rc) {
+ pr_debug("Default Watchdog bark\n");
+ tmdev->wd_bark = false;
+ } else {
+ pr_debug("Use specified Watchdog bark\n");
+ tmdev->wd_bark = true;
+ tmdev->wd_bark_val = wd_bark;
+ }
+
if (!strcmp(id->compatible, "qcom,mdm9630-tsens") ||
(!strcmp(id->compatible, "qcom,msmzirc-tsens")) ||
(!strcmp(id->compatible, "qcom,msm8994-tsens")) ||