2 * MMC definitions for OMAP2
4 * Copyright (C) 2006 Nokia Corporation
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
14 #include <linux/types.h>
15 #include <linux/device.h>
16 #include <linux/mmc/host.h>
18 #include <mach/board.h>
20 #define OMAP_MMC_MAX_SLOTS 2
22 struct omap_mmc_platform_data {
24 /* number of slots on board */
27 /* set if your board has components or wiring that limits the
28 * maximum frequency on the MMC bus */
29 unsigned int max_freq;
31 /* switch the bus to a new slot */
32 int (* switch_slot)(struct device *dev, int slot);
33 /* initialize board-specific MMC functionality, can be NULL if
35 int (* init)(struct device *dev);
36 void (* cleanup)(struct device *dev);
37 void (* shutdown)(struct device *dev);
39 /* To handle board related suspend/resume functionality for MMC */
40 int (*suspend)(struct device *dev, int slot);
41 int (*resume)(struct device *dev, int slot);
43 struct omap_mmc_slot_data {
48 * nomux means "standard" muxing is wrong on this board, and
49 * that board-specific code handled it before common init logic.
53 /* switch pin can be for card detect (default) or card cover */
56 /* 4 wire signaling is optional, and is only used for SD/SDIO */
59 /* use the internal clock */
60 unsigned internal_clock:1;
65 int (* set_bus_mode)(struct device *dev, int slot, int bus_mode);
66 int (* set_power)(struct device *dev, int slot, int power_on, int vdd);
67 int (* get_ro)(struct device *dev, int slot);
69 /* return MMC cover switch state, can be NULL if not supported.
71 * possible return values:
75 int (* get_cover_state)(struct device *dev, int slot);
80 /* Card detection IRQs */
82 int (* card_detect)(int irq);
84 unsigned int ban_openended:1;
86 } slots[OMAP_MMC_MAX_SLOTS];
89 /* called from board-specific card detection service routine */
90 extern void omap_mmc_notify_cover_event(struct device *dev, int slot, int is_closed);
92 #if defined(CONFIG_MMC_OMAP) || defined(CONFIG_MMC_OMAP_MODULE) || \
93 defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
94 void omap1_init_mmc(struct omap_mmc_platform_data *info);
95 void omap2_init_mmc(struct omap_mmc_platform_data *info);
96 void omap_init_mmc(struct omap_mmc_platform_data *info,
97 struct platform_device *pdev1, struct platform_device *pdev2);
99 static inline void omap1_init_mmc(struct omap_mmc_platform_data *info)
102 static inline void omap2_init_mmc(struct omap_mmc_platform_data *info)
105 static inline void omap_init_mmc(struct omap_mmc_platform_data *info,
106 struct platform_device *pdev1, struct platform_device *pdev2)
111 #if defined(CONFIG_MMC_OMAP_HS) || defined(CONFIG_MMC_OMAP_HS_MODULE)
112 void __init hsmmc_init(void);