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.
11 #define OMAP_MMC_MAX_SLOTS 2
15 struct omap_mmc_platform_data {
16 /* back-link to device */
19 /* number of slots per controller */
22 /* set if your board has components or wiring that limits the
23 * maximum frequency on the MMC bus */
24 unsigned int max_freq;
26 /* switch the bus to a new slot */
27 int (*switch_slot)(struct device *dev, int slot);
28 /* initialize board-specific MMC functionality, can be NULL if
30 int (*init)(struct device *dev);
31 void (*cleanup)(struct device *dev);
32 void (*shutdown)(struct device *dev);
34 /* To handle board related suspend/resume functionality for MMC */
35 int (*suspend)(struct device *dev, int slot);
36 int (*resume)(struct device *dev, int slot);
38 /* Return context loss count due to PM states changing */
39 int (*get_context_loss_count)(struct device *dev);
41 /* Integrating attributes from the omap_hwmod layer */
44 /* Register offset deviation */
47 struct omap_mmc_slot_data {
50 * 4/8 wires and any additional host capabilities
51 * need to OR'd all capabilities (ref. linux/mmc/host.h)
53 u8 wires; /* Used for the MMC driver on omap1 and 2420 */
54 u32 caps; /* Used for the MMC driver on 2430 and later */
55 u32 pm_caps; /* PM capabilities of the mmc */
58 * nomux means "standard" muxing is wrong on this board, and
59 * that board-specific code handled it before common init logic.
63 /* switch pin can be for card detect (default) or card cover */
66 /* use the internal clock */
67 unsigned internal_clock:1;
69 /* nonremovable e.g. eMMC */
70 unsigned nonremovable:1;
72 /* Try to sleep or power off when possible */
73 unsigned power_saving:1;
75 /* If using power_saving and the MMC power is not to go off */
78 /* eMMC does not handle power off when not in sleep state */
79 unsigned no_regulator_off_init:1;
81 /* Regulator off remapped to sleep */
82 unsigned vcc_aux_disable_is_sleep:1;
84 /* we can put the features above into this variable */
85 #define MMC_OMAP7XX (1 << 3)
86 #define MMC_OMAP15XX (1 << 4)
87 #define MMC_OMAP16XX (1 << 5)
90 int switch_pin; /* gpio (card detect) */
91 int gpio_wp; /* gpio (write protect) */
93 int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
94 int (*set_power)(struct device *dev, int slot,
95 int power_on, int vdd);
96 int (*get_ro)(struct device *dev, int slot);
97 void (*remux)(struct device *dev, int slot, int power_on);
98 /* Call back before enabling / disabling regulators */
99 void (*before_set_reg)(struct device *dev, int slot,
100 int power_on, int vdd);
101 /* Call back after enabling / disabling regulators */
102 void (*after_set_reg)(struct device *dev, int slot,
103 int power_on, int vdd);
104 /* if we have special card, init it using this callback */
105 void (*init_card)(struct mmc_card *card);
107 /* return MMC cover switch state, can be NULL if not supported.
109 * possible return values:
113 int (*get_cover_state)(struct device *dev, int slot);
118 /* Card detection IRQs */
120 int (*card_detect)(struct device *dev, int slot);
122 unsigned int ban_openended:1;
124 } slots[OMAP_MMC_MAX_SLOTS];