mmc-s3cmci.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _ARCH_MCI_H
  3. #define _ARCH_MCI_H
  4. /**
  5. * struct s3c24xx_mci_pdata - sd/mmc controller platform data
  6. * @no_wprotect: Set this to indicate there is no write-protect switch.
  7. * @no_detect: Set this if there is no detect switch.
  8. * @wprotect_invert: Invert the default sense of the write protect switch.
  9. * @use_dma: Set to allow the use of DMA.
  10. * @gpio_detect: GPIO number for the card detect line.
  11. * @gpio_wprotect: GPIO number for the write protect line.
  12. * @ocr_avail: The mask of the available power states, non-zero to use.
  13. * @set_power: Callback to control the power mode.
  14. *
  15. * The @gpio_detect is used for card detection when @no_wprotect is unset,
  16. * and the default sense is that 0 returned from gpio_get_value() means
  17. * that a card is inserted. If @detect_invert is set, then the value from
  18. * gpio_get_value() is inverted, which makes 1 mean card inserted.
  19. *
  20. * The driver will use @gpio_wprotect to signal whether the card is write
  21. * protected if @no_wprotect is not set. A 0 returned from gpio_get_value()
  22. * means the card is read/write, and 1 means read-only. The @wprotect_invert
  23. * will invert the value returned from gpio_get_value().
  24. *
  25. * Card power is set by @ocr_availa, using MCC_VDD_ constants if it is set
  26. * to a non-zero value, otherwise the default of 3.2-3.4V is used.
  27. */
  28. struct s3c24xx_mci_pdata {
  29. unsigned int no_wprotect:1;
  30. unsigned int no_detect:1;
  31. unsigned int wprotect_invert:1;
  32. unsigned int use_dma:1;
  33. unsigned long ocr_avail;
  34. void (*set_power)(unsigned char power_mode,
  35. unsigned short vdd);
  36. struct gpio_desc *bus[6];
  37. };
  38. /**
  39. * s3c24xx_mci_set_platdata - set platform data for mmc/sdi device
  40. * @pdata: The platform data
  41. *
  42. * Copy the platform data supplied by @pdata so that this can be marked
  43. * __initdata.
  44. */
  45. extern void s3c24xx_mci_def_set_power(unsigned char power_mode, unsigned short vdd);
  46. extern void s3c24xx_mci_set_platdata(struct s3c24xx_mci_pdata *pdata);
  47. #endif /* _ARCH_NCI_H */