diff options
author | Pradeep Goudagunta <pgoudagunta@nvidia.com> | 2011-03-29 20:44:25 +0530 |
---|---|---|
committer | Dan Willemsen <dwillemsen@nvidia.com> | 2011-11-30 21:45:45 -0800 |
commit | 384f0e13b02ce57be860fc11d7c58d69f3b46a45 (patch) | |
tree | 965364e6ca26a723f1c09c9b10bd68883827dee4 /arch/arm/mach-tegra/board-cardhu-sdhci.c | |
parent | 2096ef95062f198b6a2acb4be8b32f966743bbec (diff) |
ARM: tegra: pm269: Enable sd card
-Support to select sd card dynamically by reading board-id.
-Enable sd card for BOARD_PM269.
Original-Change-Id: I1504df353a07880a1c495ce44be2d3371d00f5ff
Reviewed-on: http://git-master/r/24693
Tested-by: Pradeep Goudagunta <pgoudagunta@nvidia.com>
Reviewed-by: Venkata Nageswara Penumarty <vpenumarty@nvidia.com>
Reviewed-by: Laxman Dewangan <ldewangan@nvidia.com>
Original-Change-Id: I76cdfe4be34bc5375976954343482c376f3a1202
Rebase-Id: R5154d5fcee2e6d53102d346522595db9c16c9b77
Diffstat (limited to 'arch/arm/mach-tegra/board-cardhu-sdhci.c')
-rw-r--r-- | arch/arm/mach-tegra/board-cardhu-sdhci.c | 89 |
1 files changed, 69 insertions, 20 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-sdhci.c b/arch/arm/mach-tegra/board-cardhu-sdhci.c index 4d0858086036..3368010a5da9 100644 --- a/arch/arm/mach-tegra/board-cardhu-sdhci.c +++ b/arch/arm/mach-tegra/board-cardhu-sdhci.c @@ -29,6 +29,7 @@ #include "gpio-names.h" #include "board.h" +#include "board-cardhu.h" #define CARDHU_SD_CD TEGRA_GPIO_PI5 #define CARDHU_SD_WP TEGRA_GPIO_PT3 @@ -115,14 +116,39 @@ static struct tegra_sdhci_platform_data tegra_sdhci_platform_data3 = { .is_8bit_supported = true, }; +static struct tegra_sdhci_platform_data tegra_pm269_sdhci_platform_data0 = { + .clk_id = NULL, + .force_hs = 0, + .cd_gpio = -1, + .wp_gpio = -1, + .power_gpio = -1, + .tap_delay = 6, + .is_voltage_switch_supported = false, + .vsd_name = NULL, + .vsd_slot_name = NULL, + .max_clk = 48000000, + .is_8bit_supported = false, +}; + +static struct tegra_sdhci_platform_data tegra_pm269_sdhci_platform_data2 = { + .clk_id = NULL, + .force_hs = 1, + .cd_gpio = -1, + .wp_gpio = -1, + .power_gpio = -1, + .tap_delay = 6, + .is_voltage_switch_supported = false, + .vsd_name = "vddio_sdmmc3", + .vsd_slot_name = "vddio_sd_slot", + .max_clk = 48000000, + .is_8bit_supported = false, +}; + static struct platform_device tegra_sdhci_device0 = { .name = "sdhci-tegra", .id = 0, .resource = sdhci_resource0, .num_resources = ARRAY_SIZE(sdhci_resource0), - .dev = { - .platform_data = &tegra_sdhci_platform_data0, - }, }; static struct platform_device tegra_sdhci_device2 = { @@ -130,9 +156,6 @@ static struct platform_device tegra_sdhci_device2 = { .id = 2, .resource = sdhci_resource2, .num_resources = ARRAY_SIZE(sdhci_resource2), - .dev = { - .platform_data = &tegra_sdhci_platform_data2, - }, }; static struct platform_device tegra_sdhci_device3 = { @@ -190,21 +213,47 @@ static int cardhu_sd_wp_gpio_init(void) int __init cardhu_sdhci_init(void) { unsigned int rc = 0; - platform_device_register(&tegra_sdhci_device3); - platform_device_register(&tegra_sdhci_device2); - - /* Fix ME: The gpios have to enabled for hot plug support */ - rc = cardhu_sd_cd_gpio_init(); - if (!rc) { - tegra_sdhci_platform_data0.cd_gpio = CARDHU_SD_CD; - tegra_sdhci_platform_data0.cd_gpio_polarity = 0; - } - rc = cardhu_sd_wp_gpio_init(); - if (!rc) { - tegra_sdhci_platform_data0.wp_gpio = CARDHU_SD_WP; - tegra_sdhci_platform_data0.wp_gpio_polarity = 1; + struct board_info board_info; + tegra_get_board_info(&board_info); + if (board_info.board_id == BOARD_PM269) { + tegra_sdhci_device2.dev.platform_data = + &tegra_pm269_sdhci_platform_data2; + tegra_sdhci_device0.dev.platform_data = + &tegra_pm269_sdhci_platform_data0; + platform_device_register(&tegra_sdhci_device3); + + /* Fix ME: The gpios have to enabled for hot plug support */ + rc = cardhu_sd_cd_gpio_init(); + if (!rc) { + tegra_pm269_sdhci_platform_data2.cd_gpio = + CARDHU_SD_CD; + tegra_pm269_sdhci_platform_data2.cd_gpio_polarity = 0; + } + + platform_device_register(&tegra_sdhci_device2); + + } else { + tegra_sdhci_device2.dev.platform_data = + &tegra_sdhci_platform_data2; + tegra_sdhci_device0.dev.platform_data = + &tegra_sdhci_platform_data0; + platform_device_register(&tegra_sdhci_device3); + platform_device_register(&tegra_sdhci_device2); + + /* Fix ME: The gpios have to enabled for hot plug support */ + rc = cardhu_sd_cd_gpio_init(); + if (!rc) { + tegra_sdhci_platform_data0.cd_gpio = CARDHU_SD_CD; + tegra_sdhci_platform_data0.cd_gpio_polarity = 0; + } + rc = cardhu_sd_wp_gpio_init(); + if (!rc) { + tegra_sdhci_platform_data0.wp_gpio = CARDHU_SD_WP; + tegra_sdhci_platform_data0.wp_gpio_polarity = 1; + } + + platform_device_register(&tegra_sdhci_device0); } - platform_device_register(&tegra_sdhci_device0); return 0; } |