[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0dc9466d-9baa-451b-98fa-7caf424acd4c@collabora.com>
Date: Wed, 18 Jan 2023 13:53:58 +0100
From: AngeloGioacchino Del Regno
<angelogioacchino.delregno@...labora.com>
To: Daniel Golle <daniel@...rotopia.org>, linux-pm@...r.kernel.org,
linux-arm-kernel@...ts.infradead.org,
linux-mediatek@...ts.infradead.org, linux-kernel@...r.kernel.org,
"Rafael J. Wysocki" <rafael@...nel.org>,
Daniel Lezcano <daniel.lezcano@...aro.org>,
Amit Kucheria <amitk@...nel.org>,
Zhang Rui <rui.zhang@...el.com>,
Matthias Brugger <matthias.bgg@...il.com>,
Rob Herring <robh+dt@...nel.org>
Cc: Steven Liu <steven.liu@...iatek.com>,
Henry Yen <Henry.Yen@...iatek.com>,
Chad Monroe <chad@...roe.io>, John Crispin <john@...ozen.org>,
Frank Wunderlich <frank-w@...lic-files.de>
Subject: Re: [PATCH v4 2/2] thermal: mediatek: add support for MT7986 and
MT7981
Il 18/01/23 04:55, Daniel Golle ha scritto:
> Add support for V3 generation thermal found in MT7986 and MT7981 SoCs.
> Brings code to assign values from efuse as well as new function to
> convert raw temperature to millidegree celsius, as found in MediaTek's
> SDK sources (but cleaned up and de-duplicated)
>
> [1]: https://git01.mediatek.com/plugins/gitiles/openwrt/feeds/mtk-openwrt-feeds/+/baf36c7eef477aae1f8f2653b6c29e2caf48475b
> Signed-off-by: Daniel Golle <daniel@...rotopia.org>
> ---
> drivers/thermal/mtk_thermal.c | 137 ++++++++++++++++++++++++++++++++--
> 1 file changed, 132 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/thermal/mtk_thermal.c b/drivers/thermal/mtk_thermal.c
> index 992750ee09e62..171f485a809bb 100644
> --- a/drivers/thermal/mtk_thermal.c
> +++ b/drivers/thermal/mtk_thermal.c
..snip..
> .data = (void *)&mt8183_thermal_data,
> @@ -1068,15 +1186,24 @@ static int mtk_thermal_probe(struct platform_device *pdev)
> goto err_disable_clk_auxadc;
> }
>
> - if (mt->conf->version == MTK_THERMAL_V2) {
> + if (mt->conf->version != MTK_THERMAL_V1) {
> mtk_thermal_turn_on_buffer(apmixed_base);
> mtk_thermal_release_periodic_ts(mt, auxadc_base);
> }
>
> - if (mt->conf->version == MTK_THERMAL_V1)
> + switch (mt->conf->version) {
> + case MTK_THERMAL_V1:
> mt->raw_to_mcelsius = raw_to_mcelsius_v1;
> - else
> + break;
> + case MTK_THERMAL_V2:
> mt->raw_to_mcelsius = raw_to_mcelsius_v2;
> + break;
> + case MTK_THERMAL_V3:
> + mt->raw_to_mcelsius = raw_to_mcelsius_v3;
> + break;
> + default:
> + break;
> + }
Either directly use a switch in your commit [1/2] or follow `else if` here.
I would prefer if you changed your first commit to use a switch, but I don't
really have strong opinions, which is why I gave you a Reviewed-by tag on
[1/2].
Your choice - but please don't "change the game" all of a sudden in a commit
whose purpose is to add support for a new version of MTK_THERMAL. :-)
Cheers,
Angelo
Powered by blists - more mailing lists