aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/board-da850-evm.c
diff options
context:
space:
mode:
authorSudhakar Rajashekhara <sudhakar.raj@ti.com>2009-08-13 15:16:23 -0400
committerKevin Hilman <khilman@deeprootsystems.com>2009-08-26 04:55:55 -0400
commit700691f27ed9b0891cece9032e4de8c0b482c625 (patch)
treee4f7cefe7307679799383ad58ead918d415f7bab /arch/arm/mach-davinci/board-da850-evm.c
parent5cbdf276bd9d9cd3cb9616f8253390096c1a237f (diff)
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.c42
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 @@
33#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15) 33#define DA850_LCD_BL_PIN GPIO_TO_PIN(2, 15)
34#define DA850_LCD_PWR_PIN GPIO_TO_PIN(8, 10) 34#define DA850_LCD_PWR_PIN GPIO_TO_PIN(8, 10)
35 35
36#define DA850_MMCSD_CD_PIN GPIO_TO_PIN(4, 0)
37#define DA850_MMCSD_WP_PIN GPIO_TO_PIN(4, 1)
38
36static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = { 39static struct davinci_i2c_platform_data da850_evm_i2c_0_pdata = {
37 .bus_freq = 100, /* kHz */ 40 .bus_freq = 100, /* kHz */
38 .bus_delay = 0, /* usec */ 41 .bus_delay = 0, /* usec */
@@ -63,6 +66,23 @@ static struct snd_platform_data da850_evm_snd_data = {
63 .rxnumevt = 1, 66 .rxnumevt = 1,
64}; 67};
65 68
69static int da850_evm_mmc_get_ro(int index)
70{
71 return gpio_get_value(DA850_MMCSD_WP_PIN);
72}
73
74static int da850_evm_mmc_get_cd(int index)
75{
76 return !gpio_get_value(DA850_MMCSD_CD_PIN);
77}
78
79static struct davinci_mmc_config da850_mmc_config = {
80 .get_ro = da850_evm_mmc_get_ro,
81 .get_cd = da850_evm_mmc_get_cd,
82 .wires = 4,
83 .version = MMC_CTLR_VERSION_2,
84};
85
66static int da850_lcd_hw_init(void) 86static int da850_lcd_hw_init(void)
67{ 87{
68 int status; 88 int status;
@@ -134,6 +154,28 @@ static __init void da850_evm_init(void)
134 pr_warning("da830_evm_init: watchdog registration failed: %d\n", 154 pr_warning("da830_evm_init: watchdog registration failed: %d\n",
135 ret); 155 ret);
136 156
157 ret = da8xx_pinmux_setup(da850_mmcsd0_pins);
158 if (ret)
159 pr_warning("da850_evm_init: mmcsd0 mux setup failed: %d\n",
160 ret);
161
162 ret = gpio_request(DA850_MMCSD_CD_PIN, "MMC CD\n");
163 if (ret)
164 pr_warning("da850_evm_init: can not open GPIO %d\n",
165 DA850_MMCSD_CD_PIN);
166 gpio_direction_input(DA850_MMCSD_CD_PIN);
167
168 ret = gpio_request(DA850_MMCSD_WP_PIN, "MMC WP\n");
169 if (ret)
170 pr_warning("da850_evm_init: can not open GPIO %d\n",
171 DA850_MMCSD_WP_PIN);
172 gpio_direction_input(DA850_MMCSD_WP_PIN);
173
174 ret = da8xx_register_mmcsd0(&da850_mmc_config);
175 if (ret)
176 pr_warning("da850_evm_init: mmcsd0 registration failed: %d\n",
177 ret);
178
137 davinci_serial_init(&da850_evm_uart_config); 179 davinci_serial_init(&da850_evm_uart_config);
138 180
139 /* 181 /*