From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Daniel Golle <daniel@makrotopia.org>
Cc: 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>,
Steven Liu <steven.liu@mediatek.com>,
Henry Yen <Henry.Yen@mediatek.com>,
Amjad Ouled-Ameur <aouledameur@baylibre.com>
Subject: Re: [PATCH v2 1/2] thermal: mediatek: add support for MT7986 and MT7981
Date: Tue, 6 Dec 2022 09:28:16 +0100 [thread overview]
Message-ID: <adc67800-beae-2f42-9cc7-5f041e390b61@collabora.com> (raw)
In-Reply-To: <Y44tdASIQ2DpL9re@makrotopia.org>
Il 05/12/22 18:42, Daniel Golle ha scritto:
> Hi Angelo,
>
> On Thu, Dec 01, 2022 at 02:24:17PM +0100, AngeloGioacchino Del Regno wrote:
>> Il 30/11/22 14:19, 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>
>>> Reviewed-by: Henry Yen <henry.yen@mediatek.com>
>>> ---
>>> Changes since v1: Drop use of adc_oe field in efuse, Henry Yen confirmed
>>> its use has been dropped intentionally in MTK SDK as well.
>>>
>>> drivers/thermal/mtk_thermal.c | 122 +++++++++++++++++++++++++++++++++-
>>> 1 file changed, 119 insertions(+), 3 deletions(-)
>>>
...
>>
>> What about optimizing this with assigning a function pointer?
>> Like that, we wouldn't check any version in there... as in that case we'd
>> simply do something like
>>
>> temp = conf->raw_to_mcelsius(mt, conf->bank...blahblah...);
>>
>> ...and this would also mean that the snippet saying "the first read of a sensor
>> often contains very high bogus temperature value [...]" would get merged in the v2
>> of raw_to_mcelsius (as that function is used only in mtk_thermal_bank_temperature).
>
> I found that Amjad Ouled-Ameur is taking care of converting that series
> of if-else options into a function pointer allowing to easily call the
> right raw_to_mcelsius function.
>
> [PATCH v7 0/4] thermal: mediatek: Add support for MT8365 SoC
> https://lore.kernel.org/linux-arm-kernel/4121bb6b-30db-7a23-f4c8-40afdda7a0b5@linaro.org/T/
>
> Should I wait until this series is merged and then submit support
> for MT7986 thermal on top of that?
>
Right - that may be sensible. Please coordinate with him, so that one of the two
series actually depends on the other (and they don't conflict with each other).
I've added him to the loop.
Regards,
Angelo
prev parent reply other threads:[~2022-12-06 8:28 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-30 13:19 Daniel Golle
2022-12-01 10:07 ` Henry Yen (顏修溫)
2022-12-01 13:24 ` AngeloGioacchino Del Regno
2022-12-05 17:42 ` Daniel Golle
2022-12-06 8:28 ` 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=adc67800-beae-2f42-9cc7-5f041e390b61@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=Henry.Yen@mediatek.com \
--cc=amitk@kernel.org \
--cc=aouledameur@baylibre.com \
--cc=daniel.lezcano@linaro.org \
--cc=daniel@makrotopia.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
all inboxes | Powered by JetHome®