linux/include/linux/spi/mmc_spi.h
<<
>>
Prefs
   1#ifndef __LINUX_SPI_MMC_SPI_H
   2#define __LINUX_SPI_MMC_SPI_H
   3
   4#include <linux/spi/spi.h>
   5#include <linux/interrupt.h>
   6
   7struct device;
   8struct mmc_host;
   9
  10/* Put this in platform_data of a device being used to manage an MMC/SD
  11 * card slot.  (Modeled after PXA mmc glue; see that for usage examples.)
  12 *
  13 * REVISIT This is not a spi-specific notion.  Any card slot should be
  14 * able to handle it.  If the MMC core doesn't adopt this kind of notion,
  15 * switch the "struct device *" parameters over to "struct spi_device *".
  16 */
  17struct mmc_spi_platform_data {
  18        /* driver activation and (optional) card detect irq hookup */
  19        int (*init)(struct device *,
  20                irqreturn_t (*)(int, void *),
  21                void *);
  22        void (*exit)(struct device *, void *);
  23
  24        /* sense switch on sd cards */
  25        int (*get_ro)(struct device *);
  26
  27        /*
  28         * If board does not use CD interrupts, driver can optimize polling
  29         * using this function.
  30         */
  31        int (*get_cd)(struct device *);
  32
  33        /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */
  34        unsigned long caps;
  35
  36        /* how long to debounce card detect, in msecs */
  37        u16 detect_delay;
  38
  39        /* power management */
  40        u16 powerup_msecs;              /* delay of up to 250 msec */
  41        u32 ocr_mask;                   /* available voltages */
  42        void (*setpower)(struct device *, unsigned int maskval);
  43};
  44
  45#ifdef CONFIG_OF
  46extern struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi);
  47extern void mmc_spi_put_pdata(struct spi_device *spi);
  48#else
  49static inline struct mmc_spi_platform_data *
  50mmc_spi_get_pdata(struct spi_device *spi)
  51{
  52        return spi->dev.platform_data;
  53}
  54static inline void mmc_spi_put_pdata(struct spi_device *spi) {}
  55#endif /* CONFIG_OF */
  56
  57#endif /* __LINUX_SPI_MMC_SPI_H */
  58