Skip to content

Commit cc014f3

Browse files
committed
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>
1 parent f76da51 commit cc014f3

8 files changed

Lines changed: 61 additions & 62 deletions

File tree

‎arch/arm/mach-exynos/setup-sdhci-gpio.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
#include <linux/mmc/host.h>
2020
#include <linux/mmc/card.h>
2121

22+
#include <mach/gpio.h>
2223
#include <plat/gpio-cfg.h>
23-
#include <plat/regs-sdhci.h>
2424
#include <plat/sdhci.h>
2525

2626
void exynos4_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)

‎arch/arm/mach-s5pc100/setup-sdhci-gpio.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include <linux/mmc/card.h>
2020

2121
#include <plat/gpio-cfg.h>
22-
#include <plat/regs-sdhci.h>
2322
#include <plat/sdhci.h>
2423

2524
void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)

‎arch/arm/mach-s5pv210/setup-sdhci-gpio.c‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include <linux/mmc/card.h>
2121

2222
#include <plat/gpio-cfg.h>
23-
#include <plat/regs-sdhci.h>
2423
#include <plat/sdhci.h>
2524

2625
void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)

‎arch/arm/plat-samsung/include/plat/sdhci.h‎

Lines changed: 1 addition & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -18,62 +18,9 @@
1818
#ifndef __PLAT_S3C_SDHCI_H
1919
#define __PLAT_S3C_SDHCI_H __FILE__
2020

21+
#include <linux/platform_data/mmc-sdhci-s3c.h>
2122
#include <plat/devs.h>
2223

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-
7724
/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
7825
* @pd: The default platform data for this device.
7926
* @set: Pointer to the platform data to fill in.
@@ -378,5 +325,4 @@ static inline void s3c_sdhci_setname(int id, char *name)
378325
break;
379326
}
380327
}
381-
382328
#endif /* __PLAT_S3C_SDHCI_H */

‎drivers/mmc/host/Kconfig‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ config MMC_SDHCI_TEGRA
180180

181181
config MMC_SDHCI_S3C
182182
tristate "SDHCI support on Samsung S3C SoC"
183-
depends on MMC_SDHCI && PLAT_SAMSUNG
183+
depends on MMC_SDHCI && PLAT_SAMSUNG_SINGLE
184184
help
185185
This selects the Secure Digital Host Controller Interface (SDHCI)
186186
often referrered to as the HSMMC block in some of the Samsung S3C
File renamed without changes.

‎drivers/mmc/host/sdhci-s3c.c‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/delay.h>
1616
#include <linux/dma-mapping.h>
1717
#include <linux/platform_device.h>
18+
#include <linux/platform_data/mmc-sdhci-s3c.h>
1819
#include <linux/slab.h>
1920
#include <linux/clk.h>
2021
#include <linux/io.h>
@@ -28,9 +29,7 @@
2829

2930
#include <linux/mmc/host.h>
3031

31-
#include <plat/sdhci.h>
32-
#include <plat/regs-sdhci.h>
33-
32+
#include "sdhci-s3c-regs.h"
3433
#include "sdhci.h"
3534

3635
#define MAX_BUS_CLK (4)
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -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 */

0 commit comments

Comments
 (0)