diff options
-rwxr-xr-x | arch/arm/mach-tegra/board-cardhu-pinmux.c | 9 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-sdhci.c | 43 |
2 files changed, 49 insertions, 3 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-pinmux.c b/arch/arm/mach-tegra/board-cardhu-pinmux.c index 1ad34a0d7fe2..fc8a2646518d 100755 --- a/arch/arm/mach-tegra/board-cardhu-pinmux.c +++ b/arch/arm/mach-tegra/board-cardhu-pinmux.c @@ -201,7 +201,6 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = { DEFAULT_PINMUX(VI_D8, SDMMC2, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(VI_D9, SDMMC2, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(VI_D10, RSVD1, NORMAL, NORMAL, INPUT), - DEFAULT_PINMUX(VI_D11, RSVD1, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(VI_PCLK, SDMMC2, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(VI_MCLK, VI, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(VI_VSYNC, RSVD1, NORMAL, NORMAL, INPUT), @@ -228,8 +227,6 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = { DEFAULT_PINMUX(CLK3_OUT, EXTPERIPH3, NORMAL, NORMAL, OUTPUT), DEFAULT_PINMUX(CLK3_REQ, DEV3, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(GMI_WP_N, RSVD1, NORMAL, NORMAL, INPUT), -#if defined(CONFIG_MTD_NAND_TEGRA) - DEFAULT_PINMUX(GMI_IORDY, NAND, NORMAL, NORMAL, OUTPUT), DEFAULT_PINMUX(GMI_WAIT, NAND, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(GMI_ADV_N, NAND, NORMAL, NORMAL, OUTPUT), DEFAULT_PINMUX(GMI_CLK, NAND, NORMAL, NORMAL, OUTPUT), @@ -325,6 +322,12 @@ static __initdata struct tegra_pingroup_config cardhu_pinmux[] = { DEFAULT_PINMUX(PEX_L2_RST_N, PCIE, NORMAL, NORMAL, OUTPUT), DEFAULT_PINMUX(PEX_L2_CLKREQ_N, PCIE, NORMAL, NORMAL, INPUT), DEFAULT_PINMUX(HDMI_CEC, CEC, NORMAL, NORMAL, INPUT), + + /* Gpios */ + /* SDMMC1 WP gpio */ + DEFAULT_PINMUX(VI_D11, RSVD1, NORMAL, NORMAL, INPUT), + /* SDMMC1 CD gpio */ + DEFAULT_PINMUX(GMI_IORDY, RSVD1, NORMAL, NORMAL, INPUT), }; void __init cardhu_pinmux_init(void) diff --git a/arch/arm/mach-tegra/board-cardhu-sdhci.c b/arch/arm/mach-tegra/board-cardhu-sdhci.c index f437cb3c82c0..1a88afc25540 100644 --- a/arch/arm/mach-tegra/board-cardhu-sdhci.c +++ b/arch/arm/mach-tegra/board-cardhu-sdhci.c @@ -124,10 +124,53 @@ static struct platform_device tegra_sdhci_device3 = { }, }; +static int cardhu_sd_cd_gpio_init(void) +{ + unsigned int rc = 0; + + rc = gpio_request(TEGRA_GPIO_PI5, "card_detect"); + if (rc) + return rc; + + tegra_gpio_enable(TEGRA_GPIO_PI5); + + rc = gpio_direction_input(TEGRA_GPIO_PI5); + if (rc) + return rc; + + return 0; +} + +static int cardhu_sd_wp_gpio_init(void) +{ + unsigned int rc = 0; + + rc = gpio_request(TEGRA_GPIO_PT3, "write_protect"); + if (rc) + return rc; + + tegra_gpio_enable(TEGRA_GPIO_PT3); + + rc = gpio_direction_input(TEGRA_GPIO_PT3); + if (rc) + return rc; + + return 0; +} + int __init cardhu_sdhci_init(void) { + unsigned int rc = 0; platform_device_register(&tegra_sdhci_device3); platform_device_register(&tegra_sdhci_device2); + rc = cardhu_sd_cd_gpio_init(); + if (!rc) + tegra_sdhci_platform_data0.cd_gpio = TEGRA_GPIO_PI5; + + rc = cardhu_sd_wp_gpio_init(); + if (!rc) + tegra_sdhci_platform_data0.cd_gpio = TEGRA_GPIO_PT3; + platform_device_register(&tegra_sdhci_device0); return 0; } |