diff options
author | Laxman Dewangan <ldewangan@nvidia.com> | 2011-11-30 18:50:44 +0530 |
---|---|---|
committer | Varun Wadekar <vwadekar@nvidia.com> | 2011-12-08 17:04:21 +0530 |
commit | 1fde505f2f36168523cd8995f2e605c33df804af (patch) | |
tree | be1d5365e6f6b348cddb8ba1278ba5bd5bc4cce6 /arch | |
parent | 48caf9a45dc7241253fe453a8e18305ffc3f4397 (diff) |
arm: tegra: cardhu: Support cap sensor for E1291-A04
Supporting the cap sensor based key board which is used in
cardhu - A04.
bug 895616
Change-Id: I433610de6945a5d9fe6e282d80e8e5e9fa6ac5b3
Signed-off-by: Laxman Dewangan <ldewangan@nvidia.com>
Change-Id: I47d857f34a18a72c7aad44ae26921404b091dd14
Reviewed-on: http://git-master/r/67426
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-kbc.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-pinmux.c | 14 |
2 files changed, 31 insertions, 4 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-kbc.c b/arch/arm/mach-tegra/board-cardhu-kbc.c index 58378840fa6a..0fffa1582fab 100644 --- a/arch/arm/mach-tegra/board-cardhu-kbc.c +++ b/arch/arm/mach-tegra/board-cardhu-kbc.c @@ -152,6 +152,15 @@ static struct gpio_keys_button cardhu_keys_e1291[] = { [5] = GPIO_KEY(KEY_VOLUMEDOWN, PQ1, 0), }; +static struct gpio_keys_button cardhu_keys_e1291_a04[] = { + [0] = GPIO_KEY(KEY_MENU, PR0, 0), + [1] = GPIO_KEY(KEY_BACK, PR1, 0), + [2] = GPIO_KEY(KEY_HOME, PQ2, 0), + [3] = GPIO_KEY(KEY_SEARCH, PQ3, 0), + [4] = GPIO_KEY(KEY_VOLUMEUP, PQ0, 0), + [5] = GPIO_KEY(KEY_VOLUMEDOWN, PQ1, 0), +}; + static struct gpio_keys_platform_data cardhu_keys_e1291_platform_data = { .buttons = cardhu_keys_e1291, .nbuttons = ARRAY_SIZE(cardhu_keys_e1291), @@ -219,9 +228,17 @@ int __init cardhu_keys_init(void) pr_info("Registering gpio keys\n"); if (board_info.board_id == BOARD_E1291) { + if (board_info.fab >= BOARD_FAB_A04) { + cardhu_keys_e1291_platform_data.buttons = + cardhu_keys_e1291_a04; + cardhu_keys_e1291_platform_data.nbuttons = + ARRAY_SIZE(cardhu_keys_e1291_a04); + } + /* Enable gpio mode for other pins */ - for (i = 0; i < ARRAY_SIZE(cardhu_keys_e1291); i++) - tegra_gpio_enable(cardhu_keys_e1291[i].gpio); + for (i = 0; i < cardhu_keys_e1291_platform_data.nbuttons; i++) + tegra_gpio_enable(cardhu_keys_e1291_platform_data. + buttons[i].gpio); platform_device_register(&cardhu_keys_e1291_device); } else if (board_info.board_id == BOARD_E1198) { diff --git a/arch/arm/mach-tegra/board-cardhu-pinmux.c b/arch/arm/mach-tegra/board-cardhu-pinmux.c index a07bd0136bd4..1b736a40dccf 100644 --- a/arch/arm/mach-tegra/board-cardhu-pinmux.c +++ b/arch/arm/mach-tegra/board-cardhu-pinmux.c @@ -555,12 +555,19 @@ static struct gpio_init_pin_info init_gpio_mode_e1291_a02[] = { GPIO_INIT_PIN_MODE(TEGRA_GPIO_PI4, false, 0), }; -/* E1198-A02/E1291 specific fab >= A03 */ +/* E1198-A02/E1291 specific fab = A03 */ static struct gpio_init_pin_info init_gpio_mode_e1291_a03[] = { GPIO_INIT_PIN_MODE(TEGRA_GPIO_PDD6, false, 0), GPIO_INIT_PIN_MODE(TEGRA_GPIO_PDD4, false, 0), }; +/* E1198-A02/E1291 specific fab >= A04 */ +static struct gpio_init_pin_info init_gpio_mode_e1291_a04[] = { + GPIO_INIT_PIN_MODE(TEGRA_GPIO_PDD6, false, 0), + GPIO_INIT_PIN_MODE(TEGRA_GPIO_PDD4, false, 0), + GPIO_INIT_PIN_MODE(TEGRA_GPIO_PR2, false, 0), +}; + static void __init cardhu_gpio_init_configure(void) { struct board_info board_info; @@ -584,9 +591,12 @@ static void __init cardhu_gpio_init_configure(void) if (board_info.fab < BOARD_FAB_A03) { len = ARRAY_SIZE(init_gpio_mode_e1291_a02); pins_info = init_gpio_mode_e1291_a02; - } else { + } else if (board_info.fab == BOARD_FAB_A03) { len = ARRAY_SIZE(init_gpio_mode_e1291_a03); pins_info = init_gpio_mode_e1291_a03; + } else { + len = ARRAY_SIZE(init_gpio_mode_e1291_a04); + pins_info = init_gpio_mode_e1291_a04; } break; default: |