diff options
Diffstat (limited to 'arch/arm/plat-s3c24xx/gpio.c')
-rw-r--r-- | arch/arm/plat-s3c24xx/gpio.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/arch/arm/plat-s3c24xx/gpio.c b/arch/arm/plat-s3c24xx/gpio.c index ec3a09c4d181..ee99dcc7f0bd 100644 --- a/arch/arm/plat-s3c24xx/gpio.c +++ b/arch/arm/plat-s3c24xx/gpio.c | |||
@@ -122,6 +122,19 @@ void s3c2410_gpio_pullup(unsigned int pin, unsigned int to) | |||
122 | 122 | ||
123 | EXPORT_SYMBOL(s3c2410_gpio_pullup); | 123 | EXPORT_SYMBOL(s3c2410_gpio_pullup); |
124 | 124 | ||
125 | int s3c2410_gpio_getpull(unsigned int pin) | ||
126 | { | ||
127 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | ||
128 | unsigned long offs = S3C2410_GPIO_OFFSET(pin); | ||
129 | |||
130 | if (pin < S3C2410_GPIO_BANKB) | ||
131 | return -EINVAL; | ||
132 | |||
133 | return (__raw_readl(base + 0x08) & (1L << offs)) ? 1 : 0; | ||
134 | } | ||
135 | |||
136 | EXPORT_SYMBOL(s3c2410_gpio_getpull); | ||
137 | |||
125 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) | 138 | void s3c2410_gpio_setpin(unsigned int pin, unsigned int to) |
126 | { | 139 | { |
127 | void __iomem *base = S3C24XX_GPIO_BASE(pin); | 140 | void __iomem *base = S3C24XX_GPIO_BASE(pin); |
@@ -186,3 +199,19 @@ int s3c2410_gpio_getirq(unsigned int pin) | |||
186 | } | 199 | } |
187 | 200 | ||
188 | EXPORT_SYMBOL(s3c2410_gpio_getirq); | 201 | EXPORT_SYMBOL(s3c2410_gpio_getirq); |
202 | |||
203 | int s3c2410_gpio_irq2pin(unsigned int irq) | ||
204 | { | ||
205 | if (irq >= IRQ_EINT0 && irq <= IRQ_EINT3) | ||
206 | return S3C2410_GPF0 + (irq - IRQ_EINT0); | ||
207 | |||
208 | if (irq >= IRQ_EINT4 && irq <= IRQ_EINT7) | ||
209 | return S3C2410_GPF4 + (irq - IRQ_EINT4); | ||
210 | |||
211 | if (irq >= IRQ_EINT8 && irq <= IRQ_EINT23) | ||
212 | return S3C2410_GPG0 + (irq - IRQ_EINT8); | ||
213 | |||
214 | return -EINVAL; | ||
215 | } | ||
216 | |||
217 | EXPORT_SYMBOL(s3c2410_gpio_irq2pin); | ||