diff mbox series

[3/3] thermal: rcar_gen3_thermal: Add r8a779a0 support

Message ID 20201126223028.3119044-4-niklas.soderlund+renesas@ragnatech.se
State Accepted
Commit e854da4f51117d7340ec621face92e775bcd4d22
Headers show
Series thermal: Add support for R-Car V3U (r8a779a0) | expand

Commit Message

Niklas Söderlund Nov. 26, 2020, 10:30 p.m. UTC
Add support for R-Car V3U. The new THCODE values are taken from the
example in the datasheet.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/thermal/rcar_gen3_thermal.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven Jan. 5, 2021, 10:29 a.m. UTC | #1
Hi Niklas,

On Thu, Nov 26, 2020 at 11:30 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> Add support for R-Car V3U. The new THCODE values are taken from the

> example in the datasheet.

>

> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>


Thanks for your patch!

> --- a/drivers/thermal/rcar_gen3_thermal.c

> +++ b/drivers/thermal/rcar_gen3_thermal.c

> @@ -60,13 +60,14 @@

>  #define MCELSIUS(temp) ((temp) * 1000)

>  #define GEN3_FUSE_MASK 0xFFF

>

> -#define TSC_MAX_NUM    3

> +#define TSC_MAX_NUM    4


As pointed out by Shimoda-san in response to the DT binding update,
R-Car V3U has 5 sensors.

>

>  /* default THCODE values if FUSEs are missing */

>  static const int thcodes[TSC_MAX_NUM][3] = {

>         { 3397, 2800, 2221 },

>         { 3393, 2795, 2216 },

>         { 3389, 2805, 2237 },

> +       { 3415, 2694, 2195 },


No idea what the missing fifth entry should be...

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds
diff mbox series

Patch

diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c
index 94f2c133a47f66b6..75c69fe6e9553f25 100644
--- a/drivers/thermal/rcar_gen3_thermal.c
+++ b/drivers/thermal/rcar_gen3_thermal.c
@@ -60,13 +60,14 @@ 
 #define MCELSIUS(temp)	((temp) * 1000)
 #define GEN3_FUSE_MASK	0xFFF
 
-#define TSC_MAX_NUM	3
+#define TSC_MAX_NUM	4
 
 /* default THCODE values if FUSEs are missing */
 static const int thcodes[TSC_MAX_NUM][3] = {
 	{ 3397, 2800, 2221 },
 	{ 3393, 2795, 2216 },
 	{ 3389, 2805, 2237 },
+	{ 3415, 2694, 2195 },
 };
 
 /* Structure for thermal temperature calculation */
@@ -276,6 +277,10 @@  static const struct of_device_id rcar_gen3_thermal_dt_ids[] = {
 		.compatible = "renesas,r8a77980-thermal",
 		.data = &rcar_gen3_ths_tj_1,
 	},
+	{
+		.compatible = "renesas,r8a779a0-thermal",
+		.data = &rcar_gen3_ths_tj_1,
+	},
 	{},
 };
 MODULE_DEVICE_TABLE(of, rcar_gen3_thermal_dt_ids);