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