diff options
author | Sudhakar Rajashekhara <sudhakar.raj@ti.com> | 2009-08-13 15:16:23 -0400 |
---|---|---|
committer | Kevin Hilman <khilman@deeprootsystems.com> | 2009-08-26 11:55:55 +0300 |
commit | 700691f27ed9b0891cece9032e4de8c0b482c625 (patch) | |
tree | e4f7cefe7307679799383ad58ead918d415f7bab /arch/arm/mach-davinci/board-da850-evm.c | |
parent | 5cbdf276bd9d9cd3cb9616f8253390096c1a237f (diff) | |
download | blackbird-op-linux-700691f27ed9b0891cece9032e4de8c0b482c625.tar.gz blackbird-op-linux-700691f27ed9b0891cece9032e4de8c0b482c625.zip |
davinci: Add MMC/SD support for da850/omap-l138
There are two instances of MMC/SD on da850/omap-l138.
Connector for the first instance is available on the
EVM. This patch adds support for this instance.
This patch also adds support for card detect and write
protect switches on da850/omap-l138 EVM.
Signed-off-by: Sudhakar Rajashekhara <sudhakar.raj@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Diffstat (limited to 'arch/arm/mach-davinci/board-da850-evm.c')
-rw-r--r-- | arch/arm/mach-davinci/board-da850-evm.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index b1df784ed702..eb998ce6d465 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -33,6 +33,9 @@ #define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15) #define DA850_LCD_PWR_PIN GPIO_TO_PIN(8, 10) +#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0) +#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1) + static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { .bus_freq = 100, /* kHz */ .bus_delay = 0, /* usec */ @@ -63,6 +66,23 @@ static struct snd_platform_data da850_evm_snd_data = { .rxnumevt = 1, }; +static int da850_evm_mmc_get_ro(int index) +{ + return gpio_get_value(DA850_MMCSD_WP_PIN); +} + +static int da850_evm_mmc_get_cd(int index) +{ + return !gpio_get_value(DA850_MMCSD_CD_PIN); +} + +static struct davinci_mmc_config da850_mmc_config = { + .get_ro = da850_evm_mmc_get_ro, + .get_cd = da850_evm_mmc_get_cd, + .wires = 4, + .version = MMC_CTLR_VERSION_2, +}; + static int da850_lcd_hw_init(void) { int status; @@ -134,6 +154,28 @@ static __init void da850_evm_init(void) pr_warning("da830_evm_init: watchdog registration failed: %d\n", ret); + ret = da8xx_pinmux_setup(da850_mmcsd0_pins); + if (ret) + pr_warning("da850_evm_init: mmcsd0 mux setup failed: %d\n", + ret); + + ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n"); + if (ret) + pr_warning("da850_evm_init: can not open GPIO %d\n", + DA850_MMCSD_CD_PIN); + gpio_direction_input(DA850_MMCSD_CD_PIN); + + ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n"); + if (ret) + pr_warning("da850_evm_init: can not open GPIO %d\n", + DA850_MMCSD_WP_PIN); + gpio_direction_input(DA850_MMCSD_WP_PIN); + + ret = da8xx_register_mmcsd0(&da850_mmc_config); + if (ret) + pr_warning("da850_evm_init: mmcsd0 registration failed: %d\n", + ret); + davinci_serial_init(&da850_evm_uart_config); /* |