Skip to contentSkip to conversation

ARM: shmobile: Armadillo800EVA-reference: Remove usage of shmobile_timer

PATCH In review Bastian Hecht 3 participants 4 messages Feb 28, 2013 – Apr 28, 2014

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 ARM: shmobile: Armadillo800EVA-reference: Remove usage of shmobile_timer

The struct sys_timer is gone since the patch "ARM: delete struct sys_timer". Since then we can't use shmobile_timer any longer. Setting .init_time directly to eva_earlytimer_init fixes the resulting compile error and makes the code shorter as well.

---
v2: same. Just integrated into a 2 pieces patchset.

 .../board-armadillo800eva-reference.c              |   15 +++------------
 1 file changed, 3 insertions(+), 12 deletions(-)
arch/arm/mach-shmobile/board-armadillo800eva-reference.c +3 -12
index 623754d..6991fb1 100644
@@ -210,23 +210,14 @@ static void __init eva_init(void)
 #endif
 }
 
-static void __init eva_earlytimer_init(void)
+static void __init eva_timer_init(void)
 {
 	r8a7740_clock_init(MD_CK0 | MD_CK2);
-	shmobile_earlytimer_init();
 
 	/* the rate of extal1 clock must be set before late_time_init */
 	eva_clock_init();
 }
 
-static void __init eva_add_early_devices(void)
-{
-	r8a7740_add_early_devices_dt();
-
-	/* override timer setup with board-specific code */
-	shmobile_timer.init = eva_earlytimer_init;
-}
-
 #define RESCNT2 IOMEM(0xe6188020)
 static void eva_restart(char mode, const char *cmd)
 {
@@ -241,13 +232,13 @@ static const char *eva_boards_compat_dt[] __initdata = {
 
 DT_MACHINE_START(ARMADILLO800EVA_DT, "armadillo800eva-reference")
 	.map_io		= r8a7740_map_io,
-	.init_early	= eva_add_early_devices,
+	.init_early	= r8a7740_add_early_devices_dt,
 	.init_irq	= r8a7740_init_irq_of,
 	.nr_irqs	= NR_IRQS_LEGACY,
 	.handle_irq	= shmobile_handle_irq_intc,
 	.init_machine	= eva_init,
 	.init_late	= shmobile_init_late,
-	.init_time	= shmobile_timer_init,
+	.init_time	= eva_timer_init,
 	.dt_compat	= eva_boards_compat_dt,
 	.restart	= eva_restart,
 MACHINE_END
Signature · 1 line
1.7.9.5
#1 lore raw
Quoted 4 lines · Bastian Hecht

The struct sys_timer is gone since the patch "ARM: delete struct sys_timer". Since then we can't use shmobile_timer any longer. Setting .init_time directly to eva_earlytimer_init fixes the resulting compile error and makes the code shorter as well.

Thanks. I have added this to the topic/intc-of intc branch.

The reason that I have added this it and the other Armadillo800EVA-reference patches there is that I believe that they depend on the INTC DT bindings which currently live in that topic branch.

If there is a way to remove that dependency please let me know.

#2 lore raw

PATCH v2 1/2 ARM: shmobile: armadillo800eva: Add LED support

In reply to Bastian Hecht

Cfr. r8a7740-armadillo800eva-reference.dts

---
v2:
- No changes

 arch/arm/mach-shmobile/board-armadillo800eva.c |   35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +35 -0
index 276d713f0ee9..688a69c7e5fc 100644
@@ -586,6 +586,40 @@ static struct platform_device hdmi_lcdc_device = {
 	},
 };
 
+/* LEDS */
+static struct gpio_led gpio_leds[] = {
+	{
+		.name		= "led1",
+		.gpio		= 102,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led2",
+		.gpio		= 111,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led3",
+		.gpio		= 110,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led4",
+		.gpio		= 177,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	},
+};
+
+static struct gpio_led_platform_data leds_gpio_info = {
+	.leds		= gpio_leds,
+	.num_leds	= ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio_device = {
+	.name   = "leds-gpio",
+	.id     = -1,
+	.dev    = {
+		.platform_data  = &leds_gpio_info,
+	},
+};
+
 /* GPIO KEY */
 #define GPIO_KEY(c, g, d, ...) \
 	{ .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ }
@@ -1077,6 +1111,7 @@ static struct platform_device *eva_devices[] __initdata = {
 	&lcdc0_device,
 	&pwm_device,
 	&pwm_backlight_device,
+	&leds_gpio_device,
 	&gpio_keys_device,
 	&sh_eth_device,
 	&vcc_sdhi0,
Signature · 1 line
1.7.9.5
#3 lore raw

Re: [PATCH v2 1/2] ARM: shmobile: armadillo800eva: Add LED support

In reply to Bastian Hecht

At this point I am not planning to merge this as it adds new platform device code and the arm-soc people have asked for restraint in that area.

Quoted 66 lines · Geert Uytterhoeven

Cfr. r8a7740-armadillo800eva-reference.dts

---
v2:
- No changes

 arch/arm/mach-shmobile/board-armadillo800eva.c |   35 ++++++++++++++++++++++++
 1 file changed, 35 insertions(+)
arch/arm/mach-shmobile/board-armadillo800eva.c +35 -0
index 276d713f0ee9..688a69c7e5fc 100644
@@ -586,6 +586,40 @@ static struct platform_device hdmi_lcdc_device = {
 	},
 };
 
+/* LEDS */
+static struct gpio_led gpio_leds[] = {
+	{
+		.name		= "led1",
+		.gpio		= 102,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led2",
+		.gpio		= 111,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led3",
+		.gpio		= 110,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led4",
+		.gpio		= 177,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	},
+};
+
+static struct gpio_led_platform_data leds_gpio_info = {
+	.leds		= gpio_leds,
+	.num_leds	= ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio_device = {
+	.name   = "leds-gpio",
+	.id     = -1,
+	.dev    = {
+		.platform_data  = &leds_gpio_info,
+	},
+};
+
 /* GPIO KEY */
 #define GPIO_KEY(c, g, d, ...) \
 	{ .code = c, .gpio = g, .desc = d, .active_low = 1, __VA_ARGS__ }
@@ -1077,6 +1111,7 @@ static struct platform_device *eva_devices[] __initdata = {
 	&lcdc0_device,
 	&pwm_device,
 	&pwm_backlight_device,
+	&leds_gpio_device,
 	&gpio_keys_device,
 	&sh_eth_device,
 	&vcc_sdhi0,
Signature · 1 line
1.7.9.5