Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 */
0002 #ifndef __PLATFORM_DATA_SDHCI_S3C_H
0003 #define __PLATFORM_DATA_SDHCI_S3C_H
0004 
0005 struct platform_device;
0006 
0007 enum cd_types {
0008     S3C_SDHCI_CD_INTERNAL,  /* use mmc internal CD line */
0009     S3C_SDHCI_CD_EXTERNAL,  /* use external callback */
0010     S3C_SDHCI_CD_GPIO,  /* use external gpio pin for CD line */
0011     S3C_SDHCI_CD_NONE,  /* no CD line, use polling to detect card */
0012     S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */
0013 };
0014 
0015 /**
0016  * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
0017  * @max_width: The maximum number of data bits supported.
0018  * @host_caps: Standard MMC host capabilities bit field.
0019  * @host_caps2: The second standard MMC host capabilities bit field.
0020  * @cd_type: Type of Card Detection method (see cd_types enum above)
0021  * @ext_cd_init: Initialize external card detect subsystem. Called on
0022  *       sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
0023  *       notify_func argument is a callback to the sdhci-s3c driver
0024  *       that triggers the card detection event. Callback arguments:
0025  *       dev is pointer to platform device of the host controller,
0026  *       state is new state of the card (0 - removed, 1 - inserted).
0027  * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on
0028  *       sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL.
0029  *       notify_func argument is the same callback as for ext_cd_init.
0030  * @ext_cd_gpio: gpio pin used for external CD line, valid only if
0031  *       cd_type == S3C_SDHCI_CD_GPIO
0032  * @ext_cd_gpio_invert: invert values for external CD gpio line
0033  * @cfg_gpio: Configure the GPIO for a specific card bit-width
0034  *
0035  * Initialisation data specific to either the machine or the platform
0036  * for the device driver to use or call-back when configuring gpio or
0037  * card speed information.
0038 */
0039 struct s3c_sdhci_platdata {
0040     unsigned int    max_width;
0041     unsigned int    host_caps;
0042     unsigned int    host_caps2;
0043     unsigned int    pm_caps;
0044     enum cd_types   cd_type;
0045 
0046     int     ext_cd_gpio;
0047     bool        ext_cd_gpio_invert;
0048     int (*ext_cd_init)(void (*notify_func)(struct platform_device *,
0049                            int state));
0050     int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *,
0051                               int state));
0052 
0053     void    (*cfg_gpio)(struct platform_device *dev, int width);
0054 };
0055 
0056 
0057 #endif /* __PLATFORM_DATA_SDHCI_S3C_H */