flo: asustek: adjust gpio mappings for keypad and pcbid on rev_b

Refer to HW schematic with V0.9, change gpio settings as below
  for hardware revisoin b.
    ------------------------------------------------------------
    |Function | Original | New   |    Notes                    |
    ------------------------------------------------------------
    |VOL_UP   | gpio#53  |gpio#15| Wakeup INT. for power saving|
    ------------------------------------------------------------
    |VOL_DOWN | gpio#54  |gpio#36| Wakeup INT. for power saving|
    ------------------------------------------------------------
    |PCB_ID5  | gpio#15  |gpio#53| Switch due to changed VOL_UP|
    ------------------------------------------------------------

Change-Id: If78ee0f4b7a932ebfe1d03f09e938271fb68958e
Signed-off-by: paris_yeh <paris_yeh@asus.com>
Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/69685
Reviewed-by: Sam hblee <Sam_hblee@asus.com>
This commit is contained in:
paris_yeh
2013-03-01 15:48:42 +08:00
committed by Iliyan Malchev
parent 87e7f65dbb
commit 49fa68b85b
3 changed files with 57 additions and 4 deletions

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -22,6 +22,7 @@
#include <mach/board.h>
#include <mach/gpiomux.h>
#include <mach/socinfo.h>
#include <mach/board_asustek.h>
#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,