From 5c6db1a421c6ceef199a956c7e0c1244ea6dfef7 Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Tue, 30 Jul 2013 10:59:00 +0900 Subject: ARM: shmobile: ape6evm: support GPIO switches The ape6evm board has switches S16 - S23 wired up to GPIO pins. This patch allows access to those pins as gpio-keys. Acked-by: Kuninori Morimoto Signed-off-by: Simon Horman diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index ccf8b04..677752c 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -19,6 +19,8 @@ */ #include +#include +#include #include #include #include @@ -37,6 +39,24 @@ #include #include +/* GPIO KEY */ +#define GPIO_KEY(c, g, d, ...) \ + { .code = c, .gpio = g, .desc = d, .active_low = 1 } + +static struct gpio_keys_button gpio_buttons[] = { + GPIO_KEY(KEY_0, 324, "S16"), + GPIO_KEY(KEY_MENU, 325, "S17"), + GPIO_KEY(KEY_HOME, 326, "S18"), + GPIO_KEY(KEY_BACK, 327, "S19"), + GPIO_KEY(KEY_VOLUMEUP, 328, "S20"), + GPIO_KEY(KEY_VOLUMEDOWN, 329, "S21"), +}; + +static struct __initdata gpio_keys_platform_data ape6evm_keys_pdata = { + .buttons = gpio_buttons, + .nbuttons = ARRAY_SIZE(gpio_buttons), +}; + /* Dummy supplies, where voltage doesn't matter */ static struct regulator_consumer_supply dummy_supplies[] = { REGULATOR_SUPPLY("vddvario", "smsc911x"), @@ -172,6 +192,9 @@ static void __init ape6evm_add_standard_devices(void) platform_device_register_resndata(&platform_bus, "sh_mobile_sdhi", 1, sdhi1_resources, ARRAY_SIZE(sdhi1_resources), &sdhi1_pdata, sizeof(sdhi1_pdata)); + platform_device_register_data(&platform_bus, "gpio-keys", -1, + &ape6evm_keys_pdata, + sizeof(ape6evm_keys_pdata)); } static const char *ape6evm_boards_compat_dt[] __initdata = { -- cgit v0.10.2 From 9adad788583c735eb14ddd5cca79a4e2ca2d707c Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Tue, 30 Jul 2013 10:59:02 +0900 Subject: ARM: shmobile: ape6evm: Add GPIO LEDs The board has 6 LEDs connected to GPIOs. Add a led-gpio device to support them. Acked-by: Kuninori Morimoto Signed-off-by: Simon Horman diff --git a/arch/arm/mach-shmobile/board-ape6evm.c b/arch/arm/mach-shmobile/board-ape6evm.c index 677752c..db97460 100644 --- a/arch/arm/mach-shmobile/board-ape6evm.c +++ b/arch/arm/mach-shmobile/board-ape6evm.c @@ -39,6 +39,40 @@ #include #include +/* LEDS */ +static struct gpio_led ape6evm_leds[] = { + { + .name = "gnss-en", + .gpio = 28, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "nfc-nrst", + .gpio = 126, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "gnss-nrst", + .gpio = 132, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "bt-wakeup", + .gpio = 232, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "strobe", + .gpio = 250, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, { + .name = "bbresetout", + .gpio = 288, + .default_state = LEDS_GPIO_DEFSTATE_OFF, + }, +}; + +static __initdata struct gpio_led_platform_data ape6evm_leds_pdata = { + .leds = ape6evm_leds, + .num_leds = ARRAY_SIZE(ape6evm_leds), +}; + /* GPIO KEY */ #define GPIO_KEY(c, g, d, ...) \ { .code = c, .gpio = g, .desc = d, .active_low = 1 } @@ -195,6 +229,9 @@ static void __init ape6evm_add_standard_devices(void) platform_device_register_data(&platform_bus, "gpio-keys", -1, &ape6evm_keys_pdata, sizeof(ape6evm_keys_pdata)); + platform_device_register_data(&platform_bus, "leds-gpio", -1, + &ape6evm_leds_pdata, + sizeof(ape6evm_leds_pdata)); } static const char *ape6evm_boards_compat_dt[] __initdata = { -- cgit v0.10.2 From 4901e136aa5c35873701156c4c0af5b3c2c8faee Mon Sep 17 00:00:00 2001 From: Simon Horman Date: Tue, 6 Aug 2013 16:50:10 +0900 Subject: ARM: shmobile: lager: enable Ether Acked-by: Kuninori Morimoto Signed-off-by: Simon Horman diff --git a/arch/arm/mach-shmobile/board-lager.c b/arch/arm/mach-shmobile/board-lager.c index 3c67b2a..7915153 100644 --- a/arch/arm/mach-shmobile/board-lager.c +++ b/arch/arm/mach-shmobile/board-lager.c @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -91,6 +92,20 @@ static struct resource mmcif1_resources[] = { DEFINE_RES_IRQ(gic_spi(170)), }; +/* Ether */ +static struct sh_eth_plat_data ether_pdata __initdata = { + .phy = 0x1, + .edmac_endian = EDMAC_LITTLE_ENDIAN, + .register_type = SH_ETH_REG_FAST_RCAR, + .phy_interface = PHY_INTERFACE_MODE_RMII, + .ether_link_active_low = 1, +}; + +static struct resource ether_resources[] __initdata = { + DEFINE_RES_MEM(0xee700000, 0x400), + DEFINE_RES_IRQ(gic_spi(162)), +}; + static const struct pinctrl_map lager_pinctrl_map[] = { /* SCIF0 (CN19: DEBUG SERIAL0) */ PIN_MAP_MUX_GROUP_DEFAULT("sh-sci.6", "pfc-r8a7790", @@ -103,6 +118,15 @@ static const struct pinctrl_map lager_pinctrl_map[] = { "mmc1_data8", "mmc1"), PIN_MAP_MUX_GROUP_DEFAULT("sh_mmcif.1", "pfc-r8a7790", "mmc1_ctrl", "mmc1"), + /* Ether */ + PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", + "eth_link", "eth"), + PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", + "eth_mdio", "eth"), + PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", + "eth_rmii", "eth"), + PIN_MAP_MUX_GROUP_DEFAULT("r8a7790-ether", "pfc-r8a7790", + "intc_irq0", "intc"), }; static void __init lager_add_standard_devices(void) @@ -125,6 +149,11 @@ static void __init lager_add_standard_devices(void) platform_device_register_resndata(&platform_bus, "sh_mmcif", 1, mmcif1_resources, ARRAY_SIZE(mmcif1_resources), &mmcif1_pdata, sizeof(mmcif1_pdata)); + + platform_device_register_resndata(&platform_bus, "r8a7790-ether", -1, + ether_resources, + ARRAY_SIZE(ether_resources), + ðer_pdata, sizeof(ether_pdata)); } static const char *lager_boards_compat_dt[] __initdata = { -- cgit v0.10.2