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 /* initialize board-specific MMC functionality, can be NULL if
25 int (*init)(struct device *dev);
26 void (*cleanup)(struct device *dev);
27 void (*shutdown)(struct device *dev);
29 /* Return context loss count due to PM states changing */
30 int (*get_context_loss_count)(struct device *dev);
32 /* Integrating attributes from the omap_hwmod layer */
35 /* Register offset deviation */
38 struct omap_mmc_slot_data {
41 * 4/8 wires and any additional host capabilities
42 * need to OR'd all capabilities (ref. linux/mmc/host.h)
44 u8 wires; /* Used for the MMC driver on omap1 and 2420 */
45 u32 caps; /* Used for the MMC driver on 2430 and later */
46 u32 pm_caps; /* PM capabilities of the mmc */
49 * nomux means "standard" muxing is wrong on this board, and
50 * that board-specific code handled it before common init logic.
54 /* switch pin can be for card detect (default) or card cover */
57 /* use the internal clock */
58 unsigned internal_clock:1;
60 /* nonremovable e.g. eMMC */
61 unsigned nonremovable:1;
63 /* Try to sleep or power off when possible */
64 unsigned power_saving:1;
66 /* If using power_saving and the MMC power is not to go off */
69 /* eMMC does not handle power off when not in sleep state */
70 unsigned no_regulator_off_init:1;
72 /* Regulator off remapped to sleep */
73 unsigned vcc_aux_disable_is_sleep:1;
75 /* we can put the features above into this variable */
76 #define MMC_OMAP7XX (1 << 3)
77 #define MMC_OMAP15XX (1 << 4)
78 #define MMC_OMAP16XX (1 << 5)
81 int switch_pin; /* gpio (card detect) */
82 int gpio_wp; /* gpio (write protect) */
84 int (*set_bus_mode)(struct device *dev, int slot, int bus_mode);
85 int (*set_power)(struct device *dev, int slot,
86 int power_on, int vdd);
87 int (*get_ro)(struct device *dev, int slot);
88 void (*remux)(struct device *dev, int slot, int power_on);
89 /* Call back before enabling / disabling regulators */
90 void (*before_set_reg)(struct device *dev, int slot,
91 int power_on, int vdd);
92 /* Call back after enabling / disabling regulators */
93 void (*after_set_reg)(struct device *dev, int slot,
94 int power_on, int vdd);
95 /* if we have special card, init it using this callback */
96 void (*init_card)(struct mmc_card *card);
98 /* return MMC cover switch state, can be NULL if not supported.
100 * possible return values:
104 int (*get_cover_state)(struct device *dev, int slot);
110 int (*card_detect)(struct device *dev, int slot);
112 unsigned int ban_openended:1;
114 } slots[OMAP_MMC_MAX_SLOTS];
117 extern void omap_mmc_notify_cover_event(struct device *dev, int slot,