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 /* Return context loss count due to PM states changing */
35 int (*get_context_loss_count
)(struct device
*dev
);
37 /* Integrating attributes from the omap_hwmod layer */
40 /* Register offset deviation */
43 struct omap_mmc_slot_data
{
46 * 4/8 wires and any additional host capabilities
47 * need to OR'd all capabilities (ref. linux/mmc/host.h)
49 u8 wires
; /* Used for the MMC driver on omap1 and 2420 */
50 u32 caps
; /* Used for the MMC driver on 2430 and later */
51 u32 pm_caps
; /* PM capabilities of the mmc */
54 * nomux means "standard" muxing is wrong on this board, and
55 * that board-specific code handled it before common init logic.
59 /* switch pin can be for card detect (default) or card cover */
62 /* use the internal clock */
63 unsigned internal_clock
:1;
65 /* nonremovable e.g. eMMC */
66 unsigned nonremovable
:1;
68 /* Try to sleep or power off when possible */
69 unsigned power_saving
:1;
71 /* If using power_saving and the MMC power is not to go off */
74 /* eMMC does not handle power off when not in sleep state */
75 unsigned no_regulator_off_init
:1;
77 /* Regulator off remapped to sleep */
78 unsigned vcc_aux_disable_is_sleep
:1;
80 /* we can put the features above into this variable */
81 #define MMC_OMAP7XX (1 << 3)
82 #define MMC_OMAP15XX (1 << 4)
83 #define MMC_OMAP16XX (1 << 5)
86 int switch_pin
; /* gpio (card detect) */
87 int gpio_wp
; /* gpio (write protect) */
89 int (*set_bus_mode
)(struct device
*dev
, int slot
, int bus_mode
);
90 int (*set_power
)(struct device
*dev
, int slot
,
91 int power_on
, int vdd
);
92 int (*get_ro
)(struct device
*dev
, int slot
);
93 void (*remux
)(struct device
*dev
, int slot
, int power_on
);
94 /* Call back before enabling / disabling regulators */
95 void (*before_set_reg
)(struct device
*dev
, int slot
,
96 int power_on
, int vdd
);
97 /* Call back after enabling / disabling regulators */
98 void (*after_set_reg
)(struct device
*dev
, int slot
,
99 int power_on
, int vdd
);
100 /* if we have special card, init it using this callback */
101 void (*init_card
)(struct mmc_card
*card
);
103 /* return MMC cover switch state, can be NULL if not supported.
105 * possible return values:
109 int (*get_cover_state
)(struct device
*dev
, int slot
);
114 /* Card detection IRQs */
116 int (*card_detect
)(struct device
*dev
, int slot
);
118 unsigned int ban_openended
:1;
120 } slots
[OMAP_MMC_MAX_SLOTS
];