diff options
author | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 05:04:08 -0400 |
---|---|---|
committer | Ben Dooks <ben-linux@fluff.org> | 2010-05-19 05:04:08 -0400 |
commit | ff1b8ba01dc80da338890a187c112fdd3c0b9202 (patch) | |
tree | 415999aa2c3ac52e48c2b6f690bba393e3d7a00c /arch/arm/plat-s3c24xx | |
parent | 5fcdb16bd04fdeb313ee33bb269b04e59a9abf91 (diff) | |
parent | 32b6cb3872883861f3a2669cce880f3a7ef8979a (diff) |
ARM: Merge for-2635/gpio2
Merge branch 'for-2635/gpio2' into for-linus/samsung2
Diffstat (limited to 'arch/arm/plat-s3c24xx')
-rw-r--r-- | arch/arm/plat-s3c24xx/Kconfig | 1 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/common-smdk.c | 9 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/gpio.c | 150 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/gpiolib.c | 60 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/pm.c | 9 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/setup-i2c.c | 5 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c | 16 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c | 16 | ||||
-rw-r--r-- | arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c | 16 |
9 files changed, 118 insertions, 164 deletions
diff --git a/arch/arm/plat-s3c24xx/Kconfig b/arch/arm/plat-s3c24xx/Kconfig index 6e93ef8f3d43..a830fad6f89e 100644 --- a/arch/arm/plat-s3c24xx/Kconfig +++ b/arch/arm/plat-s3c24xx/Kconfig | |||
@@ -9,6 +9,7 @@ config PLAT_S3C24XX | |||
9 | select NO_IOPORT | 9 | select NO_IOPORT |
10 | select ARCH_REQUIRE_GPIOLIB | 10 | select ARCH_REQUIRE_GPIOLIB |
11 | select S3C_DEVICE_NAND | 11 | select S3C_DEVICE_NAND |
12 | select S3C_GPIO_CFG_S3C24XX | ||
12 | help | 13 | help |
13 | Base platform code for any Samsung S3C24XX device | 14 | Base platform code for any Samsung S3C24XX device |
14 | 15 | ||
diff --git a/arch/arm/plat-s3c24xx/common-smdk.c b/arch/arm/plat-s3c24xx/common-smdk.c index 9e0e20ad2e46..7b44d0c592b5 100644 --- a/arch/arm/plat-s3c24xx/common-smdk.c +++ b/arch/arm/plat-s3c24xx/common-smdk.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <plat/nand.h> | 42 | #include <plat/nand.h> |
43 | 43 | ||
44 | #include <plat/common-smdk.h> | 44 | #include <plat/common-smdk.h> |
45 | #include <plat/gpio-cfg.h> | ||
45 | #include <plat/devs.h> | 46 | #include <plat/devs.h> |
46 | #include <plat/pm.h> | 47 | #include <plat/pm.h> |
47 | 48 | ||
@@ -185,10 +186,10 @@ void __init smdk_machine_init(void) | |||
185 | { | 186 | { |
186 | /* Configure the LEDs (even if we have no LED support)*/ | 187 | /* Configure the LEDs (even if we have no LED support)*/ |
187 | 188 | ||
188 | s3c2410_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); | 189 | s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT); |
189 | s3c2410_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); | 190 | s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT); |
190 | s3c2410_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); | 191 | s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT); |
191 | s3c2410_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); | 192 | s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT); |
192 | 193 | ||
193 | s3c2410_gpio_setpin(S3C2410_GPF(4), 1); | 194 | s3c2410_gpio_setpin(S3C2410_GPF(4), 1); |
194 | s3c2410_gpio_setpin(S3C2410_GPF(5), 1); | 195 | s3c2410_gpio_setpin(S3C2410_GPF(5), 1); |
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index 5467470badfd..2f3d7c089dfa 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/gpio.c | 1 | /* linux/arch/arm/plat-s3c24xx/gpio.c |
2 | * | 2 | * |
3 | * Copyright (c) 2004-2005 Simtec Electronics | 3 | * Copyright (c) 2004-2010 Simtec Electronics |
4 | * Ben Dooks <ben@simtec.co.uk> | 4 | * Ben Dooks <ben@simtec.co.uk> |
5 | * | 5 | * |
6 | * S3C24XX GPIO support | 6 | * S3C24XX GPIO support |
@@ -20,12 +20,12 @@ | |||
20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 20 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
21 | */ | 21 | */ |
22 | 22 | ||
23 | |||
24 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
25 | #include <linux/init.h> | 24 | #include <linux/init.h> |
26 | #include <linux/module.h> | 25 | #include <linux/module.h> |
27 | #include <linux/interrupt.h> | 26 | #include <linux/interrupt.h> |
28 | #include <linux/ioport.h> | 27 | #include <linux/ioport.h> |
28 | #include <linux/gpio.h> | ||
29 | #include <linux/io.h> | 29 | #include <linux/io.h> |
30 | 30 | ||
31 | #include <mach/hardware.h> | 31 | #include <mach/hardware.h> |
@@ -34,133 +34,46 @@ | |||
34 | 34 | ||
35 | #include <mach/regs-gpio.h> | 35 | #include <mach/regs-gpio.h> |
36 | 36 | ||
37 | void s3c2410_gpio_cfgpin(unsigned int pin, unsigned int function) | 37 | #include <plat/gpio-core.h> |
38 | { | ||
39 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | ||
40 | unsigned long mask; | ||
41 | unsigned long con; | ||
42 | unsigned long flags; | ||
43 | 38 | ||
44 | if (pin < S3C2410_GPIO_BANKB) { | 39 | /* gpiolib wrappers until these are totally eliminated */ |
45 | mask = 1 << S3C2410_GPIO_OFFSET(pin); | ||
46 | } else { | ||
47 | mask = 3 << S3C2410_GPIO_OFFSET(pin)*2; | ||
48 | } | ||
49 | |||
50 | switch (function) { | ||
51 | case S3C2410_GPIO_LEAVE: | ||
52 | mask = 0; | ||
53 | function = 0; | ||
54 | break; | ||
55 | |||
56 | case S3C2410_GPIO_INPUT: | ||
57 | case S3C2410_GPIO_OUTPUT: | ||
58 | case S3C2410_GPIO_SFN2: | ||
59 | case S3C2410_GPIO_SFN3: | ||
60 | if (pin < S3C2410_GPIO_BANKB) { | ||
61 | function -= 1; | ||
62 | function &= 1; | ||
63 | function <<= S3C2410_GPIO_OFFSET(pin); | ||
64 | } else { | ||
65 | function &= 3; | ||
66 | function <<= S3C2410_GPIO_OFFSET(pin)*2; | ||
67 | } | ||
68 | } | ||
69 | |||
70 | /* modify the specified register wwith IRQs off */ | ||
71 | |||
72 | local_irq_save(flags); | ||
73 | |||
74 | con = __raw_readl(base + 0x00); | ||
75 | con &= ~mask; | ||
76 | con |= function; | ||
77 | |||
78 | __raw_writel(con, base + 0x00); | ||
79 | |||
80 | local_irq_restore(flags); | ||
81 | } | ||
82 | |||
83 | EXPORT_SYMBOL(s3c2410_gpio_cfgpin); | ||
84 | |||
85 | unsigned int s3c2410_gpio_getcfg(unsigned int pin) | ||
86 | { | ||
87 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | ||
88 | unsigned long val = __raw_readl(base); | ||
89 | |||
90 | if (pin < S3C2410_GPIO_BANKB) { | ||
91 | val >>= S3C2410_GPIO_OFFSET(pin); | ||
92 | val &= 1; | ||
93 | val += 1; | ||
94 | } else { | ||
95 | val >>= S3C2410_GPIO_OFFSET(pin)*2; | ||
96 | val &= 3; | ||
97 | } | ||
98 | |||
99 | return val | S3C2410_GPIO_INPUT; | ||
100 | } | ||
101 | |||
102 | EXPORT_SYMBOL(s3c2410_gpio_getcfg); | ||
103 | 40 | ||
104 | void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) | 41 | void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) |
105 | { | 42 | { |
106 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | 43 | int ret; |
107 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | ||
108 | unsigned long flags; | ||
109 | unsigned long up; | ||
110 | 44 | ||
111 | if (pin < S3C2410_GPIO_BANKB) | 45 | WARN_ON(to); /* should be none of these left */ |
112 | return; | ||
113 | 46 | ||
114 | local_irq_save(flags); | 47 | if (!to) { |
115 | 48 | /* if pull is enabled, try first with up, and if that | |
116 | up = __raw_readl(base + 0x08); | 49 | * fails, try using down */ |
117 | up &= ~(1L << offs); | ||
118 | up |= to << offs; | ||
119 | __raw_writel(up, base + 0x08); | ||
120 | 50 | ||
121 | local_irq_restore(flags); | 51 | ret = s3c_gpio_setpull(pin, S3C_GPIO_PULL_UP); |
52 | if (ret) | ||
53 | s3c_gpio_setpull(pin, S3C_GPIO_PULL_DOWN); | ||
54 | } else { | ||
55 | s3c_gpio_setpull(pin, S3C_GPIO_PULL_NONE); | ||
56 | } | ||
122 | } | 57 | } |
123 | |||
124 | EXPORT_SYMBOL(s3c2410_gpio_pullup); | 58 | EXPORT_SYMBOL(s3c2410_gpio_pullup); |
125 | 59 | ||
126 | int s3c2410_gpio_getpull(unsigned int pin) | ||
127 | { | ||
128 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | ||
129 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | ||
130 | |||
131 | if (pin < S3C2410_GPIO_BANKB) | ||
132 | return -EINVAL; | ||
133 | |||
134 | return (__raw_readl(base + 0x08) & (1L << offs)) ? 1 : 0; | ||
135 | } | ||
136 | |||
137 | EXPORT_SYMBOL(s3c2410_gpio_getpull); | ||
138 | |||
139 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) | 60 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) |
140 | { | 61 | { |
141 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | 62 | /* do this via gpiolib until all users removed */ |
142 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | ||
143 | unsigned long flags; | ||
144 | unsigned long dat; | ||
145 | 63 | ||
146 | local_irq_save(flags); | 64 | gpio_request(pin, "temporary"); |
147 | 65 | gpio_set_value(pin, to); | |
148 | dat = __raw_readl(base + 0x04); | 66 | gpio_free(pin); |
149 | dat &= ~(1 << offs); | ||
150 | dat |= to << offs; | ||
151 | __raw_writel(dat, base + 0x04); | ||
152 | |||
153 | local_irq_restore(flags); | ||
154 | } | 67 | } |
155 | 68 | ||
156 | EXPORT_SYMBOL(s3c2410_gpio_setpin); | 69 | EXPORT_SYMBOL(s3c2410_gpio_setpin); |
157 | 70 | ||
158 | unsigned int s3c2410_gpio_getpin(unsigned int pin) | 71 | unsigned int s3c2410_gpio_getpin(unsigned int pin) |
159 | { | 72 | { |
160 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | 73 | struct s3c_gpio_chip *chip = s3c_gpiolib_getchip(pin); |
161 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | 74 | unsigned long offs = pin - chip->chip.base; |
162 | 75 | ||
163 | return __raw_readl(base + 0x04) & (1<< offs); | 76 | return __raw_readl(chip->base + 0x04) & (1<< offs); |
164 | } | 77 | } |
165 | 78 | ||
166 | EXPORT_SYMBOL(s3c2410_gpio_getpin); | 79 | EXPORT_SYMBOL(s3c2410_gpio_getpin); |
@@ -181,22 +94,3 @@ unsigned int s3c2410_modify_misccr(unsigned int clear, unsigned int change) | |||
181 | } | 94 | } |
182 | 95 | ||
183 | EXPORT_SYMBOL(s3c2410_modify_misccr); | 96 | EXPORT_SYMBOL(s3c2410_modify_misccr); |
184 | |||
185 | int s3c2410_gpio_getirq(unsigned int pin) | ||
186 | { | ||
187 | if (pin < S3C2410_GPF(0) || pin > S3C2410_GPG(15)) | ||
188 | return -EINVAL; /* not valid interrupts */ | ||
189 | |||
190 | if (pin < S3C2410_GPG(0) && pin > S3C2410_GPF(7)) | ||
191 | return -EINVAL; /* not valid pin */ | ||
192 | |||
193 | if (pin < S3C2410_GPF(4)) | ||
194 | return (pin - S3C2410_GPF(0)) + IRQ_EINT0; | ||
195 | |||
196 | if (pin < S3C2410_GPG(0)) | ||
197 | return (pin - S3C2410_GPF(4)) + IRQ_EINT4; | ||
198 | |||
199 | return (pin - S3C2410_GPG(0)) + IRQ_EINT8; | ||
200 | } | ||
201 | |||
202 | EXPORT_SYMBOL(s3c2410_gpio_getirq); | ||
diff --git a/arch/arm/plat-s3c24xx/gpiolib.c b/arch/arm/plat-s3c24xx/gpiolib.c index 4f0f11a6a677..4c0896f2572d 100644 --- a/arch/arm/plat-s3c24xx/gpiolib.c +++ b/arch/arm/plat-s3c24xx/gpiolib.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* linux/arch/arm/plat-s3c24xx/gpiolib.c | 1 | /* linux/arch/arm/plat-s3c24xx/gpiolib.c |
2 | * | 2 | * |
3 | * Copyright (c) 2008 Simtec Electronics | 3 | * Copyright (c) 2008-2010 Simtec Electronics |
4 | * http://armlinux.simtec.co.uk/ | 4 | * http://armlinux.simtec.co.uk/ |
5 | * Ben Dooks <ben@simtec.co.uk> | 5 | * Ben Dooks <ben@simtec.co.uk> |
6 | * | 6 | * |
@@ -21,6 +21,8 @@ | |||
21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
22 | 22 | ||
23 | #include <plat/gpio-core.h> | 23 | #include <plat/gpio-core.h> |
24 | #include <plat/gpio-cfg.h> | ||
25 | #include <plat/gpio-cfg-helpers.h> | ||
24 | #include <mach/hardware.h> | 26 | #include <mach/hardware.h> |
25 | #include <asm/irq.h> | 27 | #include <asm/irq.h> |
26 | #include <plat/pm.h> | 28 | #include <plat/pm.h> |
@@ -77,10 +79,21 @@ static int s3c24xx_gpiolib_bankg_toirq(struct gpio_chip *chip, unsigned offset) | |||
77 | return IRQ_EINT8 + offset; | 79 | return IRQ_EINT8 + offset; |
78 | } | 80 | } |
79 | 81 | ||
82 | static struct s3c_gpio_cfg s3c24xx_gpiocfg_banka = { | ||
83 | .set_config = s3c_gpio_setcfg_s3c24xx_a, | ||
84 | .get_config = s3c_gpio_getcfg_s3c24xx_a, | ||
85 | }; | ||
86 | |||
87 | struct s3c_gpio_cfg s3c24xx_gpiocfg_default = { | ||
88 | .set_config = s3c_gpio_setcfg_s3c24xx, | ||
89 | .get_config = s3c_gpio_getcfg_s3c24xx, | ||
90 | }; | ||
91 | |||
80 | struct s3c_gpio_chip s3c24xx_gpios[] = { | 92 | struct s3c_gpio_chip s3c24xx_gpios[] = { |
81 | [0] = { | 93 | [0] = { |
82 | .base = S3C2410_GPACON, | 94 | .base = S3C2410_GPACON, |
83 | .pm = __gpio_pm(&s3c_gpio_pm_1bit), | 95 | .pm = __gpio_pm(&s3c_gpio_pm_1bit), |
96 | .config = &s3c24xx_gpiocfg_banka, | ||
84 | .chip = { | 97 | .chip = { |
85 | .base = S3C2410_GPA(0), | 98 | .base = S3C2410_GPA(0), |
86 | .owner = THIS_MODULE, | 99 | .owner = THIS_MODULE, |
@@ -161,15 +174,58 @@ struct s3c_gpio_chip s3c24xx_gpios[] = { | |||
161 | .ngpio = 11, | 174 | .ngpio = 11, |
162 | }, | 175 | }, |
163 | }, | 176 | }, |
177 | /* GPIOS for the S3C2443 and later devices. */ | ||
178 | { | ||
179 | .base = S3C2440_GPJCON, | ||
180 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
181 | .chip = { | ||
182 | .base = S3C2410_GPJ(0), | ||
183 | .owner = THIS_MODULE, | ||
184 | .label = "GPIOJ", | ||
185 | .ngpio = 16, | ||
186 | }, | ||
187 | }, { | ||
188 | .base = S3C2443_GPKCON, | ||
189 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
190 | .chip = { | ||
191 | .base = S3C2410_GPK(0), | ||
192 | .owner = THIS_MODULE, | ||
193 | .label = "GPIOK", | ||
194 | .ngpio = 16, | ||
195 | }, | ||
196 | }, { | ||
197 | .base = S3C2443_GPLCON, | ||
198 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
199 | .chip = { | ||
200 | .base = S3C2410_GPL(0), | ||
201 | .owner = THIS_MODULE, | ||
202 | .label = "GPIOL", | ||
203 | .ngpio = 15, | ||
204 | }, | ||
205 | }, { | ||
206 | .base = S3C2443_GPMCON, | ||
207 | .pm = __gpio_pm(&s3c_gpio_pm_2bit), | ||
208 | .chip = { | ||
209 | .base = S3C2410_GPM(0), | ||
210 | .owner = THIS_MODULE, | ||
211 | .label = "GPIOM", | ||
212 | .ngpio = 2, | ||
213 | }, | ||
214 | }, | ||
164 | }; | 215 | }; |
165 | 216 | ||
217 | |||
166 | static __init int s3c24xx_gpiolib_init(void) | 218 | static __init int s3c24xx_gpiolib_init(void) |
167 | { | 219 | { |
168 | struct s3c_gpio_chip *chip = s3c24xx_gpios; | 220 | struct s3c_gpio_chip *chip = s3c24xx_gpios; |
169 | int gpn; | 221 | int gpn; |
170 | 222 | ||
171 | for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) | 223 | for (gpn = 0; gpn < ARRAY_SIZE(s3c24xx_gpios); gpn++, chip++) { |
224 | if (!chip->config) | ||
225 | chip->config = &s3c24xx_gpiocfg_default; | ||
226 | |||
172 | s3c_gpiolib_add(chip); | 227 | s3c_gpiolib_add(chip); |
228 | } | ||
173 | 229 | ||
174 | return 0; | 230 | return 0; |
175 | } | 231 | } |
diff --git a/arch/arm/plat-s3c24xx/pm.c b/arch/arm/plat-s3c24xx/pm.c index 3620dd299095..60627e63a254 100644 --- a/arch/arm/plat-s3c24xx/pm.c +++ b/arch/arm/plat-s3c24xx/pm.c | |||
@@ -43,6 +43,7 @@ | |||
43 | 43 | ||
44 | #include <asm/mach/time.h> | 44 | #include <asm/mach/time.h> |
45 | 45 | ||
46 | #include <plat/gpio-cfg.h> | ||
46 | #include <plat/pm.h> | 47 | #include <plat/pm.h> |
47 | 48 | ||
48 | #define PFX "s3c24xx-pm: " | 49 | #define PFX "s3c24xx-pm: " |
@@ -90,22 +91,22 @@ static void s3c_pm_check_resume_pin(unsigned int pin, unsigned int irqoffs) | |||
90 | { | 91 | { |
91 | unsigned long irqstate; | 92 | unsigned long irqstate; |
92 | unsigned long pinstate; | 93 | unsigned long pinstate; |
93 | int irq = s3c2410_gpio_getirq(pin); | 94 | int irq = gpio_to_irq(pin); |
94 | 95 | ||
95 | if (irqoffs < 4) | 96 | if (irqoffs < 4) |
96 | irqstate = s3c_irqwake_intmask & (1L<<irqoffs); | 97 | irqstate = s3c_irqwake_intmask & (1L<<irqoffs); |
97 | else | 98 | else |
98 | irqstate = s3c_irqwake_eintmask & (1L<<irqoffs); | 99 | irqstate = s3c_irqwake_eintmask & (1L<<irqoffs); |
99 | 100 | ||
100 | pinstate = s3c2410_gpio_getcfg(pin); | 101 | pinstate = s3c_gpio_getcfg(pin); |
101 | 102 | ||
102 | if (!irqstate) { | 103 | if (!irqstate) { |
103 | if (pinstate == S3C2410_GPIO_IRQ) | 104 | if (pinstate == S3C2410_GPIO_IRQ) |
104 | S3C_PMDBG("Leaving IRQ %d (pin %d) enabled\n", irq, pin); | 105 | S3C_PMDBG("Leaving IRQ %d (pin %d) as is\n", irq, pin); |
105 | } else { | 106 | } else { |
106 | if (pinstate == S3C2410_GPIO_IRQ) { | 107 | if (pinstate == S3C2410_GPIO_IRQ) { |
107 | S3C_PMDBG("Disabling IRQ %d (pin %d)\n", irq, pin); | 108 | S3C_PMDBG("Disabling IRQ %d (pin %d)\n", irq, pin); |
108 | s3c2410_gpio_cfgpin(pin, S3C2410_GPIO_INPUT); | 109 | s3c_gpio_cfgpin(pin, S3C2410_GPIO_INPUT); |
109 | } | 110 | } |
110 | } | 111 | } |
111 | } | 112 | } |
diff --git a/arch/arm/plat-s3c24xx/setup-i2c.c b/arch/arm/plat-s3c24xx/setup-i2c.c index 71a6accf114e..9e90a7cbd1d6 100644 --- a/arch/arm/plat-s3c24xx/setup-i2c.c +++ b/arch/arm/plat-s3c24xx/setup-i2c.c | |||
@@ -15,12 +15,13 @@ | |||
15 | 15 | ||
16 | struct platform_device; | 16 | struct platform_device; |
17 | 17 | ||
18 | #include <plat/gpio-cfg.h> | ||
18 | #include <plat/iic.h> | 19 | #include <plat/iic.h> |
19 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
20 | #include <mach/regs-gpio.h> | 21 | #include <mach/regs-gpio.h> |
21 | 22 | ||
22 | void s3c_i2c0_cfg_gpio(struct platform_device *dev) | 23 | void s3c_i2c0_cfg_gpio(struct platform_device *dev) |
23 | { | 24 | { |
24 | s3c2410_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPE15_IICSDA); | 25 | s3c_gpio_cfgpin(S3C2410_GPE(15), S3C2410_GPE15_IICSDA); |
25 | s3c2410_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPE14_IICSCL); | 26 | s3c_gpio_cfgpin(S3C2410_GPE(14), S3C2410_GPE14_IICSCL); |
26 | } | 27 | } |
diff --git a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c index da7a61728c18..9793544a6ace 100644 --- a/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c +++ b/arch/arm/plat-s3c24xx/spi-bus0-gpe11_12_13.c | |||
@@ -21,16 +21,16 @@ void s3c24xx_spi_gpiocfg_bus0_gpe11_12_13(struct s3c2410_spi_info *spi, | |||
21 | int enable) | 21 | int enable) |
22 | { | 22 | { |
23 | if (enable) { | 23 | if (enable) { |
24 | s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPE13_SPICLK0); | 24 | s3c_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPE13_SPICLK0); |
25 | s3c2410_gpio_cfgpin(S3C2410_GPE(12), S3C2410_GPE12_SPIMOSI0); | 25 | s3c_gpio_cfgpin(S3C2410_GPE(12), S3C2410_GPE12_SPIMOSI0); |
26 | s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPE11_SPIMISO0); | 26 | s3c_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPE11_SPIMISO0); |
27 | s3c2410_gpio_pullup(S3C2410_GPE(11), 0); | 27 | s3c2410_gpio_pullup(S3C2410_GPE(11), 0); |
28 | s3c2410_gpio_pullup(S3C2410_GPE(13), 0); | 28 | s3c2410_gpio_pullup(S3C2410_GPE(13), 0); |
29 | } else { | 29 | } else { |
30 | s3c2410_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT); | 30 | s3c_gpio_cfgpin(S3C2410_GPE(13), S3C2410_GPIO_INPUT); |
31 | s3c2410_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT); | 31 | s3c_gpio_cfgpin(S3C2410_GPE(11), S3C2410_GPIO_INPUT); |
32 | s3c2410_gpio_pullup(S3C2410_GPE(11), 1); | 32 | s3c_gpio_cfgpull(S3C2410_GPE(11), S3C_GPIO_PULL_NONE); |
33 | s3c2410_gpio_pullup(S3C2410_GPE(12), 1); | 33 | s3c_gpio_cfgpull(S3C2410_GPE(12), S3C_GPIO_PULL_NONE); |
34 | s3c2410_gpio_pullup(S3C2410_GPE(13), 1); | 34 | s3c_gpio_cfgpull(S3C2410_GPE(13), S3C_GPIO_PULL_NONE); |
35 | } | 35 | } |
36 | } | 36 | } |
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c index 89fcf5308cf6..db9e9e477ec1 100644 --- a/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c +++ b/arch/arm/plat-s3c24xx/spi-bus1-gpd8_9_10.c | |||
@@ -23,16 +23,16 @@ void s3c24xx_spi_gpiocfg_bus1_gpd8_9_10(struct s3c2410_spi_info *spi, | |||
23 | 23 | ||
24 | printk(KERN_INFO "%s(%d)\n", __func__, enable); | 24 | printk(KERN_INFO "%s(%d)\n", __func__, enable); |
25 | if (enable) { | 25 | if (enable) { |
26 | s3c2410_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1); | 26 | s3c_gpio_cfgpin(S3C2410_GPD(10), S3C2440_GPD10_SPICLK1); |
27 | s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1); | 27 | s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2440_GPD9_SPIMOSI1); |
28 | s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1); | 28 | s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2440_GPD8_SPIMISO1); |
29 | s3c2410_gpio_pullup(S3C2410_GPD(10), 0); | 29 | s3c2410_gpio_pullup(S3C2410_GPD(10), 0); |
30 | s3c2410_gpio_pullup(S3C2410_GPD(9), 0); | 30 | s3c2410_gpio_pullup(S3C2410_GPD(9), 0); |
31 | } else { | 31 | } else { |
32 | s3c2410_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); | 32 | s3c_gpio_cfgpin(S3C2410_GPD(8), S3C2410_GPIO_INPUT); |
33 | s3c2410_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); | 33 | s3c_gpio_cfgpin(S3C2410_GPD(9), S3C2410_GPIO_INPUT); |
34 | s3c2410_gpio_pullup(S3C2410_GPD(10), 1); | 34 | s3c_gpio_cfgpull(S3C2410_GPD(10), S3C_GPIO_PULL_NONE); |
35 | s3c2410_gpio_pullup(S3C2410_GPD(9), 1); | 35 | s3c_gpio_cfgpull(S3C2410_GPD(9), S3C_GPIO_PULL_NONE); |
36 | s3c2410_gpio_pullup(S3C2410_GPD(8), 1); | 36 | s3c_gpio_cfgpull(S3C2410_GPD(8), S3C_GPIO_PULL_NONE); |
37 | } | 37 | } |
38 | } | 38 | } |
diff --git a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c index 86b9edc67413..8ea663a438bb 100644 --- a/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c +++ b/arch/arm/plat-s3c24xx/spi-bus1-gpg5_6_7.c | |||
@@ -21,16 +21,16 @@ void s3c24xx_spi_gpiocfg_bus1_gpg5_6_7(struct s3c2410_spi_info *spi, | |||
21 | int enable) | 21 | int enable) |
22 | { | 22 | { |
23 | if (enable) { | 23 | if (enable) { |
24 | s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1); | 24 | s3c_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPG7_SPICLK1); |
25 | s3c2410_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1); | 25 | s3c_gpio_cfgpin(S3C2410_GPG(6), S3C2410_GPG6_SPIMOSI1); |
26 | s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1); | 26 | s3c_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPG5_SPIMISO1); |
27 | s3c2410_gpio_pullup(S3C2410_GPG(5), 0); | 27 | s3c2410_gpio_pullup(S3C2410_GPG(5), 0); |
28 | s3c2410_gpio_pullup(S3C2410_GPG(6), 0); | 28 | s3c2410_gpio_pullup(S3C2410_GPG(6), 0); |
29 | } else { | 29 | } else { |
30 | s3c2410_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT); | 30 | s3c_gpio_cfgpin(S3C2410_GPG(7), S3C2410_GPIO_INPUT); |
31 | s3c2410_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT); | 31 | s3c_gpio_cfgpin(S3C2410_GPG(5), S3C2410_GPIO_INPUT); |
32 | s3c2410_gpio_pullup(S3C2410_GPG(5), 1); | 32 | s3c_gpio_cfgpull(S3C2410_GPG(5), S3C_GPIO_PULL_NONE); |
33 | s3c2410_gpio_pullup(S3C2410_GPG(6), 1); | 33 | s3c_gpio_cfgpull(S3C2410_GPG(6), S3C_GPIO_PULL_NONE); |
34 | s3c2410_gpio_pullup(S3C2410_GPG(7), 1); | 34 | s3c_gpio_cfgpull(S3C2410_GPG(7), S3C_GPIO_PULL_NONE); |
35 | } | 35 | } |
36 | } | 36 | } |