blob: 42a9e1884842e9631f7e83b2381850c4ce474f22 [file] [log] [blame]
Nicolas Ferrec42aa772008-11-20 15:59:12 +01001#ifndef __LINUX_ATMEL_MCI_H
2#define __LINUX_ATMEL_MCI_H
Haavard Skinnemoen7d2be072008-06-30 18:35:03 +02003
Hans-Christian Egtvedt8ca28612014-08-07 15:14:06 +02004#include <linux/types.h>
Mans Rullgard74843782016-01-09 12:45:10 +00005#include <linux/dmaengine.h>
Hans-Christian Egtvedt8ca28612014-08-07 15:14:06 +02006
Ludovic Desroches2c96a292011-08-11 15:25:41 +00007#define ATMCI_MAX_NR_SLOTS 2
Haavard Skinnemoen965ebf32008-09-17 20:53:55 +02008
Haavard Skinnemoen6b918652008-08-07 14:08:49 +02009/**
10 * struct mci_slot_pdata - board-specific per-slot configuration
11 * @bus_width: Number of data lines wired up the slot
12 * @detect_pin: GPIO pin wired to the card detect switch
13 * @wp_pin: GPIO pin wired to the write protect sensor
Jonas Larsson1c1452b2009-03-31 11:16:48 +020014 * @detect_is_active_high: The state of the detect pin when it is active
Timo Kokkonen76d55562014-11-03 13:12:59 +020015 * @non_removable: The slot is not removable, only detect once
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020016 *
17 * If a given slot is not present on the board, @bus_width should be
18 * set to 0. The other fields are ignored in this case.
19 *
20 * Any pins that aren't available should be set to a negative value.
Haavard Skinnemoen965ebf32008-09-17 20:53:55 +020021 *
22 * Note that support for multiple slots is experimental -- some cards
23 * might get upset if we don't get the clock management exactly right.
24 * But in most cases, it should work just fine.
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020025 */
26struct mci_slot_pdata {
27 unsigned int bus_width;
Haavard Skinnemoen7d2be072008-06-30 18:35:03 +020028 int detect_pin;
29 int wp_pin;
Jonas Larsson1c1452b2009-03-31 11:16:48 +020030 bool detect_is_active_high;
Timo Kokkonen76d55562014-11-03 13:12:59 +020031 bool non_removable;
Haavard Skinnemoen7d2be072008-06-30 18:35:03 +020032};
33
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020034/**
35 * struct mci_platform_data - board-specific MMC/SDcard configuration
Dan Williams74465b42009-01-06 11:38:16 -070036 * @dma_slave: DMA slave interface to use in data transfers.
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020037 * @slot: Per-slot configuration data.
38 */
39struct mci_platform_data {
Mans Rullgard238d1c62016-01-09 12:45:11 +000040 void *dma_slave;
Mans Rullgard74843782016-01-09 12:45:10 +000041 dma_filter_fn dma_filter;
Ludovic Desroches2c96a292011-08-11 15:25:41 +000042 struct mci_slot_pdata slot[ATMCI_MAX_NR_SLOTS];
Haavard Skinnemoen6b918652008-08-07 14:08:49 +020043};
44
Nicolas Ferrec42aa772008-11-20 15:59:12 +010045#endif /* __LINUX_ATMEL_MCI_H */