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