aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJeongbae Seo <jeongbae.seo@samsung.com>2010-10-08 05:03:27 -0400
committerKukjin Kim <kgene.kim@samsung.com>2010-10-25 03:02:47 -0400
commit28c80aa707156d83f679442ea745db301316a4ea (patch)
tree18dcca97a9da9973cf698feb79c05f1e1a3eb212 /arch
parent40fcd5b9bf27a8ea78df434a92f3d87533a13fc4 (diff)
ARM: SAMSUNG: Add clock types into platform data
This patch adds clock types into platform data to support external clock divider instead of internal clock divider. It is defined that what kinds of clock type is used in machine. Signed-off-by: Jeongbae Seo <jeongbae.seo@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/arm/mach-s5pv310/mach-smdkc210.c4
-rw-r--r--arch/arm/mach-s5pv310/mach-smdkv310.c4
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc.c3
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc1.c3
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc2.c3
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc3.c3
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h7
7 files changed, 27 insertions, 0 deletions
diff --git a/arch/arm/mach-s5pv310/mach-smdkc210.c b/arch/arm/mach-s5pv310/mach-smdkc210.c
index da5e7e7788b..93d537b8dad 100644
--- a/arch/arm/mach-s5pv310/mach-smdkc210.c
+++ b/arch/arm/mach-s5pv310/mach-smdkc210.c
@@ -74,6 +74,7 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc0_pdata __initdata = {
74 .cd_type = S3C_SDHCI_CD_GPIO, 74 .cd_type = S3C_SDHCI_CD_GPIO,
75 .ext_cd_gpio = S5PV310_GPK0(2), 75 .ext_cd_gpio = S5PV310_GPK0(2),
76 .ext_cd_gpio_invert = 1, 76 .ext_cd_gpio_invert = 1,
77 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
77#ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT 78#ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT
78 .max_width = 8, 79 .max_width = 8,
79 .host_caps = MMC_CAP_8_BIT_DATA, 80 .host_caps = MMC_CAP_8_BIT_DATA,
@@ -84,12 +85,14 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc1_pdata __initdata = {
84 .cd_type = S3C_SDHCI_CD_GPIO, 85 .cd_type = S3C_SDHCI_CD_GPIO,
85 .ext_cd_gpio = S5PV310_GPK0(2), 86 .ext_cd_gpio = S5PV310_GPK0(2),
86 .ext_cd_gpio_invert = 1, 87 .ext_cd_gpio_invert = 1,
88 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
87}; 89};
88 90
89static struct s3c_sdhci_platdata smdkc210_hsmmc2_pdata __initdata = { 91static struct s3c_sdhci_platdata smdkc210_hsmmc2_pdata __initdata = {
90 .cd_type = S3C_SDHCI_CD_GPIO, 92 .cd_type = S3C_SDHCI_CD_GPIO,
91 .ext_cd_gpio = S5PV310_GPK2(2), 93 .ext_cd_gpio = S5PV310_GPK2(2),
92 .ext_cd_gpio_invert = 1, 94 .ext_cd_gpio_invert = 1,
95 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
93#ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT 96#ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT
94 .max_width = 8, 97 .max_width = 8,
95 .host_caps = MMC_CAP_8_BIT_DATA, 98 .host_caps = MMC_CAP_8_BIT_DATA,
@@ -100,6 +103,7 @@ static struct s3c_sdhci_platdata smdkc210_hsmmc3_pdata __initdata = {
100 .cd_type = S3C_SDHCI_CD_GPIO, 103 .cd_type = S3C_SDHCI_CD_GPIO,
101 .ext_cd_gpio = S5PV310_GPK2(2), 104 .ext_cd_gpio = S5PV310_GPK2(2),
102 .ext_cd_gpio_invert = 1, 105 .ext_cd_gpio_invert = 1,
106 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
103}; 107};
104 108
105static struct platform_device *smdkc210_devices[] __initdata = { 109static struct platform_device *smdkc210_devices[] __initdata = {
diff --git a/arch/arm/mach-s5pv310/mach-smdkv310.c b/arch/arm/mach-s5pv310/mach-smdkv310.c
index 6eff6ceac91..10f80566516 100644
--- a/arch/arm/mach-s5pv310/mach-smdkv310.c
+++ b/arch/arm/mach-s5pv310/mach-smdkv310.c
@@ -74,6 +74,7 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc0_pdata __initdata = {
74 .cd_type = S3C_SDHCI_CD_GPIO, 74 .cd_type = S3C_SDHCI_CD_GPIO,
75 .ext_cd_gpio = S5PV310_GPK0(2), 75 .ext_cd_gpio = S5PV310_GPK0(2),
76 .ext_cd_gpio_invert = 1, 76 .ext_cd_gpio_invert = 1,
77 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
77#ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT 78#ifdef CONFIG_S5PV310_SDHCI_CH0_8BIT
78 .max_width = 8, 79 .max_width = 8,
79 .host_caps = MMC_CAP_8_BIT_DATA, 80 .host_caps = MMC_CAP_8_BIT_DATA,
@@ -84,12 +85,14 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc1_pdata __initdata = {
84 .cd_type = S3C_SDHCI_CD_GPIO, 85 .cd_type = S3C_SDHCI_CD_GPIO,
85 .ext_cd_gpio = S5PV310_GPK0(2), 86 .ext_cd_gpio = S5PV310_GPK0(2),
86 .ext_cd_gpio_invert = 1, 87 .ext_cd_gpio_invert = 1,
88 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
87}; 89};
88 90
89static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = { 91static struct s3c_sdhci_platdata smdkv310_hsmmc2_pdata __initdata = {
90 .cd_type = S3C_SDHCI_CD_GPIO, 92 .cd_type = S3C_SDHCI_CD_GPIO,
91 .ext_cd_gpio = S5PV310_GPK2(2), 93 .ext_cd_gpio = S5PV310_GPK2(2),
92 .ext_cd_gpio_invert = 1, 94 .ext_cd_gpio_invert = 1,
95 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
93#ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT 96#ifdef CONFIG_S5PV310_SDHCI_CH2_8BIT
94 .max_width = 8, 97 .max_width = 8,
95 .host_caps = MMC_CAP_8_BIT_DATA, 98 .host_caps = MMC_CAP_8_BIT_DATA,
@@ -100,6 +103,7 @@ static struct s3c_sdhci_platdata smdkv310_hsmmc3_pdata __initdata = {
100 .cd_type = S3C_SDHCI_CD_GPIO, 103 .cd_type = S3C_SDHCI_CD_GPIO,
101 .ext_cd_gpio = S5PV310_GPK2(2), 104 .ext_cd_gpio = S5PV310_GPK2(2),
102 .ext_cd_gpio_invert = 1, 105 .ext_cd_gpio_invert = 1,
106 .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL,
103}; 107};
104 108
105static struct platform_device *smdkv310_devices[] __initdata = { 109static struct platform_device *smdkv310_devices[] __initdata = {
diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
index 5b8aacb5cbc..db7a65c7f12 100644
--- a/arch/arm/plat-samsung/dev-hsmmc.c
+++ b/arch/arm/plat-samsung/dev-hsmmc.c
@@ -41,6 +41,7 @@ struct s3c_sdhci_platdata s3c_hsmmc0_def_platdata = {
41 .max_width = 4, 41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA | 42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), 43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
44 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
44}; 45};
45 46
46struct platform_device s3c_device_hsmmc0 = { 47struct platform_device s3c_device_hsmmc0 = {
@@ -73,4 +74,6 @@ void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
73 set->cfg_card = pd->cfg_card; 74 set->cfg_card = pd->cfg_card;
74 if (pd->host_caps) 75 if (pd->host_caps)
75 set->host_caps |= pd->host_caps; 76 set->host_caps |= pd->host_caps;
77 if (pd->clk_type)
78 set->clk_type = pd->clk_type;
76} 79}
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
index 9b52828644d..2497321f08d 100644
--- a/arch/arm/plat-samsung/dev-hsmmc1.c
+++ b/arch/arm/plat-samsung/dev-hsmmc1.c
@@ -41,6 +41,7 @@ struct s3c_sdhci_platdata s3c_hsmmc1_def_platdata = {
41 .max_width = 4, 41 .max_width = 4,
42 .host_caps = (MMC_CAP_4_BIT_DATA | 42 .host_caps = (MMC_CAP_4_BIT_DATA |
43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), 43 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
44 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
44}; 45};
45 46
46struct platform_device s3c_device_hsmmc1 = { 47struct platform_device s3c_device_hsmmc1 = {
@@ -73,4 +74,6 @@ void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
73 set->cfg_card = pd->cfg_card; 74 set->cfg_card = pd->cfg_card;
74 if (pd->host_caps) 75 if (pd->host_caps)
75 set->host_caps |= pd->host_caps; 76 set->host_caps |= pd->host_caps;
77 if (pd->clk_type)
78 set->clk_type = pd->clk_type;
76} 79}
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
index df9e36b54c0..f60aedba417 100644
--- a/arch/arm/plat-samsung/dev-hsmmc2.c
+++ b/arch/arm/plat-samsung/dev-hsmmc2.c
@@ -42,6 +42,7 @@ struct s3c_sdhci_platdata s3c_hsmmc2_def_platdata = {
42 .max_width = 4, 42 .max_width = 4,
43 .host_caps = (MMC_CAP_4_BIT_DATA | 43 .host_caps = (MMC_CAP_4_BIT_DATA |
44 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), 44 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
45 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
45}; 46};
46 47
47struct platform_device s3c_device_hsmmc2 = { 48struct platform_device s3c_device_hsmmc2 = {
@@ -74,4 +75,6 @@ void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
74 set->cfg_card = pd->cfg_card; 75 set->cfg_card = pd->cfg_card;
75 if (pd->host_caps) 76 if (pd->host_caps)
76 set->host_caps |= pd->host_caps; 77 set->host_caps |= pd->host_caps;
78 if (pd->clk_type)
79 set->clk_type = pd->clk_type;
77} 80}
diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c b/arch/arm/plat-samsung/dev-hsmmc3.c
index ca80897b0d7..ede776f20e6 100644
--- a/arch/arm/plat-samsung/dev-hsmmc3.c
+++ b/arch/arm/plat-samsung/dev-hsmmc3.c
@@ -45,6 +45,7 @@ struct s3c_sdhci_platdata s3c_hsmmc3_def_platdata = {
45 .max_width = 4, 45 .max_width = 4,
46 .host_caps = (MMC_CAP_4_BIT_DATA | 46 .host_caps = (MMC_CAP_4_BIT_DATA |
47 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED), 47 MMC_CAP_MMC_HIGHSPEED | MMC_CAP_SD_HIGHSPEED),
48 .clk_type = S3C_SDHCI_CLK_DIV_INTERNAL,
48}; 49};
49 50
50struct platform_device s3c_device_hsmmc3 = { 51struct platform_device s3c_device_hsmmc3 = {
@@ -77,4 +78,6 @@ void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
77 set->cfg_card = pd->cfg_card; 78 set->cfg_card = pd->cfg_card;
78 if (pd->host_caps) 79 if (pd->host_caps)
79 set->host_caps |= pd->host_caps; 80 set->host_caps |= pd->host_caps;
81 if (pd->clk_type)
82 set->clk_type = pd->clk_type;
80} 83}
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index d92670ad989..85853f8c4c5 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -28,11 +28,17 @@ enum cd_types {
28 S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */ 28 S3C_SDHCI_CD_PERMANENT, /* no CD line, card permanently wired to host */
29}; 29};
30 30
31enum clk_types {
32 S3C_SDHCI_CLK_DIV_INTERNAL, /* use mmc internal clock divider */
33 S3C_SDHCI_CLK_DIV_EXTERNAL, /* use external clock divider */
34};
35
31/** 36/**
32 * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI 37 * struct s3c_sdhci_platdata() - Platform device data for Samsung SDHCI
33 * @max_width: The maximum number of data bits supported. 38 * @max_width: The maximum number of data bits supported.
34 * @host_caps: Standard MMC host capabilities bit field. 39 * @host_caps: Standard MMC host capabilities bit field.
35 * @cd_type: Type of Card Detection method (see cd_types enum above) 40 * @cd_type: Type of Card Detection method (see cd_types enum above)
41 * @clk_type: Type of clock divider method (see clk_types enum above)
36 * @ext_cd_init: Initialize external card detect subsystem. Called on 42 * @ext_cd_init: Initialize external card detect subsystem. Called on
37 * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL. 43 * sdhci-s3c driver probe when cd_type == S3C_SDHCI_CD_EXTERNAL.
38 * notify_func argument is a callback to the sdhci-s3c driver 44 * notify_func argument is a callback to the sdhci-s3c driver
@@ -59,6 +65,7 @@ struct s3c_sdhci_platdata {
59 unsigned int max_width; 65 unsigned int max_width;
60 unsigned int host_caps; 66 unsigned int host_caps;
61 enum cd_types cd_type; 67 enum cd_types cd_type;
68 enum clk_types clk_type;
62 69
63 char **clocks; /* set of clock sources */ 70 char **clocks; /* set of clock sources */
64 71