linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
@ 2013-04-22  3:06 Simon Horman
  2013-04-22 10:00 ` Laurent Pinchart
  2013-04-22 12:27 ` Sergei Shtylyov
  0 siblings, 2 replies; 10+ messages in thread
From: Simon Horman @ 2013-04-22  3:06 UTC (permalink / raw)
  To: linux-arm-kernel

The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
support them.

Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
---
 arch/arm/mach-shmobile/board-lager.c | 37 ++++++++++++++++++++++++++++++++++++
 1 file changed, 37 insertions(+)

Tested on lager board.
Based on the tag renesas-next-20130419 of my renesas tree.

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 6114edd..a8aa04f 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -21,13 +21,49 @@
 #include <linux/interrupt.h>
 #include <linux/irqchip.h>
 #include <linux/kernel.h>
+#include <linux/leds.h>
 #include <linux/pinctrl/machine.h>
+#include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_device.h>
 #include <mach/common.h>
 #include <mach/r8a7790.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+/* LEDS */
+static struct gpio_led lager_leds[] = {
+	{
+		.name		= "led8",
+		.gpio		= RCAR_GP_PIN(5, 17),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led7",
+		.gpio		= RCAR_GP_PIN(4, 23),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led6",
+		.gpio		= RCAR_GP_PIN(4, 22),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	},
+};
+
+static struct gpio_led_platform_data lager_leds_pdata = {
+	.leds		= lager_leds,
+	.num_leds	= ARRAY_SIZE(lager_leds),
+};
+
+static struct platform_device leds_device = {
+	.name	= "leds-gpio",
+	.id	= 0,
+	.dev	= {
+		.platform_data  = &lager_leds_pdata,
+	},
+};
+
+static struct platform_device *lager_devices[] __initdata = {
+	&leds_device,
+};
+
 static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF0 (CN19: DEBUG SERIAL0) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
@@ -46,6 +82,7 @@ static void __init lager_add_standard_devices(void)
 	r8a7790_pinmux_init();
 
 	r8a7790_add_standard_devices();
+	platform_add_devices(lager_devices, ARRAY_SIZE(lager_devices));
 }
 
 static const char *lager_boards_compat_dt[] __initdata = {
-- 
1.8.2.1

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
  2013-04-22  3:06 [PATCH] ARM: shmobile: lager: Add GPIO LEDs Simon Horman
@ 2013-04-22 10:00 ` Laurent Pinchart
  2013-04-23  1:15   ` Simon Horman
  2013-04-22 12:27 ` Sergei Shtylyov
  1 sibling, 1 reply; 10+ messages in thread
From: Laurent Pinchart @ 2013-04-22 10:00 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

Thank you for the patch.

On Monday 22 April 2013 12:06:30 Simon Horman wrote:
> The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
> support them.
> 
> Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>  arch/arm/mach-shmobile/board-lager.c | 37 +++++++++++++++++++++++++++++++++
>  1 file changed, 37 insertions(+)
> 
> Tested on lager board.
> Based on the tag renesas-next-20130419 of my renesas tree.
> 
> diff --git a/arch/arm/mach-shmobile/board-lager.c
> b/arch/arm/mach-shmobile/board-lager.c index 6114edd..a8aa04f 100644
> --- a/arch/arm/mach-shmobile/board-lager.c
> +++ b/arch/arm/mach-shmobile/board-lager.c
> @@ -21,13 +21,49 @@
>  #include <linux/interrupt.h>
>  #include <linux/irqchip.h>
>  #include <linux/kernel.h>
> +#include <linux/leds.h>
>  #include <linux/pinctrl/machine.h>
> +#include <linux/platform_data/gpio-rcar.h>
>  #include <linux/platform_device.h>
>  #include <mach/common.h>
>  #include <mach/r8a7790.h>
>  #include <asm/mach-types.h>
>  #include <asm/mach/arch.h>
> 
> +/* LEDS */
> +static struct gpio_led lager_leds[] = {
> +	{
> +		.name		= "led8",
> +		.gpio		= RCAR_GP_PIN(5, 17),
> +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> +	}, {
> +		.name		= "led7",
> +		.gpio		= RCAR_GP_PIN(4, 23),
> +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> +	}, {
> +		.name		= "led6",
> +		.gpio		= RCAR_GP_PIN(4, 22),
> +		.default_state	= LEDS_GPIO_DEFSTATE_ON,

Just out of curiosity, why is the default state on ?

> +	},
> +};
> +
> +static struct gpio_led_platform_data lager_leds_pdata = {
> +	.leds		= lager_leds,
> +	.num_leds	= ARRAY_SIZE(lager_leds),
> +};
> +
> +static struct platform_device leds_device = {
> +	.name	= "leds-gpio",
> +	.id	= 0,

As there's a single leds-gpio device, maybe id = -1 ?

> +	.dev	= {
> +		.platform_data  = &lager_leds_pdata,
> +	},
> +};
> +
> +static struct platform_device *lager_devices[] __initdata = {
> +	&leds_device,
> +};
> +
>  static const struct pinctrl_map lager_pinctrl_map[] = {
>  	/* SCIF0 (CN19: DEBUG SERIAL0) */
>  	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
> @@ -46,6 +82,7 @@ static void __init lager_add_standard_devices(void)
>  	r8a7790_pinmux_init();
> 
>  	r8a7790_add_standard_devices();
> +	platform_add_devices(lager_devices, ARRAY_SIZE(lager_devices));
>  }
> 
>  static const char *lager_boards_compat_dt[] __initdata = {

-- 
Regards,

Laurent Pinchart

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
  2013-04-22  3:06 [PATCH] ARM: shmobile: lager: Add GPIO LEDs Simon Horman
  2013-04-22 10:00 ` Laurent Pinchart
@ 2013-04-22 12:27 ` Sergei Shtylyov
  2013-04-23  1:17   ` Simon Horman
  1 sibling, 1 reply; 10+ messages in thread
From: Sergei Shtylyov @ 2013-04-22 12:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hello.

On 22-04-2013 7:06, Simon Horman wrote:

> The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
> support them.

> Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.

> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
>   arch/arm/mach-shmobile/board-lager.c | 37 ++++++++++++++++++++++++++++++++++++
>   1 file changed, 37 insertions(+)

> Tested on lager board.
> Based on the tag renesas-next-20130419 of my renesas tree.

> diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> index 6114edd..a8aa04f 100644
> --- a/arch/arm/mach-shmobile/board-lager.c
> +++ b/arch/arm/mach-shmobile/board-lager.c
[...]
> @@ -46,6 +82,7 @@ static void __init lager_add_standard_devices(void)
>   	r8a7790_pinmux_init();
>
>   	r8a7790_add_standard_devices();
> +	platform_add_devices(lager_devices, ARRAY_SIZE(lager_devices));

    I thought we shouldn't use platform_add_devices() anymore, being close 
relative to platform_device_register()?

WBR, Sergei

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
  2013-04-22 10:00 ` Laurent Pinchart
@ 2013-04-23  1:15   ` Simon Horman
  2013-04-23 10:48     ` Laurent Pinchart
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Horman @ 2013-04-23  1:15 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 22, 2013 at 12:00:02PM +0200, Laurent Pinchart wrote:
> Hi Simon,
> 
> Thank you for the patch.
> 
> On Monday 22 April 2013 12:06:30 Simon Horman wrote:
> > The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
> > support them.
> > 
> > Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.
> > 
> > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > ---
> >  arch/arm/mach-shmobile/board-lager.c | 37 +++++++++++++++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> > 
> > Tested on lager board.
> > Based on the tag renesas-next-20130419 of my renesas tree.
> > 
> > diff --git a/arch/arm/mach-shmobile/board-lager.c
> > b/arch/arm/mach-shmobile/board-lager.c index 6114edd..a8aa04f 100644
> > --- a/arch/arm/mach-shmobile/board-lager.c
> > +++ b/arch/arm/mach-shmobile/board-lager.c
> > @@ -21,13 +21,49 @@
> >  #include <linux/interrupt.h>
> >  #include <linux/irqchip.h>
> >  #include <linux/kernel.h>
> > +#include <linux/leds.h>
> >  #include <linux/pinctrl/machine.h>
> > +#include <linux/platform_data/gpio-rcar.h>
> >  #include <linux/platform_device.h>
> >  #include <mach/common.h>
> >  #include <mach/r8a7790.h>
> >  #include <asm/mach-types.h>
> >  #include <asm/mach/arch.h>
> > 
> > +/* LEDS */
> > +static struct gpio_led lager_leds[] = {
> > +	{
> > +		.name		= "led8",
> > +		.gpio		= RCAR_GP_PIN(5, 17),
> > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> > +	}, {
> > +		.name		= "led7",
> > +		.gpio		= RCAR_GP_PIN(4, 23),
> > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> > +	}, {
> > +		.name		= "led6",
> > +		.gpio		= RCAR_GP_PIN(4, 22),
> > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> 
> Just out of curiosity, why is the default state on ?

Only because thats what the marzen code does.
Would off be a better choice?

> 
> > +	},
> > +};
> > +
> > +static struct gpio_led_platform_data lager_leds_pdata = {
> > +	.leds		= lager_leds,
> > +	.num_leds	= ARRAY_SIZE(lager_leds),
> > +};
> > +
> > +static struct platform_device leds_device = {
> > +	.name	= "leds-gpio",
> > +	.id	= 0,
> 
> As there's a single leds-gpio device, maybe id = -1 ?

Yes, true. I'll fix that.
I think the marzen code should probably be fixed too.

> > +	.dev	= {
> > +		.platform_data  = &lager_leds_pdata,
> > +	},
> > +};
> > +
> > +static struct platform_device *lager_devices[] __initdata = {
> > +	&leds_device,
> > +};
> > +
> >  static const struct pinctrl_map lager_pinctrl_map[] = {
> >  	/* SCIF0 (CN19: DEBUG SERIAL0) */
> >  	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
> > @@ -46,6 +82,7 @@ static void __init lager_add_standard_devices(void)
> >  	r8a7790_pinmux_init();
> > 
> >  	r8a7790_add_standard_devices();
> > +	platform_add_devices(lager_devices, ARRAY_SIZE(lager_devices));
> >  }
> > 
> >  static const char *lager_boards_compat_dt[] __initdata = {
> 
> -- 
> Regards,
> 
> Laurent Pinchart
> 

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
  2013-04-22 12:27 ` Sergei Shtylyov
@ 2013-04-23  1:17   ` Simon Horman
  2013-04-23  2:36     ` Simon Horman
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Horman @ 2013-04-23  1:17 UTC (permalink / raw)
  To: linux-arm-kernel

On Mon, Apr 22, 2013 at 04:27:06PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 22-04-2013 7:06, Simon Horman wrote:
> 
> >The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
> >support them.
> 
> >Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.
> 
> >Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> >---
> >  arch/arm/mach-shmobile/board-lager.c | 37 ++++++++++++++++++++++++++++++++++++
> >  1 file changed, 37 insertions(+)
> 
> >Tested on lager board.
> >Based on the tag renesas-next-20130419 of my renesas tree.
> 
> >diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> >index 6114edd..a8aa04f 100644
> >--- a/arch/arm/mach-shmobile/board-lager.c
> >+++ b/arch/arm/mach-shmobile/board-lager.c
> [...]
> >@@ -46,6 +82,7 @@ static void __init lager_add_standard_devices(void)
> >  	r8a7790_pinmux_init();
> >
> >  	r8a7790_add_standard_devices();
> >+	platform_add_devices(lager_devices, ARRAY_SIZE(lager_devices));
> 
>    I thought we shouldn't use platform_add_devices() anymore, being
> close relative to platform_device_register()?

Thanks, as there is only one device I think this
can be changed to use platform_device_register_resndata().
I'll see about making it so.

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
  2013-04-23  1:17   ` Simon Horman
@ 2013-04-23  2:36     ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-04-23  2:36 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 23, 2013 at 10:17:52AM +0900, Simon Horman wrote:
> On Mon, Apr 22, 2013 at 04:27:06PM +0400, Sergei Shtylyov wrote:
> > Hello.
> > 
> > On 22-04-2013 7:06, Simon Horman wrote:
> > 
> > >The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
> > >support them.
> > 
> > >Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.
> > 
> > >Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > >Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > >---
> > >  arch/arm/mach-shmobile/board-lager.c | 37 ++++++++++++++++++++++++++++++++++++
> > >  1 file changed, 37 insertions(+)
> > 
> > >Tested on lager board.
> > >Based on the tag renesas-next-20130419 of my renesas tree.
> > 
> > >diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
> > >index 6114edd..a8aa04f 100644
> > >--- a/arch/arm/mach-shmobile/board-lager.c
> > >+++ b/arch/arm/mach-shmobile/board-lager.c
> > [...]
> > >@@ -46,6 +82,7 @@ static void __init lager_add_standard_devices(void)
> > >  	r8a7790_pinmux_init();
> > >
> > >  	r8a7790_add_standard_devices();
> > >+	platform_add_devices(lager_devices, ARRAY_SIZE(lager_devices));
> > 
> >    I thought we shouldn't use platform_add_devices() anymore, being
> > close relative to platform_device_register()?
> 
> Thanks, as there is only one device I think this
> can be changed to use platform_device_register_resndata().
> I'll see about making it so.

On closer examination platform_device_register_data() seems more
appropriate.

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
@ 2013-04-23  2:37 Simon Horman
  2013-04-30  2:10 ` Simon Horman
  0 siblings, 1 reply; 10+ messages in thread
From: Simon Horman @ 2013-04-23  2:37 UTC (permalink / raw)
  To: linux-arm-kernel

The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
support them.

Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.

Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

---

v2
* As suggested by Sergei Shtylyov:
  Use platform_device_register_data() instead of platform_add_devices()
* As suggested by Laurent Pinchart:
  Use -1 as device id as there is only one such device
---
 arch/arm/mach-shmobile/board-lager.c | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index 6114edd..6a1ba38 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -21,13 +21,37 @@
 #include <linux/interrupt.h>
 #include <linux/irqchip.h>
 #include <linux/kernel.h>
+#include <linux/leds.h>
 #include <linux/pinctrl/machine.h>
+#include <linux/platform_data/gpio-rcar.h>
 #include <linux/platform_device.h>
 #include <mach/common.h>
 #include <mach/r8a7790.h>
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 
+/* LEDS */
+static struct gpio_led lager_leds[] = {
+	{
+		.name		= "led8",
+		.gpio		= RCAR_GP_PIN(5, 17),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led7",
+		.gpio		= RCAR_GP_PIN(4, 23),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	}, {
+		.name		= "led6",
+		.gpio		= RCAR_GP_PIN(4, 22),
+		.default_state	= LEDS_GPIO_DEFSTATE_ON,
+	},
+};
+
+static struct gpio_led_platform_data lager_leds_pdata = {
+	.leds		= lager_leds,
+	.num_leds	= ARRAY_SIZE(lager_leds),
+};
+
 static const struct pinctrl_map lager_pinctrl_map[] = {
 	/* SCIF0 (CN19: DEBUG SERIAL0) */
 	PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
@@ -46,6 +70,9 @@ static void __init lager_add_standard_devices(void)
 	r8a7790_pinmux_init();
 
 	r8a7790_add_standard_devices();
+	platform_device_register_data(&platform_bus, "leds-gpio", -1,
+				      &lager_leds_pdata,
+				      sizeof(lager_leds_pdata));
 }
 
 static const char *lager_boards_compat_dt[] __initdata = {
-- 
1.8.2.1

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
  2013-04-23  1:15   ` Simon Horman
@ 2013-04-23 10:48     ` Laurent Pinchart
  2013-04-26  2:23       ` Simon Horman
  0 siblings, 1 reply; 10+ messages in thread
From: Laurent Pinchart @ 2013-04-23 10:48 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Simon,

On Tuesday 23 April 2013 10:15:25 Simon Horman wrote:
> On Mon, Apr 22, 2013 at 12:00:02PM +0200, Laurent Pinchart wrote:
> > Hi Simon,
> > 
> > Thank you for the patch.
> > 
> > On Monday 22 April 2013 12:06:30 Simon Horman wrote:
> > > The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
> > > support them.
> > > 
> > > Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.
> > > 
> > > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > > ---
> > > 
> > >  arch/arm/mach-shmobile/board-lager.c | 37 +++++++++++++++++++++++++++++
> > >  1 file changed, 37 insertions(+)
> > > 
> > > Tested on lager board.
> > > Based on the tag renesas-next-20130419 of my renesas tree.
> > > 
> > > diff --git a/arch/arm/mach-shmobile/board-lager.c
> > > b/arch/arm/mach-shmobile/board-lager.c index 6114edd..a8aa04f 100644
> > > --- a/arch/arm/mach-shmobile/board-lager.c
> > > +++ b/arch/arm/mach-shmobile/board-lager.c
> > > @@ -21,13 +21,49 @@
> > >  #include <linux/interrupt.h>
> > >  #include <linux/irqchip.h>
> > >  #include <linux/kernel.h>
> > > +#include <linux/leds.h>
> > >  #include <linux/pinctrl/machine.h>
> > > +#include <linux/platform_data/gpio-rcar.h>
> > >  #include <linux/platform_device.h>
> > >  #include <mach/common.h>
> > >  #include <mach/r8a7790.h>
> > >  #include <asm/mach-types.h>
> > >  #include <asm/mach/arch.h>
> > > 
> > > +/* LEDS */
> > > +static struct gpio_led lager_leds[] = {
> > > +	{
> > > +		.name		= "led8",
> > > +		.gpio		= RCAR_GP_PIN(5, 17),
> > > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> > > +	}, {
> > > +		.name		= "led7",
> > > +		.gpio		= RCAR_GP_PIN(4, 23),
> > > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> > > +	}, {
> > > +		.name		= "led6",
> > > +		.gpio		= RCAR_GP_PIN(4, 22),
> > > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> > 
> > Just out of curiosity, why is the default state on ?
> 
> Only because thats what the marzen code does.
> Would off be a better choice?

It would save a little bit of power by default :-)

> > > +	},
> > > +};

-- 
Regards,

Laurent Pinchart

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
  2013-04-23 10:48     ` Laurent Pinchart
@ 2013-04-26  2:23       ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-04-26  2:23 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 23, 2013 at 12:48:03PM +0200, Laurent Pinchart wrote:
> Hi Simon,
> 
> On Tuesday 23 April 2013 10:15:25 Simon Horman wrote:
> > On Mon, Apr 22, 2013 at 12:00:02PM +0200, Laurent Pinchart wrote:
> > > Hi Simon,
> > > 
> > > Thank you for the patch.
> > > 
> > > On Monday 22 April 2013 12:06:30 Simon Horman wrote:
> > > > The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
> > > > support them.
> > > > 
> > > > Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.
> > > > 
> > > > Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> > > > Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> > > > ---
> > > > 
> > > >  arch/arm/mach-shmobile/board-lager.c | 37 +++++++++++++++++++++++++++++
> > > >  1 file changed, 37 insertions(+)
> > > > 
> > > > Tested on lager board.
> > > > Based on the tag renesas-next-20130419 of my renesas tree.
> > > > 
> > > > diff --git a/arch/arm/mach-shmobile/board-lager.c
> > > > b/arch/arm/mach-shmobile/board-lager.c index 6114edd..a8aa04f 100644
> > > > --- a/arch/arm/mach-shmobile/board-lager.c
> > > > +++ b/arch/arm/mach-shmobile/board-lager.c
> > > > @@ -21,13 +21,49 @@
> > > >  #include <linux/interrupt.h>
> > > >  #include <linux/irqchip.h>
> > > >  #include <linux/kernel.h>
> > > > +#include <linux/leds.h>
> > > >  #include <linux/pinctrl/machine.h>
> > > > +#include <linux/platform_data/gpio-rcar.h>
> > > >  #include <linux/platform_device.h>
> > > >  #include <mach/common.h>
> > > >  #include <mach/r8a7790.h>
> > > >  #include <asm/mach-types.h>
> > > >  #include <asm/mach/arch.h>
> > > > 
> > > > +/* LEDS */
> > > > +static struct gpio_led lager_leds[] = {
> > > > +	{
> > > > +		.name		= "led8",
> > > > +		.gpio		= RCAR_GP_PIN(5, 17),
> > > > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> > > > +	}, {
> > > > +		.name		= "led7",
> > > > +		.gpio		= RCAR_GP_PIN(4, 23),
> > > > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> > > > +	}, {
> > > > +		.name		= "led6",
> > > > +		.gpio		= RCAR_GP_PIN(4, 22),
> > > > +		.default_state	= LEDS_GPIO_DEFSTATE_ON,
> > > 
> > > Just out of curiosity, why is the default state on ?
> > 
> > Only because thats what the marzen code does.
> > Would off be a better choice?
> 
> It would save a little bit of power by default :-)

:^)

I think that I would rather leave it _ON for consistency with
other shmobile board code.

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

* [PATCH] ARM: shmobile: lager: Add GPIO LEDs
  2013-04-23  2:37 Simon Horman
@ 2013-04-30  2:10 ` Simon Horman
  0 siblings, 0 replies; 10+ messages in thread
From: Simon Horman @ 2013-04-30  2:10 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 23, 2013 at 11:37:05AM +0900, Simon Horman wrote:
> The board has 3 LEDs connected to GPIOs. Add a led-gpio device to
> support them.
> 
> Based on "ARM: shmobile: marzen: Add GPIO LEDs" by Laurent Pinchart.
> 
> Cc: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> 
> ---
> 
> v2
> * As suggested by Sergei Shtylyov:
>   Use platform_device_register_data() instead of platform_add_devices()
> * As suggested by Laurent Pinchart:
>   Use -1 as device id as there is only one such device
> ---
>  arch/arm/mach-shmobile/board-lager.c | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)

I have queued-up this patch for v3.11 in the boards-lager branch.

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

end of thread, other threads:[~2013-04-30  2:10 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-04-22  3:06 [PATCH] ARM: shmobile: lager: Add GPIO LEDs Simon Horman
2013-04-22 10:00 ` Laurent Pinchart
2013-04-23  1:15   ` Simon Horman
2013-04-23 10:48     ` Laurent Pinchart
2013-04-26  2:23       ` Simon Horman
2013-04-22 12:27 ` Sergei Shtylyov
2013-04-23  1:17   ` Simon Horman
2013-04-23  2:36     ` Simon Horman
  -- strict thread matches above, loose matches on Subject: below --
2013-04-23  2:37 Simon Horman
2013-04-30  2:10 ` 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).