diff options
author | Anton Vorontsov <avorontsov@ru.mvista.com> | 2008-12-30 10:15:28 -0500 |
---|---|---|
committer | Pierre Ossman <drzeus@drzeus.cx> | 2008-12-31 13:01:55 -0500 |
commit | 9c43df57910bbba540a6cb5c9132302a9ea5f41a (patch) | |
tree | a3f7debf605e4ad9a9d61a775222c5b6d738da26 /include/linux/spi/mmc_spi.h | |
parent | c00a46abd4d45a67ff62f4ff6d4f839dff38b877 (diff) |
mmc_spi: Add support for OpenFirmware bindings
The support is implemented via platform data accessors, new module
(of_mmc_spi) will be created automatically when the driver compiles
on OpenFirmware platforms. Link-time dependency will load the module
automatically.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'include/linux/spi/mmc_spi.h')
-rw-r--r-- | include/linux/spi/mmc_spi.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/include/linux/spi/mmc_spi.h b/include/linux/spi/mmc_spi.h index a3626aedaec9..0f4eb165f254 100644 --- a/include/linux/spi/mmc_spi.h +++ b/include/linux/spi/mmc_spi.h | |||
@@ -1,9 +1,10 @@ | |||
1 | #ifndef __LINUX_SPI_MMC_SPI_H | 1 | #ifndef __LINUX_SPI_MMC_SPI_H |
2 | #define __LINUX_SPI_MMC_SPI_H | 2 | #define __LINUX_SPI_MMC_SPI_H |
3 | 3 | ||
4 | #include <linux/device.h> | ||
5 | #include <linux/spi/spi.h> | ||
4 | #include <linux/interrupt.h> | 6 | #include <linux/interrupt.h> |
5 | 7 | ||
6 | struct device; | ||
7 | struct mmc_host; | 8 | struct mmc_host; |
8 | 9 | ||
9 | /* Put this in platform_data of a device being used to manage an MMC/SD | 10 | /* Put this in platform_data of a device being used to manage an MMC/SD |
@@ -41,4 +42,16 @@ struct mmc_spi_platform_data { | |||
41 | void (*setpower)(struct device *, unsigned int maskval); | 42 | void (*setpower)(struct device *, unsigned int maskval); |
42 | }; | 43 | }; |
43 | 44 | ||
45 | #ifdef CONFIG_OF | ||
46 | extern struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi); | ||
47 | extern void mmc_spi_put_pdata(struct spi_device *spi); | ||
48 | #else | ||
49 | static inline struct mmc_spi_platform_data * | ||
50 | mmc_spi_get_pdata(struct spi_device *spi) | ||
51 | { | ||
52 | return spi->dev.platform_data; | ||
53 | } | ||
54 | static inline void mmc_spi_put_pdata(struct spi_device *spi) {} | ||
55 | #endif /* CONFIG_OF */ | ||
56 | |||
44 | #endif /* __LINUX_SPI_MMC_SPI_H */ | 57 | #endif /* __LINUX_SPI_MMC_SPI_H */ |