linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] thermal/drivers/rockchip: add missing rk3328 mapping entry
@ 2025-02-07 16:47 Trevor Woerner
  2025-02-07 17:15 ` Dragan Simic
  0 siblings, 1 reply; 3+ messages in thread
From: Trevor Woerner @ 2025-02-07 16:47 UTC (permalink / raw)
  To: linux-kernel, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba, Heiko Stuebner, open list:THERMAL,
	moderated list:ARM/Rockchip SoC support,
	open list:ARM/Rockchip SoC support

The mapping table for the rk3328 is missing the entry for -25°C which is
found in the TRM[1] §9.5.2 "Temperature-to-code mapping".

NOTE: the kernel uses the tsadc_q_sel=1'b1 mode which is defined as:
      4096-<code in table>. Whereas the table in the TRM gives the code
      "3774" for -25°C, the kernel uses 4096-3774=322.

Link: https://opensource.rock-chips.com/images/9/97/Rockchip_RK3328TRM_V1.1-Part1-20170321.pdf
Signed-off-by: Trevor Woerner <twoerner@gmail.com>
---
 drivers/thermal/rockchip_thermal.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/thermal/rockchip_thermal.c b/drivers/thermal/rockchip_thermal.c
index f551df48eef9..a8ad85feb68f 100644
--- a/drivers/thermal/rockchip_thermal.c
+++ b/drivers/thermal/rockchip_thermal.c
@@ -386,6 +386,7 @@ static const struct tsadc_table rk3328_code_table[] = {
 	{296, -40000},
 	{304, -35000},
 	{313, -30000},
+	{322, -25000},
 	{331, -20000},
 	{340, -15000},
 	{349, -10000},
-- 
2.44.0.501.g19981daefd7c



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal/drivers/rockchip: add missing rk3328 mapping entry
  2025-02-07 16:47 [PATCH] thermal/drivers/rockchip: add missing rk3328 mapping entry Trevor Woerner
@ 2025-02-07 17:15 ` Dragan Simic
  2025-02-07 17:42   ` Trevor Woerner
  0 siblings, 1 reply; 3+ messages in thread
From: Dragan Simic @ 2025-02-07 17:15 UTC (permalink / raw)
  To: Trevor Woerner
  Cc: linux-kernel, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba, Heiko Stuebner, linux-pm, linux-arm-kernel,
	linux-rockchip

Hello Trevor,

On 2025-02-07 17:47, Trevor Woerner wrote:
> The mapping table for the rk3328 is missing the entry for -25°C which 
> is
> found in the TRM[1] §9.5.2 "Temperature-to-code mapping".
> 
> NOTE: the kernel uses the tsadc_q_sel=1'b1 mode which is defined as:
>       4096-<code in table>. Whereas the table in the TRM gives the code
>       "3774" for -25°C, the kernel uses 4096-3774=322.
> 
> Link:
> https://opensource.rock-chips.com/images/9/97/Rockchip_RK3328TRM_V1.1-Part1-20170321.pdf
> Signed-off-by: Trevor Woerner <twoerner@gmail.com>

Thanks for the patch.  I think this should also include a Fixes tag
and be submitted for inclusion into stable kernels.

> ---
>  drivers/thermal/rockchip_thermal.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/thermal/rockchip_thermal.c
> b/drivers/thermal/rockchip_thermal.c
> index f551df48eef9..a8ad85feb68f 100644
> --- a/drivers/thermal/rockchip_thermal.c
> +++ b/drivers/thermal/rockchip_thermal.c
> @@ -386,6 +386,7 @@ static const struct tsadc_table rk3328_code_table[] 
> = {
>  	{296, -40000},
>  	{304, -35000},
>  	{313, -30000},
> +	{322, -25000},
>  	{331, -20000},
>  	{340, -15000},
>  	{349, -10000},


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] thermal/drivers/rockchip: add missing rk3328 mapping entry
  2025-02-07 17:15 ` Dragan Simic
@ 2025-02-07 17:42   ` Trevor Woerner
  0 siblings, 0 replies; 3+ messages in thread
From: Trevor Woerner @ 2025-02-07 17:42 UTC (permalink / raw)
  To: Dragan Simic
  Cc: linux-kernel, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
	Lukasz Luba, Heiko Stuebner, linux-pm, linux-arm-kernel,
	linux-rockchip

On Fri 2025-02-07 @ 06:15:22 PM, Dragan Simic wrote:
> Hello Trevor,
> 
> On 2025-02-07 17:47, Trevor Woerner wrote:
> > The mapping table for the rk3328 is missing the entry for -25°C which is
> > found in the TRM[1] §9.5.2 "Temperature-to-code mapping".
> > 
> > NOTE: the kernel uses the tsadc_q_sel=1'b1 mode which is defined as:
> >       4096-<code in table>. Whereas the table in the TRM gives the code
> >       "3774" for -25°C, the kernel uses 4096-3774=322.
> > 
> > Link:
> > https://opensource.rock-chips.com/images/9/97/Rockchip_RK3328TRM_V1.1-Part1-20170321.pdf
> > Signed-off-by: Trevor Woerner <twoerner@gmail.com>
> 
> Thanks for the patch.  I think this should also include a Fixes tag

Okay, I'll send a v2. It's not really a big fix. The TRM instructs the code
to interpolate linearly between values (which I assume the Linux kernel does?)
and the table is completely linear in this range.

> and be submitted for inclusion into stable kernels.
> 
> > ---
> >  drivers/thermal/rockchip_thermal.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/thermal/rockchip_thermal.c
> > b/drivers/thermal/rockchip_thermal.c
> > index f551df48eef9..a8ad85feb68f 100644
> > --- a/drivers/thermal/rockchip_thermal.c
> > +++ b/drivers/thermal/rockchip_thermal.c
> > @@ -386,6 +386,7 @@ static const struct tsadc_table rk3328_code_table[]
> > = {
> >  	{296, -40000},
> >  	{304, -35000},
> >  	{313, -30000},
> > +	{322, -25000},
> >  	{331, -20000},
> >  	{340, -15000},
> >  	{349, -10000},


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-02-07 17:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-07 16:47 [PATCH] thermal/drivers/rockchip: add missing rk3328 mapping entry Trevor Woerner
2025-02-07 17:15 ` Dragan Simic
2025-02-07 17:42   ` Trevor Woerner

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).