diff options
| author | Rama Krishna Phani A <rphani@codeaurora.org> | 2016-12-16 11:57:38 +0530 |
|---|---|---|
| committer | Rama Krishna Phani A <rphani@codeaurora.org> | 2016-12-19 12:15:52 +0530 |
| commit | e9a8a791daa5f3b662aafbd8b433b1594a12aae8 (patch) | |
| tree | aed2b65b897877fec9fadfae59c437e7cc5bcb6b | |
| parent | 3162449f7d245d45f007d4ea3224576ddf1bcc63 (diff) | |
thermal: tsens: Add support to parse critical interrupt properties
Add support to mask watchdog bark interrupt and controller cycle
completion as part of critical interrupt. Add support to mask the
corresponding properties if available in the controller.
Change-Id: I9445db12044071f92715a60cb76c38d061748cfa
Signed-off-by: Rama Krishna Phani A <rphani@codeaurora.org>
| -rw-r--r-- | Documentation/devicetree/bindings/thermal/tsens.txt | 7 | ||||
| -rw-r--r-- | drivers/thermal/msm-tsens.c | 27 |
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")) || |
