Skip to contentSkip to conversation

thermal/drivers/rockchip: add missing rk3328 mapping entry

PATCH Superseded Trevor Woerner 2 participants 3 messages Feb 7, 2025

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 thermal/drivers/rockchip: add missing rk3328 mapping entry

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.

---
 drivers/thermal/rockchip_thermal.c | 1 +
 1 file changed, 1 insertion(+)
drivers/thermal/rockchip_thermal.c +1 -0
index f551df48eef9..a8ad85feb68f 100644
@@ -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},
Signature · 1 line
2.44.0.501.g19981daefd7c
#1 lore raw

Hello Trevor,

Quoted 10 lines · Trevor Woerner

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

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

Quoted 18 lines
---
 drivers/thermal/rockchip_thermal.c | 1 +
 1 file changed, 1 insertion(+)
drivers/thermal/rockchip_thermal.c +1 -0
index f551df48eef9..a8ad85feb68f 100644
@@ -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 lore raw
Quoted 10 lines · Dragan Simic

Hello Trevor,

Quoted 7 lines · Trevor Woerner

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.

Quoted 5 lines
Quoted 3 lines

Link:
https://opensource.rock-chips.com/images/9/97/Rockchip_RK3328TRM_V1.1-Part1-20170321.pdf

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.

Quoted 20 lines

and be submitted for inclusion into stable kernels.

Quoted 18 lines
---
 drivers/thermal/rockchip_thermal.c | 1 +
 1 file changed, 1 insertion(+)
drivers/thermal/rockchip_thermal.c +1 -0
index f551df48eef9..a8ad85feb68f 100644
@@ -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},