ARM: shmobile: r8a7790: add thermal driver support
authorSimon Horman <horms+renesas@verge.net.au>
Wed, 26 Jun 2013 07:22:21 +0000 (16:22 +0900)
committerSimon Horman <horms+renesas@verge.net.au>
Wed, 17 Jul 2013 05:25:27 +0000 (14:25 +0900)
The current temperature may be read using:
cat /sys/class/thermal/thermal_zone0/temp

Based on similar work for the r8a73a4 by Kuninori Morimoto.

Acked-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
arch/arm/mach-shmobile/setup-r8a7790.c

index b7e78b9a7fdfd52014045a90a557c1525bc17cc6..bc40a44de1274775ff1c79a024ffc19d59a3f007 100644 (file)
@@ -148,6 +148,17 @@ static struct resource irqc0_resources[] __initdata = {
                                          &irqc##idx##_data,            \
                                          sizeof(struct renesas_irqc_config))
 
+static struct resource thermal_resources[] __initdata = {
+       DEFINE_RES_MEM(0xe61f0000, 0x14),
+       DEFINE_RES_MEM(0xe61f0100, 0x38),
+       DEFINE_RES_IRQ(gic_spi(69)),
+};
+
+#define r8a7790_register_thermal()                                     \
+       platform_device_register_simple("rcar_thermal", -1,             \
+                                       thermal_resources,              \
+                                       ARRAY_SIZE(thermal_resources))
+
 void __init r8a7790_add_standard_devices(void)
 {
        r8a7790_register_scif(SCIFA0);
@@ -161,6 +172,7 @@ void __init r8a7790_add_standard_devices(void)
        r8a7790_register_scif(HSCIF0);
        r8a7790_register_scif(HSCIF1);
        r8a7790_register_irqc(0);
+       r8a7790_register_thermal();
 }
 
 void __init r8a7790_timer_init(void)