aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-s5pc100/setup-sdhci-gpio.c')
-rw-r--r--arch/arm/mach-s5pc100/setup-sdhci-gpio.c22
1 files changed, 16 insertions, 6 deletions
diff --git a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
index 7769c760c9ef..dc7208c639ea 100644
--- a/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
+++ b/arch/arm/mach-s5pc100/setup-sdhci-gpio.c
@@ -20,9 +20,11 @@
20 20
21#include <plat/gpio-cfg.h> 21#include <plat/gpio-cfg.h>
22#include <plat/regs-sdhci.h> 22#include <plat/regs-sdhci.h>
23#include <plat/sdhci.h>
23 24
24void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) 25void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
25{ 26{
27 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
26 unsigned int gpio; 28 unsigned int gpio;
27 unsigned int end; 29 unsigned int end;
28 unsigned int num; 30 unsigned int num;
@@ -47,12 +49,15 @@ void s5pc100_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width)
47 } 49 }
48 } 50 }
49 51
50 s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP); 52 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
51 s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2)); 53 s3c_gpio_setpull(S5PC100_GPG1(2), S3C_GPIO_PULL_UP);
54 s3c_gpio_cfgpin(S5PC100_GPG1(2), S3C_GPIO_SFN(2));
55 }
52} 56}
53 57
54void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) 58void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
55{ 59{
60 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
56 unsigned int gpio; 61 unsigned int gpio;
57 unsigned int end; 62 unsigned int end;
58 63
@@ -64,12 +69,15 @@ void s5pc100_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width)
64 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 69 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
65 } 70 }
66 71
67 s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP); 72 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
68 s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2)); 73 s3c_gpio_setpull(S5PC100_GPG2(6), S3C_GPIO_PULL_UP);
74 s3c_gpio_cfgpin(S5PC100_GPG2(6), S3C_GPIO_SFN(2));
75 }
69} 76}
70 77
71void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) 78void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
72{ 79{
80 struct s3c_sdhci_platdata *pdata = dev->dev.platform_data;
73 unsigned int gpio; 81 unsigned int gpio;
74 unsigned int end; 82 unsigned int end;
75 83
@@ -81,6 +89,8 @@ void s5pc100_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width)
81 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); 89 s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE);
82 } 90 }
83 91
84 s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP); 92 if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) {
85 s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2)); 93 s3c_gpio_setpull(S5PC100_GPG3(6), S3C_GPIO_PULL_UP);
94 s3c_gpio_cfgpin(S5PC100_GPG3(6), S3C_GPIO_SFN(2));
95 }
86} 96}