1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * MMC definitions for OMAP2
5 * Copyright (C) 2006 Nokia Corporation
8 #define OMAP_MMC_MAX_SLOTS 2
12 struct omap_mmc_platform_data {
13 /* back-link to device */
16 /* number of slots per controller */
19 /* set if your board has components or wiring that limits the
20 * maximum frequency on the MMC bus */
21 unsigned int max_freq;
23 /* switch the bus to a new slot */
24 int (*switch_slot)(struct device *dev, int slot);
25 /* initialize board-specific MMC functionality, can be NULL if
27 int (*init)(struct device *dev);
28 void (*cleanup)(struct device *dev);
29 void (*shutdown)(struct device *dev);
31 /* Return context loss count due to PM states changing */
32 int (*get_context_loss_count)(struct device *dev);
34 /* Integrating attributes from the omap_hwmod layer */
37 /* Register offset deviation */
40 struct omap_mmc_slot_data {
43 * 4/8 wires and any additional host capabilities
44 * need to OR'd all capabilities (ref. linux/mmc/host.h)
46 u8 wires; /* Used for the MMC driver on omap1 and 2420 */
47 u32 caps; /* Used for the MMC driver on 2430 and later */
48 u32 pm_caps; /* PM capabilities of the mmc */
51 * nomux means "standard" muxing is wrong on this board, and
52 * that board-specific code handled it before common init logic.
56 /* switch pin can be for card detect (default) or card cover */
59 /* use the internal clock */
60 unsigned internal_clock:1;
62 /* nonremovable e.g. eMMC */
63 unsigned nonremovable:1;
65 /* Try to sleep or power off when possible */
66 unsigned power_saving:1;
68 /* If using power_saving and the MMC power is not to go off */
71 /* eMMC does not handle power off when not in sleep state */
72 unsigned no_regulator_off_init:1;
74 /* Regulator off remapped to sleep */
75 unsigned vcc_aux_disable_is_sleep:1;
77 /* we can put the features above into this variable */
78 #define MMC_OMAP7XX (1 << 3)
79 #define MMC_OMAP15XX (1 << 4)
80 #define MMC_OMAP16XX (1 << 5)
83 int switch_pin; /* gpio (card detect) */
84 int gpio_wp; /* gpio (write protect) */
86 int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
87 int (*set_power)(struct device *dev, int slot,
88 int power_on, int vdd);
89 int (*get_ro)(struct device *dev, int slot);
90 void (*remux)(struct device *dev, int slot, int power_on);
91 /* Call back before enabling / disabling regulators */
92 void (*before_set_reg)(struct device *dev, int slot,
93 int power_on, int vdd);
94 /* Call back after enabling / disabling regulators */
95 void (*after_set_reg)(struct device *dev, int slot,
96 int power_on, int vdd);
97 /* if we have special card, init it using this callback */
98 void (*init_card)(struct mmc_card *card);
100 /* return MMC cover switch state, can be NULL if not supported.
102 * possible return values:
106 int (*get_cover_state)(struct device *dev, int slot);
111 /* Card detection IRQs */
113 int (*card_detect)(struct device *dev, int slot);
115 unsigned int ban_openended:1;
117 } slots[OMAP_MMC_MAX_SLOTS];
120 extern void omap_mmc_notify_cover_event(struct device *dev, int slot,