blob: a3626aedaec9350f9f17b19a12a6ade89a561b5c [file] [log] [blame]
David Brownell15a05802007-08-08 09:12:54 -07001#ifndef __LINUX_SPI_MMC_SPI_H
2#define __LINUX_SPI_MMC_SPI_H
3
Anton Vorontsov63e14622008-06-01 11:49:32 +02004#include <linux/interrupt.h>
5
David Brownell15a05802007-08-08 09:12:54 -07006struct device;
7struct mmc_host;
8
9/* Put this in platform_data of a device being used to manage an MMC/SD
10 * card slot. (Modeled after PXA mmc glue; see that for usage examples.)
11 *
12 * REVISIT This is not a spi-specific notion. Any card slot should be
13 * able to handle it. If the MMC core doesn't adopt this kind of notion,
14 * switch the "struct device *" parameters over to "struct spi_device *".
15 */
16struct mmc_spi_platform_data {
17 /* driver activation and (optional) card detect irq hookup */
18 int (*init)(struct device *,
19 irqreturn_t (*)(int, void *),
20 void *);
21 void (*exit)(struct device *, void *);
22
23 /* sense switch on sd cards */
24 int (*get_ro)(struct device *);
25
Anton Vorontsov619ef4b2008-06-17 18:17:21 +040026 /*
27 * If board does not use CD interrupts, driver can optimize polling
28 * using this function.
29 */
30 int (*get_cd)(struct device *);
31
32 /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */
33 unsigned long caps;
34
David Brownell15a05802007-08-08 09:12:54 -070035 /* how long to debounce card detect, in msecs */
36 u16 detect_delay;
37
38 /* power management */
39 u16 powerup_msecs; /* delay of up to 250 msec */
40 u32 ocr_mask; /* available voltages */
41 void (*setpower)(struct device *, unsigned int maskval);
42};
43
44#endif /* __LINUX_SPI_MMC_SPI_H */