summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorSachin Nikam <snikam@nvidia.com>2011-01-20 20:05:27 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-01-27 17:18:16 -0800
commitdf60577195b53574b7ccf429110d56a472985578 (patch)
tree5838263ec91262804cead3d57628db511732847a /arch
parent0d6cb9eaa093fd3c60cbc3d1e877981552bba343 (diff)
[ARM] tegra: sdhci: external sdcard hotplug gpio
Bug 779990 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>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-tegra/board-whistler-sdhci.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/arch/arm/mach-tegra/board-whistler-sdhci.c b/arch/arm/mach-tegra/board-whistler-sdhci.c
index 10e5020c906f..71b461ff6566 100644
--- a/arch/arm/mach-tegra/board-whistler-sdhci.c
+++ b/arch/arm/mach-tegra/board-whistler-sdhci.c
@@ -34,6 +34,8 @@
#define WHISTLER_WLAN_PWR TEGRA_GPIO_PK5
#define WHISTLER_WLAN_RST TEGRA_GPIO_PK6
+#define WHISTLER_EXT_SDCARD_DETECT TEGRA_GPIO_PI5
+
static void (*wifi_status_cb)(int card_present, void *dev_id);
static void *wifi_status_cb_devid;
@@ -175,7 +177,7 @@ static struct tegra_sdhci_platform_data tegra_sdhci_platform_data1 = {
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,
};
@@ -242,8 +244,21 @@ static int __init whistler_wifi_init(void)
platform_device_register(&whistler_wifi_device);
return 0;
}
+
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_device1);