linux-mediatek.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Daniel Golle <daniel@makrotopia.org>,
	linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Amit Kucheria <amitk@kernel.org>, Zhang Rui <rui.zhang@intel.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Rob Herring <robh+dt@kernel.org>
Cc: John Crispin <john@phrozen.org>,
	Steven Liu <steven.liu@mediatek.com>,
	Chad Monroe <chad@monroe.io>, Henry Yen <Henry.Yen@mediatek.com>
Subject: Re: [PATCH v4 2/2] thermal: mediatek: add support for MT7986 and MT7981
Date: Wed, 18 Jan 2023 13:53:58 +0100	[thread overview]
Message-ID: <0dc9466d-9baa-451b-98fa-7caf424acd4c@collabora.com> (raw)
In-Reply-To: <aa957c759b1182aee00cc35178667f849f941b42.1674012985.git.daniel@makrotopia.org>

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@makrotopia.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



      reply	other threads:[~2023-01-18 12:54 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-18  3:55 [PATCH v4 0/2] thermal: mediatek: add support for MT7986 and MT7981 Daniel Golle
2023-01-18  3:55 ` [PATCH v4 1/2] thermal: mediatek: use function pointer for raw_to_mcelsius Daniel Golle
2023-01-18 12:51   ` AngeloGioacchino Del Regno
2023-01-18  3:55 ` [PATCH v4 2/2] thermal: mediatek: add support for MT7986 and MT7981 Daniel Golle
2023-01-18 12:53   ` AngeloGioacchino Del Regno [this message]

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=0dc9466d-9baa-451b-98fa-7caf424acd4c@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=Henry.Yen@mediatek.com \
    --cc=amitk@kernel.org \
    --cc=chad@monroe.io \
    --cc=daniel.lezcano@linaro.org \
    --cc=daniel@makrotopia.org \
    --cc=john@phrozen.org \
    --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=matthias.bgg@gmail.com \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=steven.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;
as well as URLs for NNTP newsgroup(s).