mmc_spi.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __LINUX_SPI_MMC_SPI_H
  3. #define __LINUX_SPI_MMC_SPI_H
  4. #include <linux/spi/spi.h>
  5. #include <linux/interrupt.h>
  6. struct device;
  7. struct mmc_host;
  8. /* Put this in platform_data of a device being used to manage an MMC/SD
  9. * card slot. (Modeled after PXA mmc glue; see that for usage examples.)
  10. *
  11. * REVISIT This is not a spi-specific notion. Any card slot should be
  12. * able to handle it. If the MMC core doesn't adopt this kind of notion,
  13. * switch the "struct device *" parameters over to "struct spi_device *".
  14. */
  15. struct mmc_spi_platform_data {
  16. /* driver activation and (optional) card detect irq hookup */
  17. int (*init)(struct device *,
  18. irqreturn_t (*)(int, void *),
  19. void *);
  20. void (*exit)(struct device *, void *);
  21. /* Capabilities to pass into mmc core (e.g. MMC_CAP_NEEDS_POLL). */
  22. unsigned long caps;
  23. unsigned long caps2;
  24. /* how long to debounce card detect, in msecs */
  25. u16 detect_delay;
  26. /* power management */
  27. u16 powerup_msecs; /* delay of up to 250 msec */
  28. u32 ocr_mask; /* available voltages */
  29. void (*setpower)(struct device *, unsigned int maskval);
  30. };
  31. extern struct mmc_spi_platform_data *mmc_spi_get_pdata(struct spi_device *spi);
  32. extern void mmc_spi_put_pdata(struct spi_device *spi);
  33. #endif /* __LINUX_SPI_MMC_SPI_H */