summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-whistler-sdhci.c
diff options
context:
space:
mode:
authorSachin Nikam <snikam@nvidia.com>2011-01-20 20:05:27 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:46:24 -0800
commit4a6c3959cb2995750ca91b2b29d933626ce28df3 (patch)
tree1cbc2a77c1d82a66dc5bfef3d9f72b0b0d986b1a /arch/arm/mach-tegra/board-whistler-sdhci.c
parentb2e4896f22ad6400c408d4c1aae938e75ca306d9 (diff)
[ARM] tegra: sdhci: external sdcard hotplug gpio
Bug 779990 Original-Change-Id: I229d05da084ac15439e7b458f231f6f983776d4a Reviewed-on: http://git-master/r/16404 Tested-by: Sachin Nikam <snikam@nvidia.com> Reviewed-by: Thomas Cherry <tcherry@nvidia.com> Reviewed-by: Pavan Kunapuli <pkunapuli@nvidia.com> Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com> Rebase-Id: R605d925c23196b3c5a9b1575d7173126b569ff5d
Diffstat (limited to 'arch/arm/mach-tegra/board-whistler-sdhci.c')
-rw-r--r--arch/arm/mach-tegra/board-whistler-sdhci.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-sdhci.c b/arch/arm/mach-tegra/board-whistler-sdhci.c
index 481c19b8ea90..8933864a6742 100644
--- a/arch/arm/mach-tegra/board-whistler-sdhci.c
+++ b/arch/arm/mach-tegra/board-whistler-sdhci.c
@@ -25,6 +25,8 @@
#include "board.h"
+#define WHISTLER_EXT_SDCARD_DETECT TEGRA_GPIO_PI5
+
static struct resource sdhci_resource0[] = {
[0] = {
.start = INT_SDMMC1,
@@ -75,7 +77,7 @@ static struct tegra_sdhci_platform_data tegra_sdhci_platform_data0 = {
static struct tegra_sdhci_platform_data tegra_sdhci_platform_data2 = {
.clk_id = NULL,
.force_hs = 0,
- .cd_gpio = -1,
+ .cd_gpio = WHISTLER_EXT_SDCARD_DETECT,
.wp_gpio = -1,
.power_gpio = -1,
};
@@ -120,6 +122,18 @@ static struct platform_device tegra_sdhci_device3 = {
int __init whistler_sdhci_init(void)
{
+ int ret;
+
+ ret = gpio_request(WHISTLER_EXT_SDCARD_DETECT, "card_detect");
+ if (ret < 0) {
+ tegra_sdhci_platform_data2.cd_gpio = -1;
+ pr_err("card_detect gpio not found\n");
+ }
+ else {
+ tegra_gpio_enable(WHISTLER_EXT_SDCARD_DETECT);
+ gpio_direction_input(WHISTLER_EXT_SDCARD_DETECT);
+ }
+
platform_device_register(&tegra_sdhci_device3);
platform_device_register(&tegra_sdhci_device2);
platform_device_register(&tegra_sdhci_device0);