From e7102f28f10a4fc17bc0a5d3fe0b87b7adca7e9b Mon Sep 17 00:00:00 2001 From: Robert MARKLUND Date: Thu, 8 Dec 2011 09:34:57 +0100 Subject: mach-ux500: Fix snowball pins for buttons Fix snowball pins for buttons also do the declaration the same way all the other decalrations are done. Moved the u9500 special GPIO swich to before board variant specific GPIO Change-Id: I9b25667d3ece4a49706b5c43c7cc7df5df3930e1 Signed-off-by: Robert Marklund --- arch/arm/mach-ux500/board-mop500-pins.c | 27 +++++++++++++++++---------- arch/arm/mach-ux500/board-mop500.c | 17 ++++------------- arch/arm/mach-ux500/board-mop500.h | 25 +++++++++++++++---------- 3 files changed, 36 insertions(+), 33 deletions(-) diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c index 3d32e9b059e..276305ebb33 100644 --- a/arch/arm/mach-ux500/board-mop500-pins.c +++ b/arch/arm/mach-ux500/board-mop500-pins.c @@ -207,6 +207,12 @@ static pin_cfg_t snowball_pins[] = { /* MMC0: MicroSD card */ GPIO21_MC0_DAT31DIR | PIN_OUTPUT_HIGH, + /* Snowball buttons */ + GPIO32_GPIO | PIN_INPUT_PULLUP, /* User PB */ + GPIO151_GPIO | PIN_INPUT_PULLUP, /* J1 pin 8 */ + GPIO152_GPIO | PIN_INPUT_PULLUP, /* J1 pin 9 */ + GPIO162_GPIO | PIN_INPUT_PULLUP, /* J1 pin 14 */ + /* MMC2: LAN */ GPIO86_SM_ADQ0, GPIO87_SM_ADQ1, @@ -243,6 +249,7 @@ static pin_cfg_t snowball_pins[] = { /* WLAN/GBF */ GPIO171_GPIO | PIN_OUTPUT_HIGH,/* GBF_ENA */ + GPIO161_GPIO | PIN_OUTPUT_LOW, /* WLAN_PMU_EN */ GPIO215_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */ GPIO216_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */ }; @@ -933,16 +940,6 @@ void __init mop500_pins_init(void) ux500_pins_add(mop500_pins, ARRAY_SIZE(mop500_pins)); - if (machine_is_hrefv60()) - nmk_config_pins(mop500_pins_hrefv60, - ARRAY_SIZE(mop500_pins_hrefv60)); - else if (machine_is_snowball()) - nmk_config_pins(snowball_pins, - ARRAY_SIZE(snowball_pins)); - else - nmk_config_pins(mop500_pins_default, - ARRAY_SIZE(mop500_pins_default)); - switch (pinsfor) { case PINS_FOR_U9500: nmk_config_pins(u9500_pins, ARRAY_SIZE(u9500_pins)); @@ -954,6 +951,16 @@ void __init mop500_pins_init(void) break; } + if (machine_is_hrefv60()) + nmk_config_pins(mop500_pins_hrefv60, + ARRAY_SIZE(mop500_pins_hrefv60)); + else if (machine_is_snowball()) + nmk_config_pins(snowball_pins, + ARRAY_SIZE(snowball_pins)); + else + nmk_config_pins(mop500_pins_default, + ARRAY_SIZE(mop500_pins_default)); + suspend_set_pins_force_fn(mop500_pins_suspend_force, mop500_pins_suspend_force_mux); } diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c index 7d2eea57d9e..76211404481 100644 --- a/arch/arm/mach-ux500/board-mop500.c +++ b/arch/arm/mach-ux500/board-mop500.c @@ -160,7 +160,7 @@ static struct abx500_accdet_platform_data ab8500_accdet_pdata = { static struct gpio_keys_button snowball_key_array[] = { { - .gpio = 32, + .gpio = SNOWBALL_USER_PB_GPIO, .type = EV_KEY, .code = KEY_1, .desc = "userpb", @@ -169,7 +169,7 @@ static struct gpio_keys_button snowball_key_array[] = { .wakeup = 1, }, { - .gpio = 151, + .gpio = SNOWBALL_J1_PIN_8_GPIO, .type = EV_KEY, .code = KEY_2, .desc = "extkb1", @@ -178,7 +178,7 @@ static struct gpio_keys_button snowball_key_array[] = { .wakeup = 1, }, { - .gpio = 152, + .gpio = SNOWBALL_J1_PIN_9_GPIO, .type = EV_KEY, .code = KEY_3, .desc = "extkb2", @@ -187,16 +187,7 @@ static struct gpio_keys_button snowball_key_array[] = { .wakeup = 1, }, { - .gpio = 161, - .type = EV_KEY, - .code = KEY_4, - .desc = "extkb3", - .active_low = 1, - .debounce_interval = 50, - .wakeup = 1, - }, - { - .gpio = 162, + .gpio = SNOWBALL_J1_PIN_14_GPIO, .type = EV_KEY, .code = KEY_5, .desc = "extkb4", diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h index 829a7bece6e..1f65e4de60a 100644 --- a/arch/arm/mach-ux500/board-mop500.h +++ b/arch/arm/mach-ux500/board-mop500.h @@ -11,16 +11,6 @@ #include #include -/* Snowball GPIO for MMC card */ -#define SNOWBALL_SDMMC_EN_GPIO 217 -#define SNOWBALL_SDMMC_1V8_3V_GPIO 228 -#define SNOWBALL_SDMMC_CD_GPIO 218 - -/* Snowball specific GPIO assignments, this board has no GPIO expander */ -#define SNOWBALL_ACCEL_INT1_GPIO 163 -#define SNOWBALL_ACCEL_INT2_GPIO 164 -#define SNOWBALL_MAGNET_DRDY_GPIO 165 - /* HREFv60-specific GPIO assignments, this board has no GPIO expander */ #define HREFV60_TOUCH_RST_GPIO 143 #define HREFV60_PROX_SENSE_GPIO 217 @@ -61,6 +51,16 @@ #define GPIO_SDMMC_EN MOP500_EGPIO(17) #define GPIO_SDMMC_1V8_3V_SEL MOP500_EGPIO(18) +/* Snowball GPIO for MMC card */ +#define SNOWBALL_SDMMC_EN_GPIO 217 +#define SNOWBALL_SDMMC_1V8_3V_GPIO 228 +#define SNOWBALL_SDMMC_CD_GPIO 218 + +/* Snowball specific GPIO assignments, this board has no GPIO expander */ +#define SNOWBALL_ACCEL_INT1_GPIO 163 +#define SNOWBALL_ACCEL_INT2_GPIO 164 +#define SNOWBALL_MAGNET_DRDY_GPIO 165 + /*Snowball AB8500 GPIO */ #define SNOWBALL_VSMPS2_1V8_GPIO AB8500_PIN_GPIO1 /* SYSCLKREQ2/GPIO1 */ #define SNOWBALL_PM_GPIO1_GPIO AB8500_PIN_GPIO2 /* SYSCLKREQ3/GPIO2 */ @@ -70,6 +70,11 @@ #define SNOWBALL_PME_ETH_GPIO AB8500_PIN_GPIO24 /* SYSCLKREQ7/GPIO24 */ #define SNOWBALL_EN_3V3_ETH_GPIO AB8500_PIN_GPIO26 /* GPIO26 */ +/*Snowball buttons GPIO */ +#define SNOWBALL_USER_PB_GPIO 32 +#define SNOWBALL_J1_PIN_8_GPIO 151 /* AP_GPIO151 */ +#define SNOWBALL_J1_PIN_9_GPIO 152 /* AP_GPIO152 */ +#define SNOWBALL_J1_PIN_14_GPIO 162 /* AP_GPIO162 */ struct i2c_board_info; -- cgit v1.2.3 From c18d35020f72a8b5f6e345f0907d45acdd65f0f3 Mon Sep 17 00:00:00 2001 From: Robert MARKLUND Date: Thu, 8 Dec 2011 09:34:58 +0100 Subject: cg2900: Change the PMU_EN gpio for snowball Snowball have the GPIO_EN on GPIO161 diffrent from u8500. Change-Id: I6dddb1e3d7b7b80ce046fbd92a7852a3d0a6c59d Signed-off-by: Robert Marklund --- drivers/staging/cg2900/board-ux500-cg2900.c | 47 +++++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/drivers/staging/cg2900/board-ux500-cg2900.c b/drivers/staging/cg2900/board-ux500-cg2900.c index bd81f68fdc6..2376c5dc078 100644 --- a/drivers/staging/cg2900/board-ux500-cg2900.c +++ b/drivers/staging/cg2900/board-ux500-cg2900.c @@ -32,9 +32,10 @@ #define CG2900_BT_ENABLE_GPIO 170 #define CG2900_GBF_ENA_RESET_GPIO 171 #define WLAN_PMU_EN_GPIO 226 +#define WLAN_PMU_EN_GPIO_SNOWBALL 161 #define WLAN_PMU_EN_GPIO_U9500 AB8500_PIN_GPIO11 -#define CG2900_UX500_BT_CTS_GPIO 0 -#define CG2900_U5500_BT_CTS_GPIO 168 +#define CG2900_UX500_BT_CTS_GPIO 0 +#define CG2900_U5500_BT_CTS_GPIO 168 enum cg2900_gpio_pull_sleep ux500_cg2900_sleep_gpio[21] = { CG2900_NO_PULL, /* GPIO 0: PTA_CONFX */ @@ -160,6 +161,34 @@ static struct resource cg2900_uart_resources_u8500[] = { }, }; +static struct resource cg2900_uart_resources_snowball[] = { + { + .start = CG2900_GBF_ENA_RESET_GPIO, + .end = CG2900_GBF_ENA_RESET_GPIO, + .flags = IORESOURCE_IO, + .name = "gbf_ena_reset", + }, + { + .start = WLAN_PMU_EN_GPIO_SNOWBALL, + .end = WLAN_PMU_EN_GPIO_SNOWBALL, + .flags = IORESOURCE_IO, + .name = "pmu_en", + }, + { + .start = CG2900_UX500_BT_CTS_GPIO, + .end = CG2900_UX500_BT_CTS_GPIO, + .flags = IORESOURCE_IO, + .name = "cts_gpio", + }, + { + .start = NOMADIK_GPIO_TO_IRQ(CG2900_UX500_BT_CTS_GPIO), + .end = NOMADIK_GPIO_TO_IRQ(CG2900_UX500_BT_CTS_GPIO), + .flags = IORESOURCE_IRQ, + .name = "cts_irq", + }, +}; + + static struct resource cg2900_uart_resources_u9500[] = { { .start = CG2900_GBF_ENA_RESET_GPIO, @@ -269,15 +298,21 @@ static int __init board_cg2900_init(void) if (machine_is_hrefv60()) { /* u8500 */ ux500_cg2900_uart_device.num_resources = - ARRAY_SIZE(cg2900_uart_resources_u8500); + ARRAY_SIZE(cg2900_uart_resources_u8500); + ux500_cg2900_uart_device.resource = + cg2900_uart_resources_u8500; + } else if (machine_is_snowball()) { + /* snowball have diffrent PMU_EN gpio */ + ux500_cg2900_uart_device.num_resources = + ARRAY_SIZE(cg2900_uart_resources_snowball); ux500_cg2900_uart_device.resource = - cg2900_uart_resources_u8500; + cg2900_uart_resources_snowball; } else { /* u8500 pre v60*/ ux500_cg2900_uart_device.num_resources = - ARRAY_SIZE(cg2900_uart_resources_pre_v60); + ARRAY_SIZE(cg2900_uart_resources_pre_v60); ux500_cg2900_uart_device.resource = - cg2900_uart_resources_pre_v60; + cg2900_uart_resources_pre_v60; } } else if (cpu_is_u5500()) { /* u5500 */ -- cgit v1.2.3