From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yangtao Li Subject: [PATCH v5 13/18] thermal: sun8i: add thermal driver for A64 Date: Sat, 10 Aug 2019 05:28:24 +0000 Message-ID: <20190810052829.6032-14-tiny.windzz@gmail.com> References: <20190810052829.6032-1-tiny.windzz@gmail.com> Return-path: In-Reply-To: <20190810052829.6032-1-tiny.windzz@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: rui.zhang@intel.com, edubezval@gmail.com, daniel.lezcano@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, maxime.ripard@bootlin.com, wens@csie.org, mchehab+samsung@kernel.org, davem@davemloft.net, gregkh@linuxfoundation.org, Jonathan.Cameron@huawei.com, nicolas.ferre@microchip.com Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Vasily Khoruzhick List-Id: devicetree@vger.kernel.org From: Vasily Khoruzhick Thermal sensor controller in A64 is similar to H3, but it has 3 sensors. Extend H3 functions to add support for multiple sensors. Signed-off-by: Vasily Khoruzhick --- drivers/thermal/sun8i_thermal.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c index 41ce8cdc0546..3259081da841 100644 --- a/drivers/thermal/sun8i_thermal.c +++ b/drivers/thermal/sun8i_thermal.c @@ -515,6 +515,17 @@ static const struct ths_thermal_chip sun8i_h3_ths = { .irq_ack = sun8i_h3_irq_ack, }; +static const struct ths_thermal_chip sun50i_a64_ths = { + .sensor_num = 3, + .offset = -2170, + .scale = -117, + .has_mod_clk = true, + .temp_data_base = SUN8I_THS_TEMP_DATA, + .calibrate = sun8i_h3_ths_calibrate, + .init = sun8i_h3_thermal_init, + .irq_ack = sun8i_h3_irq_ack, +}; + static const struct ths_thermal_chip sun50i_h6_ths = { .sensor_num = 2, .offset = -2794, @@ -528,6 +539,7 @@ static const struct ths_thermal_chip sun50i_h6_ths = { static const struct of_device_id of_ths_match[] = { { .compatible = "allwinner,sun8i-h3-ths", .data = &sun8i_h3_ths }, + { .compatible = "allwinner,sun50i-a64-ths", .data = &sun50i_a64_ths }, { .compatible = "allwinner,sun50i-h6-ths", .data = &sun50i_h6_ths }, { /* sentinel */ }, }; -- 2.17.1