Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173313
b: refs/heads/master
c: 2eb30c8
h: refs/heads/master
i:
  173311: faa1a28
v: v3
  • Loading branch information
David A. Griego authored and Kevin Hilman committed Nov 25, 2009
1 parent 65efd15 commit 422e921
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f63dd12da29f47c37bbc093abec098538e04357c
refs/heads/master: 2eb30c81ce91f646f6f2e6cdfd36b79a492002ce
54 changes: 54 additions & 0 deletions trunk/arch/arm/mach-davinci/board-da830-evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include <mach/irqs.h>
#include <mach/cp_intc.h>
#include <mach/mux.h>
#include <mach/gpio.h>
#include <mach/da8xx.h>
#include <mach/asp.h>

Expand Down Expand Up @@ -83,6 +84,57 @@ static struct snd_platform_data da830_evm_snd_data = {
.rxnumevt = 1,
};

/*
* GPIO2[1] is used as MMC_SD_WP and GPIO2[2] as MMC_SD_INS.
*/
static const short da830_evm_mmc_sd_pins[] = {
DA830_MMCSD_DAT_0, DA830_MMCSD_DAT_1, DA830_MMCSD_DAT_2,
DA830_MMCSD_DAT_3, DA830_MMCSD_DAT_4, DA830_MMCSD_DAT_5,
DA830_MMCSD_DAT_6, DA830_MMCSD_DAT_7, DA830_MMCSD_CLK,
DA830_MMCSD_CMD, DA830_GPIO2_1, DA830_GPIO2_2,
-1
};

#define DA830_MMCSD_WP_PIN GPIO_TO_PIN(2, 1)

static int da830_evm_mmc_get_ro(int index)
{
return gpio_get_value(DA830_MMCSD_WP_PIN);
}

static struct davinci_mmc_config da830_evm_mmc_config = {
.get_ro = da830_evm_mmc_get_ro,
.wires = 4,
.version = MMC_CTLR_VERSION_2,
};

static inline void da830_evm_init_mmc(void)
{
int ret;

ret = da8xx_pinmux_setup(da830_evm_mmc_sd_pins);
if (ret) {
pr_warning("da830_evm_init: mmc/sd mux setup failed: %d\n",
ret);
return;
}

ret = gpio_request(DA830_MMCSD_WP_PIN, "MMC WP");
if (ret) {
pr_warning("da830_evm_init: can not open GPIO %d\n",
DA830_MMCSD_WP_PIN);
return;
}
gpio_direction_input(DA830_MMCSD_WP_PIN);

ret = da8xx_register_mmcsd0(&da830_evm_mmc_config);
if (ret) {
pr_warning("da830_evm_init: mmc/sd registration failed: %d\n",
ret);
gpio_free(DA830_MMCSD_WP_PIN);
}
}

static __init void da830_evm_init(void)
{
struct davinci_soc_info *soc_info = &davinci_soc_info;
Expand Down Expand Up @@ -132,6 +184,8 @@ static __init void da830_evm_init(void)
ret);

da8xx_register_mcasp(1, &da830_evm_snd_data);

da830_evm_init_mmc();
}

#ifdef CONFIG_SERIAL_8250_CONSOLE
Expand Down

0 comments on commit 422e921

Please sign in to comment.