mmc-sdhci-s3c.h 2.2 KB

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