aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/rockchip_thermal.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2017-11-17 14:31:27 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-17 14:31:27 -0800
commitbec04432cb9036dedf89140c102b5ac03e4b3626 (patch)
tree390d76ddf5f302577efc704a78251f099bfecbf5 /drivers/thermal/rockchip_thermal.c
parentMerge branch 'parisc-4.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux (diff)
parentMerge branches 'thermal-core', 'thermal-tool', 'thermal-intel' and 'thermal-soc' into next (diff)
downloadlinux-dev-bec04432cb9036dedf89140c102b5ac03e4b3626.tar.xz
linux-dev-bec04432cb9036dedf89140c102b5ac03e4b3626.zip
Merge branch 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux
Pull thermal management updates from Zhang Rui: - introduce brcmstb AVS TMON thermal driver (Brian Norris) - add Rockchip RV1108 support in rockchip thermal driver (Rocky Hao) - major rework on HISI driver plus additional support of hisi3660 (Daniel Lezcano) - add nvmem-cells binding on imx6sx (Leonard Crestez) - fix a NULL pointer dereference on ti thermal driver unloading (Tony Lindgren) - improve tmon tool to make it easier to cross-compile tmon (Markus Mayer) - add Coffee Lake and Cannon Lake support for intel processor and pch thermal drivers (Srinivas Pandruvada) - other small fixes and cleanups (Arvind Yadav, Colin Ian King, Allen Wild, Nicolin Chen, Baruch SiachNiklas Söderlund, Arnd Bergmann) * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux: (44 commits) thermal: pch: Add Cannon Lake support thermal: int340x: processor_thermal: Add Coffee Lake support thermal: int340x: processor_thermal: Add Cannon Lake support thermal: bxt: remove redundant variable trip thermal: cpu_cooling: pr_err() strings should end with newlines thermal: add brcmstb AVS TMON driver Documentation: devicetree: add binding for Broadcom STB AVS TMON thermal/drivers/hisi: Add support for hi3660 SoC thermal/drivers/hisi: Prepare to add support for other hisi platforms thermal/drivers/hisi: Add platform prefix to function name thermal/drivers/hisi: Put platform code together thermal/drivers/qcom-spmi: Use devm_iio_channel_get thermal/drivers/generic-iio-adc: Switch tz request to devm version thermal/drivers/step_wise: Fix temperature regulation misbehavior thermal/drivers/hisi: Use round up step value thermal/drivers/hisi: Move the clk setup in the corresponding functions thermal/drivers/hisi: Remove mutex_lock in the code thermal/drivers/hisi: Remove thermal data back pointer thermal/drivers/hisi: Convert long to int thermal/drivers/hisi: Rename and remove unused field ...
Diffstat (limited to 'drivers/thermal/rockchip_thermal.c')
-rw-r--r--drivers/thermal/rockchip_thermal.c67
1 files changed, 67 insertions, 0 deletions
diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index 206035139110..f36375d5a16c 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -242,6 +242,45 @@ struct tsadc_table {
int temp;
};
+static const struct tsadc_table rv1108_table[] = {
+ {0, -40000},
+ {374, -40000},
+ {382, -35000},
+ {389, -30000},
+ {397, -25000},
+ {405, -20000},
+ {413, -15000},
+ {421, -10000},
+ {429, -5000},
+ {436, 0},
+ {444, 5000},
+ {452, 10000},
+ {460, 15000},
+ {468, 20000},
+ {476, 25000},
+ {483, 30000},
+ {491, 35000},
+ {499, 40000},
+ {507, 45000},
+ {515, 50000},
+ {523, 55000},
+ {531, 60000},
+ {539, 65000},
+ {547, 70000},
+ {555, 75000},
+ {562, 80000},
+ {570, 85000},
+ {578, 90000},
+ {586, 95000},
+ {594, 100000},
+ {602, 105000},
+ {610, 110000},
+ {618, 115000},
+ {626, 120000},
+ {634, 125000},
+ {TSADCV2_DATA_MASK, 125000},
+};
+
static const struct tsadc_table rk3228_code_table[] = {
{0, -40000},
{588, -40000},
@@ -779,6 +818,30 @@ static void rk_tsadcv2_tshut_mode(int chn, void __iomem *regs,
writel_relaxed(val, regs + TSADCV2_INT_EN);
}
+static const struct rockchip_tsadc_chip rv1108_tsadc_data = {
+ .chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
+ .chn_num = 1, /* one channel for tsadc */
+
+ .tshut_mode = TSHUT_MODE_GPIO, /* default TSHUT via GPIO give PMIC */
+ .tshut_polarity = TSHUT_LOW_ACTIVE, /* default TSHUT LOW ACTIVE */
+ .tshut_temp = 95000,
+
+ .initialize = rk_tsadcv2_initialize,
+ .irq_ack = rk_tsadcv3_irq_ack,
+ .control = rk_tsadcv3_control,
+ .get_temp = rk_tsadcv2_get_temp,
+ .set_alarm_temp = rk_tsadcv2_alarm_temp,
+ .set_tshut_temp = rk_tsadcv2_tshut_temp,
+ .set_tshut_mode = rk_tsadcv2_tshut_mode,
+
+ .table = {
+ .id = rv1108_table,
+ .length = ARRAY_SIZE(rv1108_table),
+ .data_mask = TSADCV2_DATA_MASK,
+ .mode = ADC_INCREMENT,
+ },
+};
+
static const struct rockchip_tsadc_chip rk3228_tsadc_data = {
.chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
.chn_num = 1, /* one channel for tsadc */
@@ -928,6 +991,10 @@ static const struct rockchip_tsadc_chip rk3399_tsadc_data = {
static const struct of_device_id of_rockchip_thermal_match[] = {
{
+ .compatible = "rockchip,rv1108-tsadc",
+ .data = (void *)&rv1108_tsadc_data,
+ },
+ {
.compatible = "rockchip,rk3228-tsadc",
.data = (void *)&rk3228_tsadc_data,
},