diff options
author | Simon Horman <horms+renesas@verge.net.au> | 2013-04-22 22:37:05 -0400 |
---|---|---|
committer | Simon Horman <horms+renesas@verge.net.au> | 2013-06-07 01:26:31 -0400 |
commit | 1034f4ee3f07b7d525c490d702b3dcbee3b56b54 (patch) | |
tree | 7d4f6ff899eb5b01d398e29f917ba2b695e8fc21 | |
parent | 741440e868f5f08f747292097620ebad43cc5ef0 (diff) |
ARM: shmobile: lager: Add GPIO LEDs
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>
-rw-r--r-- | arch/arm/mach-shmobile/board-lager.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index 6114edd0a977..6a1ba38fae26 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c | |||
@@ -21,13 +21,37 @@ | |||
21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
22 | #include <linux/irqchip.h> | 22 | #include <linux/irqchip.h> |
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/leds.h> | ||
24 | #include <linux/pinctrl/machine.h> | 25 | #include <linux/pinctrl/machine.h> |
26 | #include <linux/platform_data/gpio-rcar.h> | ||
25 | #include <linux/platform_device.h> | 27 | #include <linux/platform_device.h> |
26 | #include <mach/common.h> | 28 | #include <mach/common.h> |
27 | #include <mach/r8a7790.h> | 29 | #include <mach/r8a7790.h> |
28 | #include <asm/mach-types.h> | 30 | #include <asm/mach-types.h> |
29 | #include <asm/mach/arch.h> | 31 | #include <asm/mach/arch.h> |
30 | 32 | ||
33 | /* LEDS */ | ||
34 | static struct gpio_led lager_leds[] = { | ||
35 | { | ||
36 | .name = "led8", | ||
37 | .gpio = RCAR_GP_PIN(5, 17), | ||
38 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
39 | }, { | ||
40 | .name = "led7", | ||
41 | .gpio = RCAR_GP_PIN(4, 23), | ||
42 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
43 | }, { | ||
44 | .name = "led6", | ||
45 | .gpio = RCAR_GP_PIN(4, 22), | ||
46 | .default_state = LEDS_GPIO_DEFSTATE_ON, | ||
47 | }, | ||
48 | }; | ||
49 | |||
50 | static struct gpio_led_platform_data lager_leds_pdata = { | ||
51 | .leds = lager_leds, | ||
52 | .num_leds = ARRAY_SIZE(lager_leds), | ||
53 | }; | ||
54 | |||
31 | static const struct pinctrl_map lager_pinctrl_map[] = { | 55 | static const struct pinctrl_map lager_pinctrl_map[] = { |
32 | /* SCIF0 (CN19: DEBUG SERIAL0) */ | 56 | /* SCIF0 (CN19: DEBUG SERIAL0) */ |
33 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790", | 57 | PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790", |
@@ -46,6 +70,9 @@ static void __init lager_add_standard_devices(void) | |||
46 | r8a7790_pinmux_init(); | 70 | r8a7790_pinmux_init(); |
47 | 71 | ||
48 | r8a7790_add_standard_devices(); | 72 | r8a7790_add_standard_devices(); |
73 | platform_device_register_data(&platform_bus, "leds-gpio", -1, | ||
74 | &lager_leds_pdata, | ||
75 | sizeof(lager_leds_pdata)); | ||
49 | } | 76 | } |
50 | 77 | ||
51 | static const char *lager_boards_compat_dt[] __initdata = { | 78 | static const char *lager_boards_compat_dt[] __initdata = { |