aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-omap1/board-innovator.c
diff options
context:
space:
mode:
authorTony Lindgren <tony@atomide.com>2008-12-10 20:37:16 -0500
committerTony Lindgren <tony@atomide.com>2008-12-10 20:37:16 -0500
commitd88746652b4d133284d1fdd05b5e999e8f44c998 (patch)
tree2a6cfd6fe175a18eb4b4f600e0a79444259c9a5d /arch/arm/mach-omap1/board-innovator.c
parent652bcd8f72cc0cdf4499ce7d73990514e5e3e4b9 (diff)
omap mmc: Add better MMC low-level init
This will simplify the MMC low-level init, and make it more flexible to add support for a newer MMC controller in the following patches. The patch rearranges platform data and gets rid of slot vs controller confusion in the old data structures. Also fix device id numbering in the clock code. Some code snippets are based on an earlier patch by Russell King <linux@arm.linux.org.uk>. Cc: Pierre Ossman <drzeus-mmc@drzeus.cx> Signed-off-by: Tony Lindgren <tony@atomide.com>
Diffstat (limited to 'arch/arm/mach-omap1/board-innovator.c')
-rw-r--r--arch/arm/mach-omap1/board-innovator.c50
1 files changed, 42 insertions, 8 deletions
diff --git a/arch/arm/mach-omap1/board-innovator.c b/arch/arm/mach-omap1/board-innovator.c
index a21e365a7a87..8ffb06fc0f08 100644
--- a/arch/arm/mach-omap1/board-innovator.c
+++ b/arch/arm/mach-omap1/board-innovator.c
@@ -39,6 +39,7 @@
39#include <mach/common.h> 39#include <mach/common.h>
40#include <mach/mcbsp.h> 40#include <mach/mcbsp.h>
41#include <mach/omap-alsa.h> 41#include <mach/omap-alsa.h>
42#include <mach/mmc.h>
42 43
43static int innovator_keymap[] = { 44static int innovator_keymap[] = {
44 KEY(0, 0, KEY_F1), 45 KEY(0, 0, KEY_F1),
@@ -360,16 +361,49 @@ static struct omap_lcd_config innovator1610_lcd_config __initdata = {
360}; 361};
361#endif 362#endif
362 363
363static struct omap_mmc_config innovator_mmc_config __initdata = { 364#if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE)
364 .mmc [0] = { 365
365 .enabled = 1, 366static int mmc_set_power(struct device *dev, int slot, int power_on,
366 .wire4 = 1, 367 int vdd)
367 .wp_pin = OMAP_MPUIO(3), 368{
368 .power_pin = -1, /* FPGA F3 UIO42 */ 369 if (power_on)
369 .switch_pin = -1, /* FPGA F4 UIO43 */ 370 fpga_write(fpga_read(OMAP1510_FPGA_POWER) | (1 << 3),
371 OMAP1510_FPGA_POWER);
372 else
373 fpga_write(fpga_read(OMAP1510_FPGA_POWER) & ~(1 << 3),
374 OMAP1510_FPGA_POWER);
375
376 return 0;
377}
378
379/*
380 * Innovator could use the following functions tested:
381 * - mmc_get_wp that uses OMAP_MPUIO(3)
382 * - mmc_get_cover_state that uses FPGA F4 UIO43
383 */
384static struct omap_mmc_platform_data mmc1_data = {
385 .nr_slots = 1,
386 .slots[0] = {
387 .set_power = mmc_set_power,
388 .wire4 = 1,
389 .name = "mmcblk",
370 }, 390 },
371}; 391};
372 392
393static struct omap_mmc_platform_data *mmc_data[OMAP16XX_NR_MMC];
394
395void __init innovator_mmc_init(void)
396{
397 mmc_data[0] = &mmc1_data;
398 omap1_init_mmc(mmc_data, OMAP15XX_NR_MMC);
399}
400
401#else
402static inline void innovator_mmc_init(void)
403{
404}
405#endif
406
373static struct omap_uart_config innovator_uart_config __initdata = { 407static struct omap_uart_config innovator_uart_config __initdata = {
374 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)), 408 .enabled_uarts = ((1 << 0) | (1 << 1) | (1 << 2)),
375}; 409};
@@ -377,7 +411,6 @@ static struct omap_uart_config innovator_uart_config __initdata = {
377static struct omap_board_config_kernel innovator_config[] = { 411static struct omap_board_config_kernel innovator_config[] = {
378 { OMAP_TAG_USB, NULL }, 412 { OMAP_TAG_USB, NULL },
379 { OMAP_TAG_LCD, NULL }, 413 { OMAP_TAG_LCD, NULL },
380 { OMAP_TAG_MMC, &innovator_mmc_config },
381 { OMAP_TAG_UART, &innovator_uart_config }, 414 { OMAP_TAG_UART, &innovator_uart_config },
382}; 415};
383 416
@@ -412,6 +445,7 @@ static void __init innovator_init(void)
412 omap_board_config_size = ARRAY_SIZE(innovator_config); 445 omap_board_config_size = ARRAY_SIZE(innovator_config);
413 omap_serial_init(); 446 omap_serial_init();
414 omap_register_i2c_bus(1, 100, NULL, 0); 447 omap_register_i2c_bus(1, 100, NULL, 0);
448 innovator_mmc_init();
415} 449}
416 450
417static void __init innovator_map_io(void) 451static void __init innovator_map_io(void)