[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAGb2v656qzX3YrcuTt++=-r5JCyDKgGB8NYTAM3TpyRtAwdibw@mail.gmail.com>
Date: Mon, 27 Oct 2025 10:39:00 +0800
From: Chen-Yu Tsai <wens@...e.org>
To: iuncuim <iuncuim@...il.com>
Cc: Vasily Khoruzhick <anarsoul@...il.com>, Yangtao Li <tiny.windzz@...il.com>,
"Rafael J. Wysocki" <rafael@...nel.org>, Daniel Lezcano <daniel.lezcano@...aro.org>,
Zhang Rui <rui.zhang@...el.com>, Lukasz Luba <lukasz.luba@....com>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>,
Jernej Skrabec <jernej.skrabec@...il.com>, Samuel Holland <samuel@...lland.org>,
Philipp Zabel <p.zabel@...gutronix.de>, Andre Przywara <andre.przywara@....com>,
linux-pm@...r.kernel.org, devicetree@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org, linux-sunxi@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 2/6] thermal/drivers/sun8i: add gpadc clock
On Sat, Oct 25, 2025 at 12:32 PM iuncuim <iuncuim@...il.com> wrote:
>
> From: Mikhail Kalashnikov <iuncuim@...il.com>
>
> Some processors (e.g. Allwinner A523) require GPADC clocking activation for
> temperature sensors to work. So let's add support for enabling it.
>
> Signed-off-by: Mikhail Kalashnikov <iuncuim@...il.com>
Reviewed-by: Chen-Yu Tsai <wens@...nel.org>
> ---
> drivers/thermal/sun8i_thermal.c | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c
> index 226747906..c02c398b0 100644
> --- a/drivers/thermal/sun8i_thermal.c
> +++ b/drivers/thermal/sun8i_thermal.c
> @@ -66,6 +66,7 @@ struct tsensor {
> };
>
> struct ths_thermal_chip {
> + bool has_gpadc_clk;
> bool has_mod_clk;
> bool has_bus_clk_reset;
> bool needs_sram;
We could optimize this using bit fields instead. This can be done in a later
patch if you want to do it.
ChenYu
> @@ -89,6 +90,7 @@ struct ths_device {
> struct regmap_field *sram_regmap_field;
> struct reset_control *reset;
> struct clk *bus_clk;
> + struct clk *gpadc_clk;
> struct clk *mod_clk;
> struct tsensor sensor[MAX_SENSOR_NUM];
> };
> @@ -417,6 +419,12 @@ static int sun8i_ths_resource_init(struct ths_device *tmdev)
> if (ret)
> return ret;
>
> + if (tmdev->chip->has_gpadc_clk) {
> + tmdev->gpadc_clk = devm_clk_get_enabled(&pdev->dev, "gpadc");
> + if (IS_ERR(tmdev->gpadc_clk))
> + return PTR_ERR(tmdev->gpadc_clk);
> + }
> +
> if (tmdev->chip->needs_sram) {
> struct regmap *regmap;
>
> --
> 2.51.0
>
>
Powered by blists - more mailing lists