]>
Commit | Line | Data |
---|---|---|
8777297b KS |
1 | /* |
2 | * MMC definitions for OMAP2 | |
3 | * | |
4 | * Copyright (C) 2006 Nokia Corporation | |
5 | * | |
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. | |
9 | */ | |
10 | ||
8777297b KS |
11 | #define OMAP_MMC_MAX_SLOTS 2 |
12 | ||
9b68256c PW |
13 | /* |
14 | * struct omap_mmc_dev_attr.flags possibilities | |
15 | * | |
16 | * OMAP_HSMMC_SUPPORTS_DUAL_VOLT: Some HSMMC controller instances can | |
17 | * operate with either 1.8Vdc or 3.0Vdc card voltages; this flag | |
18 | * should be set if this is the case. See for example Section 22.5.3 | |
19 | * "MMC/SD/SDIO1 Bus Voltage Selection" of the OMAP34xx Multimedia | |
20 | * Device Silicon Revision 3.1.x Revision ZR (July 2011) (SWPU223R). | |
21 | * | |
22 | * OMAP_HSMMC_BROKEN_MULTIBLOCK_READ: Multiple-block read transfers | |
23 | * don't work correctly on some MMC controller instances on some | |
24 | * OMAP3 SoCs; this flag should be set if this is the case. See | |
25 | * for example Advisory 2.1.1.128 "MMC: Multiple Block Read | |
26 | * Operation Issue" in _OMAP3530/3525/3515/3503 Silicon Errata_ | |
27 | * Revision F (October 2010) (SPRZ278F). | |
28 | */ | |
29 | #define OMAP_HSMMC_SUPPORTS_DUAL_VOLT BIT(0) | |
30 | #define OMAP_HSMMC_BROKEN_MULTIBLOCK_READ BIT(1) | |
6ab8946f | 31 | |
68f39e74 TL |
32 | struct mmc_card; |
33 | ||
6ab8946f KK |
34 | struct omap_mmc_dev_attr { |
35 | u8 flags; | |
36 | }; | |
37 | ||
8777297b | 38 | struct omap_mmc_platform_data { |
01971f65 DB |
39 | /* back-link to device */ |
40 | struct device *dev; | |
abfbe5f7 | 41 | |
d8874665 | 42 | /* number of slots per controller */ |
8777297b | 43 | unsigned nr_slots:2; |
0a4b53a2 | 44 | |
8777297b KS |
45 | /* set if your board has components or wiring that limits the |
46 | * maximum frequency on the MMC bus */ | |
47 | unsigned int max_freq; | |
48 | ||
49 | /* switch the bus to a new slot */ | |
db0fefc5 | 50 | int (*switch_slot)(struct device *dev, int slot); |
8777297b KS |
51 | /* initialize board-specific MMC functionality, can be NULL if |
52 | * not supported */ | |
db0fefc5 AH |
53 | int (*init)(struct device *dev); |
54 | void (*cleanup)(struct device *dev); | |
55 | void (*shutdown)(struct device *dev); | |
0a4b53a2 TL |
56 | |
57 | /* To handle board related suspend/resume functionality for MMC */ | |
58 | int (*suspend)(struct device *dev, int slot); | |
59 | int (*resume)(struct device *dev, int slot); | |
8777297b | 60 | |
1887bde3 DK |
61 | /* Return context loss count due to PM states changing */ |
62 | int (*get_context_loss_count)(struct device *dev); | |
63 | ||
6ab8946f KK |
64 | /* Integrating attributes from the omap_hwmod layer */ |
65 | u8 controller_flags; | |
66 | ||
91a0b089 | 67 | /* Register offset deviation */ |
68 | u16 reg_offset; | |
69 | ||
8777297b | 70 | struct omap_mmc_slot_data { |
d8874665 | 71 | |
63509e3c TL |
72 | /* |
73 | * 4/8 wires and any additional host capabilities | |
74 | * need to OR'd all capabilities (ref. linux/mmc/host.h) | |
75 | */ | |
76 | u8 wires; /* Used for the MMC driver on omap1 and 2420 */ | |
77 | u32 caps; /* Used for the MMC driver on 2430 and later */ | |
6fdc75de | 78 | u32 pm_caps; /* PM capabilities of the mmc */ |
90c62bf0 | 79 | |
d8874665 TL |
80 | /* |
81 | * nomux means "standard" muxing is wrong on this board, and | |
82 | * that board-specific code handled it before common init logic. | |
83 | */ | |
84 | unsigned nomux:1; | |
85 | ||
86 | /* switch pin can be for card detect (default) or card cover */ | |
87 | unsigned cover:1; | |
88 | ||
d8874665 TL |
89 | /* use the internal clock */ |
90 | unsigned internal_clock:1; | |
90c62bf0 | 91 | |
23d99bb9 AH |
92 | /* nonremovable e.g. eMMC */ |
93 | unsigned nonremovable:1; | |
94 | ||
dd498eff DK |
95 | /* Try to sleep or power off when possible */ |
96 | unsigned power_saving:1; | |
97 | ||
1df58db8 AH |
98 | /* If using power_saving and the MMC power is not to go off */ |
99 | unsigned no_off:1; | |
100 | ||
b1c1df7a B |
101 | /* eMMC does not handle power off when not in sleep state */ |
102 | unsigned no_regulator_off_init:1; | |
103 | ||
e0eb2424 AH |
104 | /* Regulator off remapped to sleep */ |
105 | unsigned vcc_aux_disable_is_sleep:1; | |
106 | ||
03e7e170 | 107 | /* we can put the features above into this variable */ |
108 | #define HSMMC_HAS_PBIAS (1 << 0) | |
07ad64b6 | 109 | #define HSMMC_HAS_UPDATED_RESET (1 << 1) |
cd587096 | 110 | #define HSMMC_HAS_HSPE_SUPPORT (1 << 2) |
8287361a LT |
111 | #define MMC_OMAP7XX (1 << 3) |
112 | #define MMC_OMAP15XX (1 << 4) | |
113 | #define MMC_OMAP16XX (1 << 5) | |
03e7e170 | 114 | unsigned features; |
115 | ||
90c62bf0 TL |
116 | int switch_pin; /* gpio (card detect) */ |
117 | int gpio_wp; /* gpio (write protect) */ | |
d8874665 | 118 | |
db0fefc5 AH |
119 | int (*set_bus_mode)(struct device *dev, int slot, int bus_mode); |
120 | int (*set_power)(struct device *dev, int slot, | |
121 | int power_on, int vdd); | |
122 | int (*get_ro)(struct device *dev, int slot); | |
ce6f0016 | 123 | void (*remux)(struct device *dev, int slot, int power_on); |
db0fefc5 AH |
124 | /* Call back before enabling / disabling regulators */ |
125 | void (*before_set_reg)(struct device *dev, int slot, | |
126 | int power_on, int vdd); | |
127 | /* Call back after enabling / disabling regulators */ | |
128 | void (*after_set_reg)(struct device *dev, int slot, | |
129 | int power_on, int vdd); | |
4816858c GI |
130 | /* if we have special card, init it using this callback */ |
131 | void (*init_card)(struct mmc_card *card); | |
8777297b KS |
132 | |
133 | /* return MMC cover switch state, can be NULL if not supported. | |
134 | * | |
135 | * possible return values: | |
d8874665 TL |
136 | * 0 - closed |
137 | * 1 - open | |
8777297b | 138 | */ |
db0fefc5 | 139 | int (*get_cover_state)(struct device *dev, int slot); |
8777297b KS |
140 | |
141 | const char *name; | |
142 | u32 ocr_mask; | |
0a4b53a2 TL |
143 | |
144 | /* Card detection IRQs */ | |
145 | int card_detect_irq; | |
db0fefc5 | 146 | int (*card_detect)(struct device *dev, int slot); |
0a4b53a2 TL |
147 | |
148 | unsigned int ban_openended:1; | |
149 | ||
8777297b KS |
150 | } slots[OMAP_MMC_MAX_SLOTS]; |
151 | }; |