mmc-sdhci-s3c.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef __PLATFORM_DATA_SDHCI_S3C_H
  3. #define __PLATFORM_DATA_SDHCI_S3C_H
  4. struct platform_device;
  5. enum cd_types {
  6. S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */
  7. S3C_SDHCI_CD_EXTERNAL, /* use external callback */
  8. S3C_SDHCI_CD_GPIO, /* use external gpio pin for CD line */
  9. S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */
  10. S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */
  11. };
  12. /**
  13. * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
  14. * @max_width: The maximum number of data bits supported.
  15. * @host_caps: Standard MMC host capabilities bit field.
  16. * @host_caps2: The second standard MMC host capabilities bit field.
  17. * @cd_type: Type of Card Detection method (see cd_types enum above)
  18. * @ext_cd_init: Initialize external card detect subsystem. Called on
  19. * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
  20. * notify_func argument is a callback to the sdhci-s3c driver
  21. * that triggers the card detection event. Callback arguments:
  22. * dev is pointer to platform device of the host controller,
  23. * state is new state of the card (0 - removed, 1 - inserted).
  24. * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on
  25. * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL.
  26. * notify_func argument is the same callback as for ext_cd_init.
  27. * @ext_cd_gpio: gpio pin used for external CD line, valid only if
  28. * cd_type == S3C_SDHCI_CD_GPIO
  29. * @ext_cd_gpio_invert: invert values for external CD gpio line
  30. * @cfg_gpio: Configure the GPIO for a specific card bit-width
  31. *
  32. * Initialisation data specific to either the machine or the platform
  33. * for the device driver to use or call-back when configuring gpio or
  34. * card speed information.
  35. */
  36. struct s3c_sdhci_platdata {
  37. unsigned int max_width;
  38. unsigned int host_caps;
  39. unsigned int host_caps2;
  40. unsigned int pm_caps;
  41. enum cd_types cd_type;
  42. int ext_cd_gpio;
  43. bool ext_cd_gpio_invert;
  44. int (*ext_cd_init)(void (*notify_func)(struct platform_device *,
  45. int state));
  46. int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *,
  47. int state));
  48. void (*cfg_gpio)(struct platform_device *dev, int width);
  49. };
  50. #endif /* __PLATFORM_DATA_SDHCI_S3C_H */