From: Lukasz Luba <lukasz.luba@arm.com>
To: Dragan Simic <dsimic@manjaro.org>
Cc: rafael@kernel.org, daniel.lezcano@linaro.org,
linux-rockchip@lists.infradead.org, rui.zhang@intel.com,
heiko@sntech.de, linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
Kever Yang <kever.yang@rock-chips.com>,
Diederik de Haas <didi.debian@cknow.org>,
linux-pm@vger.kernel.org
Subject: Re: [PATCH] thermal: rockchip: Extract TSADC conversion tables into a header file
Date: Thu, 27 Feb 2025 14:42:46 +0000 [thread overview]
Message-ID: <8fcb202f-d1b3-4989-9777-5bafd6fed59e@arm.com> (raw)
In-Reply-To: <08d2fc6e1972f1f90c900542bf66945d6dc6db63.1740577122.git.dsimic@manjaro.org>
Hi Dragan,
On 2/26/25 13:42, Dragan Simic wrote:
> Move the TSADC code-to-temperature mapping tables from the Rockchip thermal
> driver to a separate header file, to no longer have the somewhat cluttering
> mapping data as part of the driver itself. [1]
>
> These mapping tables come verbatim from the SoC technical reference manuals
> (TRMs) and the downstream kernel code, [2] and may be updated at some point
> in the future, according to the manufacturer test results, [3] so extracting
> the tables into a separate header file not just improves the readability of
> the driver code, but introduces a clear separation.
>
> Improve the wording of the moved comment block, sprinkle a few short comments
> over the newly introduced header file, and move the already existing single
> stray #include directive in the driver code to its beginning.
>
> [1] https://lore.kernel.org/linux-rockchip/7f17cc55-a741-4bb8-9513-0580ca6fedd3@linaro.org/T/#u
> [2] https://raw.githubusercontent.com/rockchip-linux/kernel/f8b9431ee38ed561650be7092ab93f564598daa9/drivers/thermal/rockchip_thermal.c
> [3] https://lore.kernel.org/linux-rockchip/b4ab86b56177a234f3738c477693e858@manjaro.org/T/#u
>
I think Daniel was more thinking something about saving the
memory in the kernel. I see how this patch can help the readability
of the driver code, but that doesn't help much to not occupy the kernel
data. The driver will be built with that memory and the distro would
run on some platform with particular chip. The other chips data won't
be needed.
Why not to have that information in the DT?
That would save the memory and be configurable for only needed platform.
Please have a look into the generic thermal ADC driver and related
DT entry, which is used e.g. here [1].
That table looks similar to your info.
Regards,
Lukasz
[1]
https://elixir.bootlin.com/linux/v6.13.4/source/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi#L136
next prev parent reply other threads:[~2025-02-27 14:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-26 13:42 [PATCH] thermal: rockchip: Extract TSADC conversion tables into a header file Dragan Simic
2025-02-27 14:42 ` Lukasz Luba [this message]
2025-02-27 17:01 ` Dragan Simic
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=8fcb202f-d1b3-4989-9777-5bafd6fed59e@arm.com \
--to=lukasz.luba@arm.com \
--cc=daniel.lezcano@linaro.org \
--cc=didi.debian@cknow.org \
--cc=dsimic@manjaro.org \
--cc=heiko@sntech.de \
--cc=kever.yang@rock-chips.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-rockchip@lists.infradead.org \
--cc=rafael@kernel.org \
--cc=rui.zhang@intel.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