diff --git a/arch/arm/mach-msm/asustek/asustek-keypad.c b/arch/arm/mach-msm/asustek/asustek-keypad.c index 086af08e672..c37a5ebfbb8 100644 --- a/arch/arm/mach-msm/asustek/asustek-keypad.c +++ b/arch/arm/mach-msm/asustek/asustek-keypad.c @@ -29,6 +29,8 @@ #define GPIO_KEY_VOLUMEUP 53 #define GPIO_KEY_VOLUMEDOWN 54 +#define GPIO_KEY2_VOLUMEUP 15 +#define GPIO_KEY2_VOLUMEDOWN 36 #define GPIO_KEY(_id, _iswake) \ { \ @@ -59,9 +61,22 @@ static struct platform_device asustek_keys_device = { }, }; +static void gpio_keys_remap(void) +{ + if (asustek_get_hw_rev() == HW_REV_B) { + pr_info( + "Reconfigure VOL_UP with GPIO#%d and VOL_DOWN with GPIO#%d\n", + GPIO_KEY2_VOLUMEUP, GPIO_KEY2_VOLUMEDOWN); + asustek_keys[0].gpio = GPIO_KEY2_VOLUMEUP; + asustek_keys[1].gpio = GPIO_KEY2_VOLUMEDOWN; + } +} + void __init asustek_add_keypad(void) { pr_info("Registering gpio keys\n"); + gpio_keys_remap(); + platform_device_register(&asustek_keys_device); } diff --git a/arch/arm/mach-msm/asustek/devices_asustek.c b/arch/arm/mach-msm/asustek/devices_asustek.c index 4244444b334..e70b0063ed0 100644 --- a/arch/arm/mach-msm/asustek/devices_asustek.c +++ b/arch/arm/mach-msm/asustek/devices_asustek.c @@ -179,8 +179,30 @@ static struct platform_device asustek_pcbid_device = { } }; +static void pcbid_resources_remap(void) +{ + hw_rev revision = HW_REV_INVALID; + revision = asustek_get_hw_rev(); + + switch (revision) { + case HW_REV_B: + case HW_REV_C: + case HW_REV_D: + pr_info("ASUSTek: Reconfigure PCB_ID5 with GPIO#53\n"); + resources_asustek_pcbid[5].start = 53; + resources_asustek_pcbid[5].end = 53; + break; + case HW_REV_A: + default: + break; + } +} + + void __init asustek_add_pcbid_devices(void) { + pcbid_resources_remap(); + platform_device_register(&asustek_pcbid_device); } diff --git a/arch/arm/mach-msm/asustek/flo/board-flo-gpiomux.c b/arch/arm/mach-msm/asustek/flo/board-flo-gpiomux.c index a577db6b460..f1da20a4b62 100644 --- a/arch/arm/mach-msm/asustek/flo/board-flo-gpiomux.c +++ b/arch/arm/mach-msm/asustek/flo/board-flo-gpiomux.c @@ -22,6 +22,7 @@ #include #include #include +#include #include "devices.h" #include "board-flo.h" @@ -1308,14 +1309,14 @@ static struct gpiomux_setting gpio_keys_suspended_cfg = { }; static struct msm_gpiomux_config asustek_gpio_keys_configs[] __initdata = { - { .gpio = 53, + { .gpio = 53, /* Changed to GPIO#15 for HW_REV_B */ .settings = { [GPIOMUX_ACTIVE] = &gpio_keys_active_cfg, [GPIOMUX_SUSPENDED] = &gpio_keys_suspended_cfg, }, }, { - .gpio = 54, + .gpio = 54, /* Changed to GPIO#36 for HW_REV_B */ .settings = { [GPIOMUX_ACTIVE] = &gpio_keys_active_cfg, [GPIOMUX_SUSPENDED] = &gpio_keys_suspended_cfg, @@ -1373,7 +1374,7 @@ static struct msm_gpiomux_config asustek_pcbid_pins_configs[] __initdata = { }, }, { - .gpio = 15, + .gpio = 15, /* Changed to GPIO#53 since HW_REV_B */ .settings = { [GPIOMUX_ACTIVE] = &pcbid_pins_active_cfg, [GPIOMUX_SUSPENDED] = &pcbid_pins_suspended_cfg, @@ -1611,7 +1612,10 @@ void __init apq8064_init_gpiomux(void) { int rc; int platform_version = socinfo_get_platform_version(); - +#ifdef CONFIG_MACH_ASUSTEK + hw_rev revision = HW_REV_INVALID; + revision = asustek_get_hw_rev(); +#endif rc = msm_gpiomux_init(NR_GPIO_IRQS); if (rc) { pr_err(KERN_ERR "msm_gpiomux_init failed %d\n", rc); @@ -1643,6 +1647,18 @@ void __init apq8064_init_gpiomux(void) #ifdef CONFIG_MACH_ASUSTEK if (machine_is_apq8064_flo() || machine_is_apq8064_deb()) { + if ((revision == HW_REV_B) || (revision == HW_REV_C) || + (revision == HW_REV_D)) { + pr_info("Reconfigure asustek_pcbid of gpiomux\n"); + asustek_pcbid_pins_configs[5].gpio = 53; + } + + if (revision == HW_REV_B) { + pr_info("Reconfigure gpio_keys of gpiomux\n"); + asustek_gpio_keys_configs[0].gpio = 15; + asustek_gpio_keys_configs[1].gpio = 36; + } + msm_gpiomux_install(asustek_gpio_keys_configs, ARRAY_SIZE(asustek_gpio_keys_configs)); msm_gpiomux_install(asustek_pcbid_pins_configs,