diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-10-01 01:27:31 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-10-22 22:49:44 -0400 |
commit | 64c5bd841b5789e118f358b684090585f14be6cf (patch) | |
tree | 0bebfd56dc34063884f389a64c88ac6dcd63ffd6 /arch/arm/mach-s5pv210/setup-sdhci-gpio.c | |
parent | ce8f9abd62e3c9fb21d6cea96a07f42ed5e008ce (diff) |
ARM: S5PV210: Change to using s3c_gpio_cfgpin_range()
Change the code setting ranges of GPIO pins using s3c_gpio_cfgpin() to
use the recently introduced s3c_gpio_cfgpin_range().
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
[kgene.kim@samsung.com: coding-style fixes]
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-s5pv210/setup-sdhci-gpio.c')
-rw-r--r-- | arch/arm/mach-s5pv210/setup-sdhci-gpio.c | 53 |
1 files changed, 22 insertions, 31 deletions
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c index b18587b1ec58..706427837d82 100644 --- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c +++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c | |||
@@ -29,23 +29,21 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | |||
29 | unsigned int gpio; | 29 | unsigned int gpio; |
30 | 30 | ||
31 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ | 31 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ |
32 | for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) { | 32 | s3c_gpio_cfgpin_range(S5PV210_GPG0(0), 2, S3C_GPIO_SFN(2)); |
33 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 33 | for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) |
34 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 34 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
35 | } | 35 | |
36 | switch (width) { | 36 | switch (width) { |
37 | case 8: | 37 | case 8: |
38 | /* GPG1[3:6] special-funtion 3 */ | 38 | /* GPG1[3:6] special-funtion 3 */ |
39 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) { | 39 | s3c_gpio_cfgpin_range(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(3)); |
40 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | 40 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) |
41 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 41 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
42 | } | ||
43 | case 4: | 42 | case 4: |
44 | /* GPG0[3:6] special-funtion 2 */ | 43 | /* GPG0[3:6] special-funtion 2 */ |
45 | for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) { | 44 | s3c_gpio_cfgpin_range(S5PV210_GPG0(3), 4, S3C_GPIO_SFN(2)); |
46 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 45 | for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) |
47 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 46 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
48 | } | ||
49 | default: | 47 | default: |
50 | break; | 48 | break; |
51 | } | 49 | } |
@@ -62,16 +60,14 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | |||
62 | unsigned int gpio; | 60 | unsigned int gpio; |
63 | 61 | ||
64 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ | 62 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ |
65 | for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) { | 63 | s3c_gpio_cfgpin_range(S5PV210_GPG1(0), 2, S3C_GPIO_SFN(2)); |
66 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 64 | for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) |
67 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 65 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
68 | } | ||
69 | 66 | ||
70 | /* Data pin GPG1[3:6] to special-function 2 */ | 67 | /* Data pin GPG1[3:6] to special-function 2 */ |
71 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) { | 68 | s3c_gpio_cfgpin_range(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(2)); |
72 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 69 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) |
73 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 70 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
74 | } | ||
75 | 71 | ||
76 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 72 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
77 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); | 73 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); |
@@ -85,24 +81,21 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | |||
85 | unsigned int gpio; | 81 | unsigned int gpio; |
86 | 82 | ||
87 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ | 83 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ |
88 | for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) { | 84 | s3c_gpio_cfgpin_range(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2)); |
89 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 85 | for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) |
90 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 86 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
91 | } | ||
92 | 87 | ||
93 | switch (width) { | 88 | switch (width) { |
94 | case 8: | 89 | case 8: |
95 | /* Data pin GPG3[3:6] to special-function 3 */ | 90 | /* Data pin GPG3[3:6] to special-function 3 */ |
96 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) { | 91 | s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3)); |
97 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(3)); | 92 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) |
98 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 93 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
99 | } | ||
100 | case 4: | 94 | case 4: |
101 | /* Data pin GPG2[3:6] to special-function 2 */ | 95 | /* Data pin GPG2[3:6] to special-function 2 */ |
102 | for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) { | 96 | s3c_gpio_cfgpin_range(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2)); |
103 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 97 | for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) |
104 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 98 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
105 | } | ||
106 | default: | 99 | default: |
107 | break; | 100 | break; |
108 | } | 101 | } |
@@ -118,17 +111,15 @@ void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width) | |||
118 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 111 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
119 | unsigned int gpio; | 112 | unsigned int gpio; |
120 | 113 | ||
121 | /* Set all the necessary GPG3[0:2] pins to special-function 2 */ | 114 | /* Set all the necessary GPG3[0:1] pins to special-function 2 */ |
122 | for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++) { | 115 | s3c_gpio_cfgpin_range(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2)); |
123 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 116 | for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++) |
124 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 117 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
125 | } | ||
126 | 118 | ||
127 | /* Data pin GPG3[3:6] to special-function 2 */ | 119 | /* Data pin GPG3[3:6] to special-function 2 */ |
128 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) { | 120 | s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2)); |
129 | s3c_gpio_cfgpin(gpio, S3C_GPIO_SFN(2)); | 121 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) |
130 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | 122 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); |
131 | } | ||
132 | 123 | ||
133 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 124 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
134 | s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP); | 125 | s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP); |