linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] ARM: shmobile: r8a7790: add thermal driver support
@ 2013-06-26  8:40 Simon Horman
  2013-06-26  8:40 ` [PATCH v2 1/2] " Simon Horman
  2013-06-26  8:40 ` [PATCH v2 2/2] ARM: shmobile: r8a73a4: add clocks for thermal Simon Horman
  0 siblings, 2 replies; 5+ messages in thread
From: Simon Horman @ 2013-06-26  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

This short series enables the thermal driver on the r8a7790 SoC
and thus the lager board.

It is based on renesas-next-20130620

Simon Horman (2):
  ARM: shmobile: r8a7790: add thermal driver support
  ARM: shmobile: r8a73a4: add clocks for thermal

 arch/arm/mach-shmobile/clock-r8a7790.c |  4 ++++
 arch/arm/mach-shmobile/setup-r8a7790.c | 12 ++++++++++++
 2 files changed, 16 insertions(+)

-- 
1.8.2.1

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

* [PATCH v2 1/2] ARM: shmobile: r8a7790: add thermal driver support
  2013-06-26  8:40 [PATCH v2 0/2] ARM: shmobile: r8a7790: add thermal driver support Simon Horman
@ 2013-06-26  8:40 ` Simon Horman
  2013-06-26  8:40 ` [PATCH v2 2/2] ARM: shmobile: r8a73a4: add clocks for thermal Simon Horman
  1 sibling, 0 replies; 5+ messages in thread
From: Simon Horman @ 2013-06-26  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

You can get current thermal by
> cat /sys/class/thermal/thermal_zone?/temp

Based on similar work for the r8a73a4 by Kuninori Morimoto.

Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/setup-r8a7790.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/arch/arm/mach-shmobile/setup-r8a7790.c b/arch/arm/mach-shmobile/setup-r8a7790.c
index 28f9475..06c720f 100644
--- a/arch/arm/mach-shmobile/setup-r8a7790.c
+++ b/arch/arm/mach-shmobile/setup-r8a7790.c
@@ -149,6 +149,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);
@@ -162,6 +173,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)
-- 
1.8.2.1

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

* [PATCH v2 2/2] ARM: shmobile: r8a73a4: add clocks for thermal
  2013-06-26  8:40 [PATCH v2 0/2] ARM: shmobile: r8a7790: add thermal driver support Simon Horman
  2013-06-26  8:40 ` [PATCH v2 1/2] " Simon Horman
@ 2013-06-26  8:40 ` Simon Horman
  2013-06-26 12:31   ` Sergei Shtylyov
  1 sibling, 1 reply; 5+ messages in thread
From: Simon Horman @ 2013-06-26  8:40 UTC (permalink / raw)
  To: linux-arm-kernel

Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/clock-r8a7790.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/arm/mach-shmobile/clock-r8a7790.c b/arch/arm/mach-shmobile/clock-r8a7790.c
index 5d71313..28eccd1 100644
--- a/arch/arm/mach-shmobile/clock-r8a7790.c
+++ b/arch/arm/mach-shmobile/clock-r8a7790.c
@@ -49,6 +49,7 @@
 
 #define SMSTPCR2 0xe6150138
 #define SMSTPCR3 0xe615013c
+#define SMSTPCR5 0xe6150144
 #define SMSTPCR7 0xe615014c
 
 #define MODEMR		0xE6160060
@@ -182,6 +183,7 @@ static struct clk div6_clks[DIV6_NR] = {
 enum {
 	MSTP721, MSTP720,
 	MSTP717, MSTP716,
+	MSTP522,
 	MSTP315, MSTP314, MSTP313, MSTP312, MSTP311, MSTP305, MSTP304,
 	MSTP216, MSTP207, MSTP206, MSTP204, MSTP203, MSTP202,
 	MSTP_NR
@@ -203,6 +205,7 @@ static struct clk mstp_clks[MSTP_NR] = {
 	[MSTP204] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 4, 0), /* SCIFA0 */
 	[MSTP203] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 3, 0), /* SCIFA1 */
 	[MSTP202] = SH_CLK_MSTP32(&mp_clk, SMSTPCR2, 2, 0), /* SCIFA2 */
+	[MSTP522] = SH_CLK_MSTP32(&extal_clk, SMSTPCR5, 22, 0), /* Thermal */
 	[MSTP717] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 17, 0), /* HSCIF0 */
 	[MSTP716] = SH_CLK_MSTP32(&zs_clk, SMSTPCR7, 16, 0), /* HSCIF1 */
 };
@@ -254,6 +257,7 @@ static struct clk_lookup lookups[] = {
 	CLKDEV_DEV_ID("sh-sci.7", &mstp_clks[MSTP720]),
 	CLKDEV_DEV_ID("sh-sci.8", &mstp_clks[MSTP717]),
 	CLKDEV_DEV_ID("sh-sci.9", &mstp_clks[MSTP716]),
+	CLKDEV_DEV_ID("rcar_thermal", &mstp_clks[MSTP522]),
 	CLKDEV_DEV_ID("ee200000.mmcif", &mstp_clks[MSTP315]),
 	CLKDEV_DEV_ID("sh_mmcif.0", &mstp_clks[MSTP315]),
 	CLKDEV_DEV_ID("ee100000.sdhi", &mstp_clks[MSTP314]),
-- 
1.8.2.1

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

* [PATCH v2 2/2] ARM: shmobile: r8a73a4: add clocks for thermal
  2013-06-26  8:40 ` [PATCH v2 2/2] ARM: shmobile: r8a73a4: add clocks for thermal Simon Horman
@ 2013-06-26 12:31   ` Sergei Shtylyov
  2013-06-27  4:57     ` Simon Horman
  0 siblings, 1 reply; 5+ messages in thread
From: Sergei Shtylyov @ 2013-06-26 12:31 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 26-06-2013 12:40, Simon Horman wrote:

     s/73a4/7790/ in the subject.

> Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

WBR, Sergei

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

* [PATCH v2 2/2] ARM: shmobile: r8a73a4: add clocks for thermal
  2013-06-26 12:31   ` Sergei Shtylyov
@ 2013-06-27  4:57     ` Simon Horman
  0 siblings, 0 replies; 5+ messages in thread
From: Simon Horman @ 2013-06-27  4:57 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jun 26, 2013 at 04:31:09PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 26-06-2013 12:40, Simon Horman wrote:
> 
>     s/73a4/7790/ in the subject.

Thanks, I have fixed that and reposted.

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

end of thread, other threads:[~2013-06-27  4:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-26  8:40 [PATCH v2 0/2] ARM: shmobile: r8a7790: add thermal driver support Simon Horman
2013-06-26  8:40 ` [PATCH v2 1/2] " Simon Horman
2013-06-26  8:40 ` [PATCH v2 2/2] ARM: shmobile: r8a73a4: add clocks for thermal Simon Horman
2013-06-26 12:31   ` Sergei Shtylyov
2013-06-27  4:57     ` Simon Horman

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