diff options
author | Arnd Bergmann <arnd@arndb.de> | 2013-03-04 12:28:21 -0500 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2013-04-19 07:51:23 -0400 |
commit | cc014f3e29e15140e35e14fa194034baee92df2a (patch) | |
tree | 0cdd69202fef892fb3f14e4d8f534493329f166b | |
parent | f76da510d61a8793c990bee9acc10744ee2b2a8c (diff) |
mmc: sdhci-s3c: remove platform dependencies
plat/regs-sdhci.h is not used anywhere but in the sdhci-s3c
driver, so it can become a local file there and all other
inclusions removed.
plat/sdhci.h is used only to define the platform devices,
and with the exception of the platform_data structure not
needed by the driver, so we can split out the platform_data
definition instead and leave the rest to platform code.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Chris Ball <cjb@laptop.org>
-rw-r--r-- | arch/arm/mach-exynos/setup-sdhci-gpio.c | 2 | ||||
-rw-r--r-- | arch/arm/mach-s5pc100/setup-sdhci-gpio.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-s5pv210/setup-sdhci-gpio.c | 1 | ||||
-rw-r--r-- | arch/arm/plat-samsung/include/plat/sdhci.h | 56 | ||||
-rw-r--r-- | drivers/mmc/host/Kconfig | 2 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-s3c-regs.h (renamed from arch/arm/plat-samsung/include/plat/regs-sdhci.h) | 0 | ||||
-rw-r--r-- | drivers/mmc/host/sdhci-s3c.c | 5 | ||||
-rw-r--r-- | include/linux/platform_data/mmc-sdhci-s3c.h | 56 |
8 files changed, 61 insertions, 62 deletions
diff --git a/arch/arm/mach-exynos/setup-sdhci-gpio.c b/arch/arm/mach-exynos/setup-sdhci-gpio.c index e8d08bf8965a..d5b98c866738 100644 --- a/arch/arm/mach-exynos/setup-sdhci-gpio.c +++ b/arch/arm/mach-exynos/setup-sdhci-gpio.c | |||
@@ -19,8 +19,8 @@ | |||
19 | #include <linux/mmc/host.h> | 19 | #include <linux/mmc/host.h> |
20 | #include <linux/mmc/card.h> | 20 | #include <linux/mmc/card.h> |
21 | 21 | ||
22 | #include <mach/gpio.h> | ||
22 | #include <plat/gpio-cfg.h> | 23 | #include <plat/gpio-cfg.h> |
23 | #include <plat/regs-sdhci.h> | ||
24 | #include <plat/sdhci.h> | 24 | #include <plat/sdhci.h> |
25 | 25 | ||
26 | void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | 26 | void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) |
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c index 03c02d04c68c..6010c0310cb5 100644 --- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c +++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c | |||
@@ -19,7 +19,6 @@ | |||
19 | #include <linux/mmc/card.h> | 19 | #include <linux/mmc/card.h> |
20 | 20 | ||
21 | #include <plat/gpio-cfg.h> | 21 | #include <plat/gpio-cfg.h> |
22 | #include <plat/regs-sdhci.h> | ||
23 | #include <plat/sdhci.h> | 22 | #include <plat/sdhci.h> |
24 | 23 | ||
25 | void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | 24 | void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) |
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c index 3e3ac05bb7b1..0512ada00522 100644 --- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c +++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include <linux/mmc/card.h> | 20 | #include <linux/mmc/card.h> |
21 | 21 | ||
22 | #include <plat/gpio-cfg.h> | 22 | #include <plat/gpio-cfg.h> |
23 | #include <plat/regs-sdhci.h> | ||
24 | #include <plat/sdhci.h> | 23 | #include <plat/sdhci.h> |
25 | 24 | ||
26 | void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | 25 | void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) |
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h index 9b87f38fc4f4..1e0aab08c13f 100644 --- a/arch/arm/plat-samsung/include/plat/sdhci.h +++ b/arch/arm/plat-samsung/include/plat/sdhci.h | |||
@@ -18,62 +18,9 @@ | |||
18 | #ifndef __PLAT_S3C_SDHCI_H | 18 | #ifndef __PLAT_S3C_SDHCI_H |
19 | #define __PLAT_S3C_SDHCI_H __FILE__ | 19 | #define __PLAT_S3C_SDHCI_H __FILE__ |
20 | 20 | ||
21 | #include <linux/platform_data/mmc-sdhci-s3c.h> | ||
21 | #include <plat/devs.h> | 22 | #include <plat/devs.h> |
22 | 23 | ||
23 | struct platform_device; | ||
24 | struct mmc_host; | ||
25 | struct mmc_card; | ||
26 | struct mmc_ios; | ||
27 | |||
28 | enum cd_types { | ||
29 | S3C_SDHCI_CD_INTERNAL, /* use mmc internal CD line */ | ||
30 | S3C_SDHCI_CD_EXTERNAL, /* use external callback */ | ||
31 | S3C_SDHCI_CD_GPIO, /* use external gpio pin for CD line */ | ||
32 | S3C_SDHCI_CD_NONE, /* no CD line, use polling to detect card */ | ||
33 | S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */ | ||
34 | }; | ||
35 | |||
36 | /** | ||
37 | * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI | ||
38 | * @max_width: The maximum number of data bits supported. | ||
39 | * @host_caps: Standard MMC host capabilities bit field. | ||
40 | * @host_caps2: The second standard MMC host capabilities bit field. | ||
41 | * @cd_type: Type of Card Detection method (see cd_types enum above) | ||
42 | * @ext_cd_init: Initialize external card detect subsystem. Called on | ||
43 | * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL. | ||
44 | * notify_func argument is a callback to the sdhci-s3c driver | ||
45 | * that triggers the card detection event. Callback arguments: | ||
46 | * dev is pointer to platform device of the host controller, | ||
47 | * state is new state of the card (0 - removed, 1 - inserted). | ||
48 | * @ext_cd_cleanup: Cleanup external card detect subsystem. Called on | ||
49 | * sdhci-s3c driver remove when cd_type == S3C_SDHCI_CD_EXTERNAL. | ||
50 | * notify_func argument is the same callback as for ext_cd_init. | ||
51 | * @ext_cd_gpio: gpio pin used for external CD line, valid only if | ||
52 | * cd_type == S3C_SDHCI_CD_GPIO | ||
53 | * @ext_cd_gpio_invert: invert values for external CD gpio line | ||
54 | * @cfg_gpio: Configure the GPIO for a specific card bit-width | ||
55 | * | ||
56 | * Initialisation data specific to either the machine or the platform | ||
57 | * for the device driver to use or call-back when configuring gpio or | ||
58 | * card speed information. | ||
59 | */ | ||
60 | struct s3c_sdhci_platdata { | ||
61 | unsigned int max_width; | ||
62 | unsigned int host_caps; | ||
63 | unsigned int host_caps2; | ||
64 | unsigned int pm_caps; | ||
65 | enum cd_types cd_type; | ||
66 | |||
67 | int ext_cd_gpio; | ||
68 | bool ext_cd_gpio_invert; | ||
69 | int (*ext_cd_init)(void (*notify_func)(struct platform_device *, | ||
70 | int state)); | ||
71 | int (*ext_cd_cleanup)(void (*notify_func)(struct platform_device *, | ||
72 | int state)); | ||
73 | |||
74 | void (*cfg_gpio)(struct platform_device *dev, int width); | ||
75 | }; | ||
76 | |||
77 | /* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data | 24 | /* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data |
78 | * @pd: The default platform data for this device. | 25 | * @pd: The default platform data for this device. |
79 | * @set: Pointer to the platform data to fill in. | 26 | * @set: Pointer to the platform data to fill in. |
@@ -378,5 +325,4 @@ static inline void s3c_sdhci_setname(int id, char *name) | |||
378 | break; | 325 | break; |
379 | } | 326 | } |
380 | } | 327 | } |
381 | |||
382 | #endif /* __PLAT_S3C_SDHCI_H */ | 328 | #endif /* __PLAT_S3C_SDHCI_H */ |
diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index d88219e1d86e..d0547448606d 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig | |||
@@ -180,7 +180,7 @@ config MMC_SDHCI_TEGRA | |||
180 | 180 | ||
181 | config MMC_SDHCI_S3C | 181 | config MMC_SDHCI_S3C |
182 | tristate "SDHCI support on Samsung S3C SoC" | 182 | tristate "SDHCI support on Samsung S3C SoC" |
183 | depends on MMC_SDHCI && PLAT_SAMSUNG | 183 | depends on MMC_SDHCI && PLAT_SAMSUNG_SINGLE |
184 | help | 184 | help |
185 | This selects the Secure Digital Host Controller Interface (SDHCI) | 185 | This selects the Secure Digital Host Controller Interface (SDHCI) |
186 | often referrered to as the HSMMC block in some of the Samsung S3C | 186 | often referrered to as the HSMMC block in some of the Samsung S3C |
diff --git a/arch/arm/plat-samsung/include/plat/regs-sdhci.h b/drivers/mmc/host/sdhci-s3c-regs.h index e34049ad44cc..e34049ad44cc 100644 --- a/arch/arm/plat-samsung/include/plat/regs-sdhci.h +++ b/drivers/mmc/host/sdhci-s3c-regs.h | |||
diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c index 7363efe72287..e4f52b5c2592 100644 --- a/drivers/mmc/host/sdhci-s3c.c +++ b/drivers/mmc/host/sdhci-s3c.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/delay.h> | 15 | #include <linux/delay.h> |
16 | #include <linux/dma-mapping.h> | 16 | #include <linux/dma-mapping.h> |
17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
18 | #include <linux/platform_data/mmc-sdhci-s3c.h> | ||
18 | #include <linux/slab.h> | 19 | #include <linux/slab.h> |
19 | #include <linux/clk.h> | 20 | #include <linux/clk.h> |
20 | #include <linux/io.h> | 21 | #include <linux/io.h> |
@@ -28,9 +29,7 @@ | |||
28 | 29 | ||
29 | #include <linux/mmc/host.h> | 30 | #include <linux/mmc/host.h> |
30 | 31 | ||
31 | #include <plat/sdhci.h> | 32 | #include "sdhci-s3c-regs.h" |
32 | #include <plat/regs-sdhci.h> | ||
33 | |||
34 | #include "sdhci.h" | 33 | #include "sdhci.h" |
35 | 34 | ||
36 | #define MAX_BUS_CLK (4) | 35 | #define MAX_BUS_CLK (4) |
diff --git a/include/linux/platform_data/mmc-sdhci-s3c.h b/include/linux/platform_data/mmc-sdhci-s3c.h new file mode 100644 index 000000000000..249f02387a35 --- /dev/null +++ b/include/linux/platform_data/mmc-sdhci-s3c.h | |||
@@ -0,0 +1,56 @@ | |||
1 | #ifndef __PLATFORM_DATA_SDHCI_S3C_H | ||
2 | #define __PLATFORM_DATA_SDHCI_S3C_H | ||
3 | |||
4 | struct platform_device; | ||
5 | |||
6 | enum 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 | */ | ||
38 | struct 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 */ | ||