]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blame - include/linux/platform_data/mmc-omap.h
treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500
[mirror_ubuntu-hirsute-kernel.git] / include / linux / platform_data / mmc-omap.h
CommitLineData
d2912cb1 1/* SPDX-License-Identifier: GPL-2.0-only */
8777297b
KS
2/*
3 * MMC definitions for OMAP2
4 *
5 * Copyright (C) 2006 Nokia Corporation
8777297b
KS
6 */
7
8777297b
KS
8#define OMAP_MMC_MAX_SLOTS 2
9
68f39e74
TL
10struct mmc_card;
11
8777297b 12struct omap_mmc_platform_data {
01971f65
DB
13 /* back-link to device */
14 struct device *dev;
abfbe5f7 15
d8874665 16 /* number of slots per controller */
8777297b 17 unsigned nr_slots:2;
0a4b53a2 18
8777297b
KS
19 /* set if your board has components or wiring that limits the
20 * maximum frequency on the MMC bus */
21 unsigned int max_freq;
22
23 /* switch the bus to a new slot */
db0fefc5 24 int (*switch_slot)(struct device *dev, int slot);
8777297b
KS
25 /* initialize board-specific MMC functionality, can be NULL if
26 * not supported */
db0fefc5
AH
27 int (*init)(struct device *dev);
28 void (*cleanup)(struct device *dev);
29 void (*shutdown)(struct device *dev);
0a4b53a2 30
1887bde3
DK
31 /* Return context loss count due to PM states changing */
32 int (*get_context_loss_count)(struct device *dev);
33
6ab8946f
KK
34 /* Integrating attributes from the omap_hwmod layer */
35 u8 controller_flags;
36
91a0b089 37 /* Register offset deviation */
38 u16 reg_offset;
39
8777297b 40 struct omap_mmc_slot_data {
d8874665 41
63509e3c
TL
42 /*
43 * 4/8 wires and any additional host capabilities
44 * need to OR'd all capabilities (ref. linux/mmc/host.h)
45 */
46 u8 wires; /* Used for the MMC driver on omap1 and 2420 */
47 u32 caps; /* Used for the MMC driver on 2430 and later */
6fdc75de 48 u32 pm_caps; /* PM capabilities of the mmc */
90c62bf0 49
d8874665
TL
50 /*
51 * nomux means "standard" muxing is wrong on this board, and
52 * that board-specific code handled it before common init logic.
53 */
54 unsigned nomux:1;
55
56 /* switch pin can be for card detect (default) or card cover */
57 unsigned cover:1;
58
d8874665
TL
59 /* use the internal clock */
60 unsigned internal_clock:1;
90c62bf0 61
23d99bb9
AH
62 /* nonremovable e.g. eMMC */
63 unsigned nonremovable:1;
64
dd498eff
DK
65 /* Try to sleep or power off when possible */
66 unsigned power_saving:1;
67
1df58db8
AH
68 /* If using power_saving and the MMC power is not to go off */
69 unsigned no_off:1;
70
b1c1df7a
B
71 /* eMMC does not handle power off when not in sleep state */
72 unsigned no_regulator_off_init:1;
73
e0eb2424
AH
74 /* Regulator off remapped to sleep */
75 unsigned vcc_aux_disable_is_sleep:1;
76
03e7e170 77 /* we can put the features above into this variable */
8287361a
LT
78#define MMC_OMAP7XX (1 << 3)
79#define MMC_OMAP15XX (1 << 4)
80#define MMC_OMAP16XX (1 << 5)
03e7e170 81 unsigned features;
82
90c62bf0
TL
83 int switch_pin; /* gpio (card detect) */
84 int gpio_wp; /* gpio (write protect) */
d8874665 85
db0fefc5
AH
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);
ce6f0016 90 void (*remux)(struct device *dev, int slot, int power_on);
db0fefc5
AH
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);
4816858c
GI
97 /* if we have special card, init it using this callback */
98 void (*init_card)(struct mmc_card *card);
8777297b
KS
99
100 /* return MMC cover switch state, can be NULL if not supported.
101 *
102 * possible return values:
d8874665
TL
103 * 0 - closed
104 * 1 - open
8777297b 105 */
db0fefc5 106 int (*get_cover_state)(struct device *dev, int slot);
8777297b
KS
107
108 const char *name;
109 u32 ocr_mask;
0a4b53a2
TL
110
111 /* Card detection IRQs */
112 int card_detect_irq;
db0fefc5 113 int (*card_detect)(struct device *dev, int slot);
0a4b53a2
TL
114
115 unsigned int ban_openended:1;
116
8777297b
KS
117 } slots[OMAP_MMC_MAX_SLOTS];
118};