From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 96D7B372EDD for ; Mon, 27 Apr 2026 09:14:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777281299; cv=none; b=kThkd0Nc6xy9HjrrmznWwnCUQdVsIbGZihP8zLAiROaJsDKWdEa7SPwdWVa16AZ23W+tZQaNgM65cnPXYDw1/VkqopS/+yi0YLsnd5BjJ6WOmmQrTnVmQugNhkuOla2wDWRomvYD4pJm2riTokvKW5eCsAltyNo+zzXuZUm3yl4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777281299; c=relaxed/simple; bh=EzPC7nqk9AgFER6/WVv2twNqV5B+PmIayWg4UAsoMyk=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=NIc2+/ec5FOdVMLrNzvaBLhLufWQHxCadTe5MofG6eGTt8jEUHPI2JF3qM1y6xXecGv5QuaP9B/x0+HsLDXXfmgBAX+dFaseIwRQzaP+scOb1Z2nzZ/e8PnbKl8NeskEpc1peQkFk47jvGN3yH8GI4ArC4dYTdSEDyzXJWhvYng= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1wHI31-000151-3b; Mon, 27 Apr 2026 11:14:35 +0200 Received: from lupine.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::4e] helo=lupine) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1wHI2y-007Sug-0S; Mon, 27 Apr 2026 11:14:32 +0200 Received: from pza by lupine with local (Exim 4.98.2) (envelope-from ) id 1wHI2y-000000004DH-0Dxa; Mon, 27 Apr 2026 11:14:32 +0200 Message-ID: <871996c5a57223294c584c0ff344efd30b3b982b.camel@pengutronix.de> Subject: Re: [PATCH 2/2] thermal: mediatek: lvts: Add MT8189 support From: Philipp Zabel To: mtk36707 , "Rafael J . Wysocki" , Daniel Lezcano , Zhang Rui , Lukasz Luba , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Matthias Brugger , AngeloGioacchino Del Regno , Balsam CHIHI 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 Date: Mon, 27 Apr 2026 11:14:31 +0200 In-Reply-To: <20260427065236.1685057-2-kuanfu.lu@mediatek.com> References: <20260427065236.1685057-1-kuanfu.lu@mediatek.com> <20260427065236.1685057-2-kuanfu.lu@mediatek.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2-0+deb13u1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: p.zabel@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org On Mo, 2026-04-27 at 14:48 +0800, mtk36707 wrote: > From: Kuanfu Lu >=20 > Add LVTS thermal support for MediaTek MT8189 by adding MT8189-specific > controller/sensor topology and platform data for the MCU and AP domains. >=20 > 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. >=20 > This enables monitoring of MT8189 CPU clusters and AP domain sensors > (SOC/APU/GPU) with the existing LVTS driver. >=20 > Signed-off-by: Kuanfu Lu > --- > drivers/thermal/mediatek/lvts_thermal.c | 142 +++++++++++++++++++++--- > 1 file changed, 129 insertions(+), 13 deletions(-) >=20 > diff --git a/drivers/thermal/mediatek/lvts_thermal.c b/drivers/thermal/me= diatek/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 *pde= v) > if (IS_ERR(lvts_td->base)) > return dev_err_probe(dev, PTR_ERR(lvts_td->base), "Failed to map io re= source\n"); > =20 > - lvts_td->reset =3D devm_reset_control_get_by_index(dev, 0); First of all, this should have been: lvts_td->reset =3D 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 rese= t control\n"); > - > + if (!lvts_data->reset_no_need) { > + lvts_td->reset =3D devm_reset_control_get_by_index(dev, 0); So this can be changed to lvts_td->reset =3D 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 =3D platform_get_irq(pdev, 0); > if (irq < 0) > return irq; regards Philipp