aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorBanajit Goswami <banajit.g@samsung.com>2011-08-18 07:32:01 -0400
committerKukjin Kim <kgene.kim@samsung.com>2011-09-16 02:43:15 -0400
commit5e8e0a109e3c1b08c1407c615684bb9981aca28f (patch)
treee3e685d8bdd9ddcaafd23ade8fe8266256e3150d /arch/arm
parent3e461977d1aff9b4d1785815f4eb2098657a0500 (diff)
ARM: SAMSUNG: Consolidate common function to set SDHCI plat data
Moves similar functions to set SDHCI platform data for all Samsung boards to a common location, thereby saves a few lines. Signed-off-by: Banajit Goswami <banajit.g@samsung.com> Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc.c19
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc1.c19
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc2.c19
-rw-r--r--arch/arm/plat-samsung/dev-hsmmc3.c19
-rw-r--r--arch/arm/plat-samsung/include/plat/sdhci.h7
-rw-r--r--arch/arm/plat-samsung/platformdata.c22
6 files changed, 33 insertions, 72 deletions
diff --git a/arch/arm/plat-samsung/dev-hsmmc.c b/arch/arm/plat-samsung/dev-hsmmc.c
index db7a65c7f127..06825c4276de 100644
--- a/arch/arm/plat-samsung/dev-hsmmc.c
+++ b/arch/arm/plat-samsung/dev-hsmmc.c
@@ -58,22 +58,5 @@ struct platform_device s3c_device_hsmmc0 = {
58 58
59void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd) 59void s3c_sdhci0_set_platdata(struct s3c_sdhci_platdata *pd)
60{ 60{
61 struct s3c_sdhci_platdata *set = &s3c_hsmmc0_def_platdata; 61 s3c_sdhci_set_platdata(pd, &s3c_hsmmc0_def_platdata);
62
63 set->cd_type = pd->cd_type;
64 set->ext_cd_init = pd->ext_cd_init;
65 set->ext_cd_cleanup = pd->ext_cd_cleanup;
66 set->ext_cd_gpio = pd->ext_cd_gpio;
67 set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;
68
69 if (pd->max_width)
70 set->max_width = pd->max_width;
71 if (pd->cfg_gpio)
72 set->cfg_gpio = pd->cfg_gpio;
73 if (pd->cfg_card)
74 set->cfg_card = pd->cfg_card;
75 if (pd->host_caps)
76 set->host_caps |= pd->host_caps;
77 if (pd->clk_type)
78 set->clk_type = pd->clk_type;
79} 62}
diff --git a/arch/arm/plat-samsung/dev-hsmmc1.c b/arch/arm/plat-samsung/dev-hsmmc1.c
index 2497321f08d7..4524ef440010 100644
--- a/arch/arm/plat-samsung/dev-hsmmc1.c
+++ b/arch/arm/plat-samsung/dev-hsmmc1.c
@@ -58,22 +58,5 @@ struct platform_device s3c_device_hsmmc1 = {
58 58
59void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd) 59void s3c_sdhci1_set_platdata(struct s3c_sdhci_platdata *pd)
60{ 60{
61 struct s3c_sdhci_platdata *set = &s3c_hsmmc1_def_platdata; 61 s3c_sdhci_set_platdata(pd, &s3c_hsmmc1_def_platdata);
62
63 set->cd_type = pd->cd_type;
64 set->ext_cd_init = pd->ext_cd_init;
65 set->ext_cd_cleanup = pd->ext_cd_cleanup;
66 set->ext_cd_gpio = pd->ext_cd_gpio;
67 set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;
68
69 if (pd->max_width)
70 set->max_width = pd->max_width;
71 if (pd->cfg_gpio)
72 set->cfg_gpio = pd->cfg_gpio;
73 if (pd->cfg_card)
74 set->cfg_card = pd->cfg_card;
75 if (pd->host_caps)
76 set->host_caps |= pd->host_caps;
77 if (pd->clk_type)
78 set->clk_type = pd->clk_type;
79} 62}
diff --git a/arch/arm/plat-samsung/dev-hsmmc2.c b/arch/arm/plat-samsung/dev-hsmmc2.c
index f60aedba417c..9cede9615e48 100644
--- a/arch/arm/plat-samsung/dev-hsmmc2.c
+++ b/arch/arm/plat-samsung/dev-hsmmc2.c
@@ -59,22 +59,5 @@ struct platform_device s3c_device_hsmmc2 = {
59 59
60void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd) 60void s3c_sdhci2_set_platdata(struct s3c_sdhci_platdata *pd)
61{ 61{
62 struct s3c_sdhci_platdata *set = &s3c_hsmmc2_def_platdata; 62 s3c_sdhci_set_platdata(pd, &s3c_hsmmc2_def_platdata);
63
64 set->cd_type = pd->cd_type;
65 set->ext_cd_init = pd->ext_cd_init;
66 set->ext_cd_cleanup = pd->ext_cd_cleanup;
67 set->ext_cd_gpio = pd->ext_cd_gpio;
68 set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;
69
70 if (pd->max_width)
71 set->max_width = pd->max_width;
72 if (pd->cfg_gpio)
73 set->cfg_gpio = pd->cfg_gpio;
74 if (pd->cfg_card)
75 set->cfg_card = pd->cfg_card;
76 if (pd->host_caps)
77 set->host_caps |= pd->host_caps;
78 if (pd->clk_type)
79 set->clk_type = pd->clk_type;
80} 63}
diff --git a/arch/arm/plat-samsung/dev-hsmmc3.c b/arch/arm/plat-samsung/dev-hsmmc3.c
index ede776f20e62..0358ef4a8f66 100644
--- a/arch/arm/plat-samsung/dev-hsmmc3.c
+++ b/arch/arm/plat-samsung/dev-hsmmc3.c
@@ -62,22 +62,5 @@ struct platform_device s3c_device_hsmmc3 = {
62 62
63void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd) 63void s3c_sdhci3_set_platdata(struct s3c_sdhci_platdata *pd)
64{ 64{
65 struct s3c_sdhci_platdata *set = &s3c_hsmmc3_def_platdata; 65 s3c_sdhci_set_platdata(pd, &s3c_hsmmc3_def_platdata);
66
67 set->cd_type = pd->cd_type;
68 set->ext_cd_init = pd->ext_cd_init;
69 set->ext_cd_cleanup = pd->ext_cd_cleanup;
70 set->ext_cd_gpio = pd->ext_cd_gpio;
71 set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;
72
73 if (pd->max_width)
74 set->max_width = pd->max_width;
75 if (pd->cfg_gpio)
76 set->cfg_gpio = pd->cfg_gpio;
77 if (pd->cfg_card)
78 set->cfg_card = pd->cfg_card;
79 if (pd->host_caps)
80 set->host_caps |= pd->host_caps;
81 if (pd->clk_type)
82 set->clk_type = pd->clk_type;
83} 66}
diff --git a/arch/arm/plat-samsung/include/plat/sdhci.h b/arch/arm/plat-samsung/include/plat/sdhci.h
index 058e09654fe8..4a6552066c7e 100644
--- a/arch/arm/plat-samsung/include/plat/sdhci.h
+++ b/arch/arm/plat-samsung/include/plat/sdhci.h
@@ -86,6 +86,13 @@ struct s3c_sdhci_platdata {
86 struct mmc_card *card); 86 struct mmc_card *card);
87}; 87};
88 88
89/* s3c_sdhci_set_platdata() - common helper for setting SDHCI platform data
90 * @pd: The default platform data for this device.
91 * @set: Pointer to the platform data to fill in.
92 */
93extern void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
94 struct s3c_sdhci_platdata *set);
95
89/** 96/**
90 * s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device. 97 * s3c_sdhci0_set_platdata - Set platform data for S3C SDHCI device.
91 * @pd: Platform data to register to device. 98 * @pd: Platform data to register to device.
diff --git a/arch/arm/plat-samsung/platformdata.c b/arch/arm/plat-samsung/platformdata.c
index 7cf2e1e3b20f..6de1a3825927 100644
--- a/arch/arm/plat-samsung/platformdata.c
+++ b/arch/arm/plat-samsung/platformdata.c
@@ -14,6 +14,7 @@
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15 15
16#include <plat/devs.h> 16#include <plat/devs.h>
17#include <plat/sdhci.h>
17 18
18void __init *s3c_set_platdata(void *pd, size_t pdsize, 19void __init *s3c_set_platdata(void *pd, size_t pdsize,
19 struct platform_device *pdev) 20 struct platform_device *pdev)
@@ -35,3 +36,24 @@ void __init *s3c_set_platdata(void *pd, size_t pdsize,
35 pdev->dev.platform_data = npd; 36 pdev->dev.platform_data = npd;
36 return npd; 37 return npd;
37} 38}
39
40void s3c_sdhci_set_platdata(struct s3c_sdhci_platdata *pd,
41 struct s3c_sdhci_platdata *set)
42{
43 set->cd_type = pd->cd_type;
44 set->ext_cd_init = pd->ext_cd_init;
45 set->ext_cd_cleanup = pd->ext_cd_cleanup;
46 set->ext_cd_gpio = pd->ext_cd_gpio;
47 set->ext_cd_gpio_invert = pd->ext_cd_gpio_invert;
48
49 if (pd->max_width)
50 set->max_width = pd->max_width;
51 if (pd->cfg_gpio)
52 set->cfg_gpio = pd->cfg_gpio;
53 if (pd->cfg_card)
54 set->cfg_card = pd->cfg_card;
55 if (pd->host_caps)
56 set->host_caps |= pd->host_caps;
57 if (pd->clk_type)
58 set->clk_type = pd->clk_type;
59}