summaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile
diff options
context:
space:
mode:
authorMagnus Damm2013-10-08 05:39:59 +0200
committerSimon Horman2013-12-10 09:24:19 +0100
commit87a2934ecff1e054b5d2b7cb6dea2ee0eb649ff3 (patch)
treef2350f13de7075bf3dd207b2584cfbaca9f87186 /arch/arm/mach-shmobile
parentARM: shmobile: Enable PFC/GPIO on the Koelsch board (diff)
downloadkernel-qcow2-linux-87a2934ecff1e054b5d2b7cb6dea2ee0eb649ff3.tar.gz
kernel-qcow2-linux-87a2934ecff1e054b5d2b7cb6dea2ee0eb649ff3.tar.xz
kernel-qcow2-linux-87a2934ecff1e054b5d2b7cb6dea2ee0eb649ff3.zip
ARM: shmobile: Add Koelsch LED6, LED7 and LED8 support
Enable Koelsch LEDs for GPIO output testing purpose. Signed-off-by: Magnus Damm <damm@opensource.se> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
Diffstat (limited to 'arch/arm/mach-shmobile')
-rw-r--r--arch/arm/mach-shmobile/board-koelsch.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-koelsch.c b/arch/arm/mach-shmobile/board-koelsch.c
index d099eaf49cf6..2299d658a843 100644
--- a/arch/arm/mach-shmobile/board-koelsch.c
+++ b/arch/arm/mach-shmobile/board-koelsch.c
@@ -20,6 +20,8 @@
*/
#include <linux/kernel.h>
+#include <linux/leds.h>
+#include <linux/platform_data/gpio-rcar.h>
#include <linux/platform_device.h>
#include <mach/common.h>
#include <mach/r8a7791.h>
@@ -27,11 +29,36 @@
#include <asm/mach-types.h>
#include <asm/mach/arch.h>
+/* LEDS */
+static struct gpio_led koelsch_leds[] = {
+ {
+ .name = "led8",
+ .gpio = RCAR_GP_PIN(2, 21),
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ }, {
+ .name = "led7",
+ .gpio = RCAR_GP_PIN(2, 20),
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ }, {
+ .name = "led6",
+ .gpio = RCAR_GP_PIN(2, 19),
+ .default_state = LEDS_GPIO_DEFSTATE_ON,
+ },
+};
+
+static const struct gpio_led_platform_data koelsch_leds_pdata __initconst = {
+ .leds = koelsch_leds,
+ .num_leds = ARRAY_SIZE(koelsch_leds),
+};
+
static void __init koelsch_add_standard_devices(void)
{
r8a7791_clock_init();
r8a7791_pinmux_init();
r8a7791_add_standard_devices();
+ platform_device_register_data(&platform_bus, "leds-gpio", -1,
+ &koelsch_leds_pdata,
+ sizeof(koelsch_leds_pdata));
}
static const char * const koelsch_boards_compat_dt[] __initconst = {