diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-05-27 04:02:32 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2010-10-22 22:50:29 -0400 |
commit | 53134a740e3b9ce3c04e853e231a624bd4260480 (patch) | |
tree | 8c7a4a0b4a0bc5245d455329f46dacae3fefe11c /arch/arm/mach-s5pv210/setup-sdhci-gpio.c | |
parent | a40af06655f97d88fc1b0fcc9b5f2a5c06a27a4a (diff) |
ARM: S5PV210: Change to using s3c_gpio_cfgall_range()
Change the code setting a range of GPIO pins' configuration and
pull state to use the recently introduced s3c_gpio_cfgall_range().
Mop up a few missed s3c_gpio_cfgpin_range() changes.
Signed-off-by: Ben Dooks <ben-linux@fluff.org>
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 | 54 |
1 files changed, 20 insertions, 34 deletions
diff --git a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c index 706427837d82..f5499aeb2b6c 100644 --- a/arch/arm/mach-s5pv210/setup-sdhci-gpio.c +++ b/arch/arm/mach-s5pv210/setup-sdhci-gpio.c | |||
@@ -26,24 +26,20 @@ | |||
26 | void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | 26 | void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) |
27 | { | 27 | { |
28 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 28 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
29 | unsigned int gpio; | ||
30 | 29 | ||
31 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ | 30 | /* Set all the necessary GPG0/GPG1 pins to special-function 2 */ |
32 | s3c_gpio_cfgpin_range(S5PV210_GPG0(0), 2, S3C_GPIO_SFN(2)); | 31 | s3c_gpio_cfgall_range(S5PV210_GPG0(0), 2, |
33 | for (gpio = S5PV210_GPG0(0); gpio < S5PV210_GPG0(2); gpio++) | 32 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
34 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
35 | 33 | ||
36 | switch (width) { | 34 | switch (width) { |
37 | case 8: | 35 | case 8: |
38 | /* GPG1[3:6] special-funtion 3 */ | 36 | /* GPG1[3:6] special-funtion 3 */ |
39 | s3c_gpio_cfgpin_range(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(3)); | 37 | s3c_gpio_cfgall_range(S5PV210_GPG1(3), 4, |
40 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) | 38 | S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE); |
41 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
42 | case 4: | 39 | case 4: |
43 | /* GPG0[3:6] special-funtion 2 */ | 40 | /* GPG0[3:6] special-funtion 2 */ |
44 | s3c_gpio_cfgpin_range(S5PV210_GPG0(3), 4, S3C_GPIO_SFN(2)); | 41 | s3c_gpio_cfgall_range(S5PV210_GPG0(3), 4, |
45 | for (gpio = S5PV210_GPG0(3); gpio <= S5PV210_GPG0(6); gpio++) | 42 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
46 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
47 | default: | 43 | default: |
48 | break; | 44 | break; |
49 | } | 45 | } |
@@ -57,17 +53,14 @@ void s5pv210_setup_sdhci0_cfg_gpio(struct platform_device *dev, int width) | |||
57 | void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | 53 | void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) |
58 | { | 54 | { |
59 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 55 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
60 | unsigned int gpio; | ||
61 | 56 | ||
62 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ | 57 | /* Set all the necessary GPG1[0:1] pins to special-function 2 */ |
63 | s3c_gpio_cfgpin_range(S5PV210_GPG1(0), 2, S3C_GPIO_SFN(2)); | 58 | s3c_gpio_cfgall_range(S5PV210_GPG1(0), 2, |
64 | for (gpio = S5PV210_GPG1(0); gpio < S5PV210_GPG1(2); gpio++) | 59 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
65 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
66 | 60 | ||
67 | /* Data pin GPG1[3:6] to special-function 2 */ | 61 | /* Data pin GPG1[3:6] to special-function 2 */ |
68 | s3c_gpio_cfgpin_range(S5PV210_GPG1(3), 4, S3C_GPIO_SFN(2)); | 62 | s3c_gpio_cfgall_range(S5PV210_GPG1(3), 4, |
69 | for (gpio = S5PV210_GPG1(3); gpio <= S5PV210_GPG1(6); gpio++) | 63 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
70 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
71 | 64 | ||
72 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 65 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
73 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); | 66 | s3c_gpio_setpull(S5PV210_GPG1(2), S3C_GPIO_PULL_UP); |
@@ -78,24 +71,20 @@ void s5pv210_setup_sdhci1_cfg_gpio(struct platform_device *dev, int width) | |||
78 | void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | 71 | void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) |
79 | { | 72 | { |
80 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 73 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
81 | unsigned int gpio; | ||
82 | 74 | ||
83 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ | 75 | /* Set all the necessary GPG2[0:1] pins to special-function 2 */ |
84 | s3c_gpio_cfgpin_range(S5PV210_GPG2(0), 2, S3C_GPIO_SFN(2)); | 76 | s3c_gpio_cfgall_range(S5PV210_GPG2(0), 2, |
85 | for (gpio = S5PV210_GPG2(0); gpio < S5PV210_GPG2(2); gpio++) | 77 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
86 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
87 | 78 | ||
88 | switch (width) { | 79 | switch (width) { |
89 | case 8: | 80 | case 8: |
90 | /* Data pin GPG3[3:6] to special-function 3 */ | 81 | /* Data pin GPG3[3:6] to special-function 3 */ |
91 | s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(3)); | 82 | s3c_gpio_cfgall_range(S5PV210_GPG3(3), 4, |
92 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) | 83 | S3C_GPIO_SFN(3), S3C_GPIO_PULL_NONE); |
93 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
94 | case 4: | 84 | case 4: |
95 | /* Data pin GPG2[3:6] to special-function 2 */ | 85 | /* Data pin GPG2[3:6] to special-function 2 */ |
96 | s3c_gpio_cfgpin_range(S5PV210_GPG2(3), 4, S3C_GPIO_SFN(2)); | 86 | s3c_gpio_cfgall_range(S5PV210_GPG2(3), 4, |
97 | for (gpio = S5PV210_GPG2(3); gpio <= S5PV210_GPG2(6); gpio++) | 87 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
98 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
99 | default: | 88 | default: |
100 | break; | 89 | break; |
101 | } | 90 | } |
@@ -109,17 +98,14 @@ void s5pv210_setup_sdhci2_cfg_gpio(struct platform_device *dev, int width) | |||
109 | void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width) | 98 | void s5pv210_setup_sdhci3_cfg_gpio(struct platform_device *dev, int width) |
110 | { | 99 | { |
111 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; | 100 | struct s3c_sdhci_platdata *pdata = dev->dev.platform_data; |
112 | unsigned int gpio; | ||
113 | 101 | ||
114 | /* Set all the necessary GPG3[0:1] pins to special-function 2 */ | 102 | /* Set all the necessary GPG3[0:1] pins to special-function 2 */ |
115 | s3c_gpio_cfgpin_range(S5PV210_GPG3(0), 2, S3C_GPIO_SFN(2)); | 103 | s3c_gpio_cfgall_range(S5PV210_GPG3(0), 2, |
116 | for (gpio = S5PV210_GPG3(0); gpio < S5PV210_GPG3(2); gpio++) | 104 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
117 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
118 | 105 | ||
119 | /* Data pin GPG3[3:6] to special-function 2 */ | 106 | /* Data pin GPG3[3:6] to special-function 2 */ |
120 | s3c_gpio_cfgpin_range(S5PV210_GPG3(3), 4, S3C_GPIO_SFN(2)); | 107 | s3c_gpio_cfgall_range(S5PV210_GPG3(3), 4, |
121 | for (gpio = S5PV210_GPG3(3); gpio <= S5PV210_GPG3(6); gpio++) | 108 | S3C_GPIO_SFN(2), S3C_GPIO_PULL_NONE); |
122 | s3c_gpio_setpull(gpio, S3C_GPIO_PULL_NONE); | ||
123 | 109 | ||
124 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { | 110 | if (pdata->cd_type == S3C_SDHCI_CD_INTERNAL) { |
125 | s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP); | 111 | s3c_gpio_setpull(S5PV210_GPG3(2), S3C_GPIO_PULL_UP); |