|
29 | 29 | #include <linux/mmc/host.h>
|
30 | 30 | #include <linux/mmc/sdio.h>
|
31 | 31 |
|
32 |
| -#include <linux/atmel-mci.h> |
33 | 32 | #include <linux/atmel_pdc.h>
|
34 | 33 | #include <linux/pm.h>
|
35 | 34 | #include <linux/pm_runtime.h>
|
|
39 | 38 | #include <asm/io.h>
|
40 | 39 | #include <asm/unaligned.h>
|
41 | 40 |
|
| 41 | +#define ATMCI_MAX_NR_SLOTS 2 |
| 42 | + |
42 | 43 | /*
|
43 | 44 | * Superset of MCI IP registers integrated in Atmel AT91 Processor
|
44 | 45 | * Registers and bitfields marked with [2] are only available in MCI2
|
@@ -200,6 +201,42 @@ enum atmci_pdc_buf {
|
200 | 201 | PDC_SECOND_BUF,
|
201 | 202 | };
|
202 | 203 |
|
| 204 | +/** |
| 205 | + * struct mci_slot_pdata - board-specific per-slot configuration |
| 206 | + * @bus_width: Number of data lines wired up the slot |
| 207 | + * @detect_pin: GPIO pin wired to the card detect switch |
| 208 | + * @wp_pin: GPIO pin wired to the write protect sensor |
| 209 | + * @detect_is_active_high: The state of the detect pin when it is active |
| 210 | + * @non_removable: The slot is not removable, only detect once |
| 211 | + * |
| 212 | + * If a given slot is not present on the board, @bus_width should be |
| 213 | + * set to 0. The other fields are ignored in this case. |
| 214 | + * |
| 215 | + * Any pins that aren't available should be set to a negative value. |
| 216 | + * |
| 217 | + * Note that support for multiple slots is experimental -- some cards |
| 218 | + * might get upset if we don't get the clock management exactly right. |
| 219 | + * But in most cases, it should work just fine. |
| 220 | + */ |
| 221 | +struct mci_slot_pdata { |
| 222 | + unsigned int bus_width; |
| 223 | + struct gpio_desc *detect_pin; |
| 224 | + struct gpio_desc *wp_pin; |
| 225 | + bool detect_is_active_high; |
| 226 | + bool non_removable; |
| 227 | +}; |
| 228 | + |
| 229 | +/** |
| 230 | + * struct mci_platform_data - board-specific MMC/SDcard configuration |
| 231 | + * @dma_slave: DMA slave interface to use in data transfers. |
| 232 | + * @slot: Per-slot configuration data. |
| 233 | + */ |
| 234 | +struct mci_platform_data { |
| 235 | + void *dma_slave; |
| 236 | + dma_filter_fn dma_filter; |
| 237 | + struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS]; |
| 238 | +}; |
| 239 | + |
203 | 240 | struct atmel_mci_caps {
|
204 | 241 | bool has_dma_conf_reg;
|
205 | 242 | bool has_pdc;
|
|
0 commit comments