aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-shmobile/board-lager.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-shmobile/board-lager.c')
-rw-r--r--arch/arm/mach-shmobile/board-lager.c64
1 files changed, 64 insertions, 0 deletions
diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c
index f587187a8603..d73e21d3ea8a 100644
--- a/arch/arm/mach-shmobile/board-lager.c
+++ b/arch/arm/mach-shmobile/board-lager.c
@@ -18,19 +18,83 @@
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */ 19 */
20 20
21#include <linux/gpio.h>
22#include <linux/gpio_keys.h>
23#include <linux/input.h>
21#include <linux/interrupt.h> 24#include <linux/interrupt.h>
22#include <linux/irqchip.h> 25#include <linux/irqchip.h>
23#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/leds.h>
28#include <linux/pinctrl/machine.h>
29#include <linux/platform_data/gpio-rcar.h>
24#include <linux/platform_device.h> 30#include <linux/platform_device.h>
25#include <mach/common.h> 31#include <mach/common.h>
26#include <mach/r8a7790.h> 32#include <mach/r8a7790.h>
27#include <asm/mach-types.h> 33#include <asm/mach-types.h>
28#include <asm/mach/arch.h> 34#include <asm/mach/arch.h>
29 35
36/* LEDS */
37static struct gpio_led lager_leds[] = {
38 {
39 .name = "led8",
40 .gpio = RCAR_GP_PIN(5, 17),
41 .default_state = LEDS_GPIO_DEFSTATE_ON,
42 }, {
43 .name = "led7",
44 .gpio = RCAR_GP_PIN(4, 23),
45 .default_state = LEDS_GPIO_DEFSTATE_ON,
46 }, {
47 .name = "led6",
48 .gpio = RCAR_GP_PIN(4, 22),
49 .default_state = LEDS_GPIO_DEFSTATE_ON,
50 },
51};
52
53static __initdata struct gpio_led_platform_data lager_leds_pdata = {
54 .leds = lager_leds,
55 .num_leds = ARRAY_SIZE(lager_leds),
56};
57
58/* GPIO KEY */
59#define GPIO_KEY(c, g, d, ...) \
60 { .code = c, .gpio = g, .desc = d, .active_low = 1 }
61
62static __initdata struct gpio_keys_button gpio_buttons[] = {
63 GPIO_KEY(KEY_4, RCAR_GP_PIN(1, 28), "SW2-pin4"),
64 GPIO_KEY(KEY_3, RCAR_GP_PIN(1, 26), "SW2-pin3"),
65 GPIO_KEY(KEY_2, RCAR_GP_PIN(1, 24), "SW2-pin2"),
66 GPIO_KEY(KEY_1, RCAR_GP_PIN(1, 14), "SW2-pin1"),
67};
68
69static __initdata struct gpio_keys_platform_data lager_keys_pdata = {
70 .buttons = gpio_buttons,
71 .nbuttons = ARRAY_SIZE(gpio_buttons),
72};
73
74static const struct pinctrl_map lager_pinctrl_map[] = {
75 /* SCIF0 (CN19: DEBUG SERIAL0) */
76 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790",
77 "scif0_data", "scif0"),
78 /* SCIF1 (CN20: DEBUG SERIAL1) */
79 PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.7", "pfc-r8a7790",
80 "scif1_data", "scif1"),
81};
82
30static void __init lager_add_standard_devices(void) 83static void __init lager_add_standard_devices(void)
31{ 84{
32 r8a7790_clock_init(); 85 r8a7790_clock_init();
86
87 pinctrl_register_mappings(lager_pinctrl_map,
88 ARRAY_SIZE(lager_pinctrl_map));
89 r8a7790_pinmux_init();
90
33 r8a7790_add_standard_devices(); 91 r8a7790_add_standard_devices();
92 platform_device_register_data(&platform_bus, "leds-gpio", -1,
93 &lager_leds_pdata,
94 sizeof(lager_leds_pdata));
95 platform_device_register_data(&platform_bus, "gpio-keys", -1,
96 &lager_keys_pdata,
97 sizeof(lager_keys_pdata));
34} 98}
35 99
36static const char *lager_boards_compat_dt[] __initdata = { 100static const char *lager_boards_compat_dt[] __initdata = {