linux-sh.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: shmobile: kzm9g legacy: Add LED support
@ 2014-11-06 12:50 Geert Uytterhoeven
  2014-11-07  4:14 ` Simon Horman
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-11-06 12:50 UTC (permalink / raw)
  To: linux-sh

Add support for the 4 GPIO-controlled LEDs on the kzm9g development
board.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
 arch/arm/mach-shmobile/board-kzm9g.c | 39 ++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
index 7c9b63bdde9fa458..e9d7dd65fd76ae18 100644
--- a/arch/arm/mach-shmobile/board-kzm9g.c
+++ b/arch/arm/mach-shmobile/board-kzm9g.c
@@ -528,6 +528,44 @@ static struct platform_device sdhi2_device = {
 	},
 };
 
+/* LEDS */
+static struct gpio_led gpio_leds[] = {
+	{
+		.name		= "LED1",
+		.gpio		= 20,
+		.active_low	= 1,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "LED2",
+		.gpio		= 21,
+		.active_low	= 1,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "LED3",
+		.gpio		= 22,
+		.active_low	= 1,
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "LED4",
+		.gpio		= 23,
+		.active_low	= 1,
+		.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,
+	},
+};
+
 /* KEY */
 #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
 
@@ -793,6 +831,7 @@ static struct platform_device *kzm_devices[] __initdata = {
 	&vcc_sdhi2,
 	&sdhi0_device,
 	&sdhi2_device,
+	&leds_gpio_device,
 	&gpio_keys_device,
 	&fsi_device,
 	&fsi_ak4648_device,
-- 
1.9.1


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

* Re: [PATCH] ARM: shmobile: kzm9g legacy: Add LED support
  2014-11-06 12:50 [PATCH] ARM: shmobile: kzm9g legacy: Add LED support Geert Uytterhoeven
@ 2014-11-07  4:14 ` Simon Horman
  2014-11-10  9:54 ` Geert Uytterhoeven
  2014-11-11  0:18 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2014-11-07  4:14 UTC (permalink / raw)
  To: linux-sh

Hi Geert,

I'm not sure of the motivation for this but in general I'm not
accepting nay new platform device code for shmobile.

On Thu, Nov 06, 2014 at 01:50:55PM +0100, Geert Uytterhoeven wrote:
> Add support for the 4 GPIO-controlled LEDs on the kzm9g development
> board.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
>  arch/arm/mach-shmobile/board-kzm9g.c | 39 ++++++++++++++++++++++++++++++++++++
>  1 file changed, 39 insertions(+)
> 
> diff --git a/arch/arm/mach-shmobile/board-kzm9g.c b/arch/arm/mach-shmobile/board-kzm9g.c
> index 7c9b63bdde9fa458..e9d7dd65fd76ae18 100644
> --- a/arch/arm/mach-shmobile/board-kzm9g.c
> +++ b/arch/arm/mach-shmobile/board-kzm9g.c
> @@ -528,6 +528,44 @@ static struct platform_device sdhi2_device = {
>  	},
>  };
>  
> +/* LEDS */
> +static struct gpio_led gpio_leds[] = {
> +	{
> +		.name		= "LED1",
> +		.gpio		= 20,
> +		.active_low	= 1,
> +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> +	}, {
> +		.name		= "LED2",
> +		.gpio		= 21,
> +		.active_low	= 1,
> +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> +	}, {
> +		.name		= "LED3",
> +		.gpio		= 22,
> +		.active_low	= 1,
> +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> +	}, {
> +		.name		= "LED4",
> +		.gpio		= 23,
> +		.active_low	= 1,
> +		.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,
> +	},
> +};
> +
>  /* KEY */
>  #define GPIO_KEY(c, g, d) { .code = c, .gpio = g, .desc = d, .active_low = 1 }
>  
> @@ -793,6 +831,7 @@ static struct platform_device *kzm_devices[] __initdata = {
>  	&vcc_sdhi2,
>  	&sdhi0_device,
>  	&sdhi2_device,
> +	&leds_gpio_device,
>  	&gpio_keys_device,
>  	&fsi_device,
>  	&fsi_ak4648_device,
> -- 
> 1.9.1
> 

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

* Re: [PATCH] ARM: shmobile: kzm9g legacy: Add LED support
  2014-11-06 12:50 [PATCH] ARM: shmobile: kzm9g legacy: Add LED support Geert Uytterhoeven
  2014-11-07  4:14 ` Simon Horman
@ 2014-11-10  9:54 ` Geert Uytterhoeven
  2014-11-11  0:18 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Geert Uytterhoeven @ 2014-11-10  9:54 UTC (permalink / raw)
  To: linux-sh

Hi Simon,

On Fri, Nov 7, 2014 at 5:14 AM, Simon Horman <horms@verge.net.au> wrote:
> I'm not sure of the motivation for this but in general I'm not

It allowed me to find a bug in core code ;-)

> accepting nay new platform device code for shmobile.

Fair enough.

Just drop any patches adding more legacy platform support.
People who're interested in them can still pick them up from the mailing list.

> On Thu, Nov 06, 2014 at 01:50:55PM +0100, Geert Uytterhoeven wrote:
>> Add support for the 4 GPIO-controlled LEDs on the kzm9g development
>> board.
>>
>> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> ---
>>  arch/arm/mach-shmobile/board-kzm9g.c | 39 ++++++++++++++++++++++++++++++++++++
>>  1 file changed, 39 insertions(+)

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

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

* Re: [PATCH] ARM: shmobile: kzm9g legacy: Add LED support
  2014-11-06 12:50 [PATCH] ARM: shmobile: kzm9g legacy: Add LED support Geert Uytterhoeven
  2014-11-07  4:14 ` Simon Horman
  2014-11-10  9:54 ` Geert Uytterhoeven
@ 2014-11-11  0:18 ` Simon Horman
  2 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2014-11-11  0:18 UTC (permalink / raw)
  To: linux-sh

On Mon, Nov 10, 2014 at 10:54:21AM +0100, Geert Uytterhoeven wrote:
> Hi Simon,
> 
> On Fri, Nov 7, 2014 at 5:14 AM, Simon Horman <horms@verge.net.au> wrote:
> > I'm not sure of the motivation for this but in general I'm not
> 
> It allowed me to find a bug in core code ;-)
> 
> > accepting nay new platform device code for shmobile.
> 
> Fair enough.
> 
> Just drop any patches adding more legacy platform support.

Sure, will do.

> People who're interested in them can still pick them up from the mailing list.

Agreed.

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

end of thread, other threads:[~2014-11-11  0:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-06 12:50 [PATCH] ARM: shmobile: kzm9g legacy: Add LED support Geert Uytterhoeven
2014-11-07  4:14 ` Simon Horman
2014-11-10  9:54 ` Geert Uytterhoeven
2014-11-11  0:18 ` 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).