From: Philipp Zabel <p.zabel@pengutronix.de>
To: mtk36707 <kuanfu.lu@mediatek.com>,
"Rafael J . Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Zhang Rui <rui.zhang@intel.com>,
Lukasz Luba <lukasz.luba@arm.com>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
Balsam CHIHI <bchihi@baylibre.com>
Cc: linux-pm@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, jarried.lin@mediatek.com,
vince-wl.liu@mediatek.com, justin.yeh@mediatek.com
Subject: Re: [PATCH 2/2] thermal: mediatek: lvts: Add MT8189 support
Date: Mon, 27 Apr 2026 11:14:31 +0200 [thread overview]
Message-ID: <871996c5a57223294c584c0ff344efd30b3b982b.camel@pengutronix.de> (raw)
In-Reply-To: <20260427065236.1685057-2-kuanfu.lu@mediatek.com>
On Mo, 2026-04-27 at 14:48 +0800, mtk36707 wrote:
> From: Kuanfu Lu <kuanfu.lu@mediatek.com>
>
> Add LVTS thermal support for MediaTek MT8189 by adding MT8189-specific
> controller/sensor topology and platform data for the MCU and AP domains.
>
> MT8189 differs from previous SoCs in a few aspects, so extend the driver
> to handle these variations:
> - Program the hardware thermal shutdown threshold (tshut) using raw units.
> - Add per-SoC feature flags to skip clock gating and reset control when
> they are not required, and to enable Stage-3 monitor interrupt setup.
> - Pass SoC data into lvts_irq_init() and lvts_ctrl_configure() so the
> initialization can be configured per platform.
>
> This enables monitoring of MT8189 CPU clusters and AP domain sensors
> (SOC/APU/GPU) with the existing LVTS driver.
>
> Signed-off-by: Kuanfu Lu <kuanfu.lu@mediatek.com>
> ---
> drivers/thermal/mediatek/lvts_thermal.c | 142 +++++++++++++++++++++---
> 1 file changed, 129 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/mediatek/lvts_thermal.c
> index a9617d5e0077..9dbd9191e3ba 100644
> --- a/drivers/thermal/mediatek/lvts_thermal.c
> +++ b/drivers/thermal/mediatek/lvts_thermal.c
[...]
> @@ -1470,10 +1482,12 @@ static int lvts_probe(struct platform_device *pdev)
> if (IS_ERR(lvts_td->base))
> return dev_err_probe(dev, PTR_ERR(lvts_td->base), "Failed to map io resource\n");
>
> - lvts_td->reset = devm_reset_control_get_by_index(dev, 0);
First of all, this should have been:
lvts_td->reset = devm_reset_control_get_exclusive(dev, NULL);
since there is only a single reset control defined in the binding.
> - if (IS_ERR(lvts_td->reset))
> - return dev_err_probe(dev, PTR_ERR(lvts_td->reset), "Failed to get reset control\n");
> -
> + if (!lvts_data->reset_no_need) {
> + lvts_td->reset = devm_reset_control_get_by_index(dev, 0);
So this can be changed to
lvts_td->reset = devm_reset_control_get_optional_exclusive(dev, NULL);
instead. There is no need for the reset_no_need parameter at all.
Whether the reset control is required or not is already specified in
the device tree bindings.
> + if (IS_ERR(lvts_td->reset))
> + return dev_err_probe(dev, PTR_ERR(lvts_td->reset),
> + "Failed to get reset control\n");
> + }
> irq = platform_get_irq(pdev, 0);
> if (irq < 0)
> return irq;
regards
Philipp
next prev parent reply other threads:[~2026-04-27 9:15 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-27 6:48 [PATCH 1/2] dt-bindings: thermal: mediatek: Add MT8189 LVTS bindings mtk36707
2026-04-27 6:48 ` [PATCH 2/2] thermal: mediatek: lvts: Add MT8189 support mtk36707
2026-04-27 9:14 ` Philipp Zabel [this message]
2026-04-27 8:24 ` [PATCH 1/2] dt-bindings: thermal: mediatek: Add MT8189 LVTS bindings Rob Herring (Arm)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=871996c5a57223294c584c0ff344efd30b3b982b.camel@pengutronix.de \
--to=p.zabel@pengutronix.de \
--cc=angelogioacchino.delregno@collabora.com \
--cc=bchihi@baylibre.com \
--cc=conor+dt@kernel.org \
--cc=daniel.lezcano@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jarried.lin@mediatek.com \
--cc=justin.yeh@mediatek.com \
--cc=krzk+dt@kernel.org \
--cc=kuanfu.lu@mediatek.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=matthias.bgg@gmail.com \
--cc=rafael@kernel.org \
--cc=robh@kernel.org \
--cc=rui.zhang@intel.com \
--cc=vince-wl.liu@mediatek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox