From e23fcf37d3d3ad36507197a306c153dd087b8626 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E9=BB=84=E6=B6=9B?= Date: Tue, 8 Jan 2013 11:22:17 +0800 Subject: [PATCH] gpio-rk30: fix pull updown setup --- drivers/gpio/gpio-rk30.c | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/drivers/gpio/gpio-rk30.c b/drivers/gpio/gpio-rk30.c index 386629aa67ba..70b42178814e 100755 --- a/drivers/gpio/gpio-rk30.c +++ b/drivers/gpio/gpio-rk30.c @@ -325,18 +325,25 @@ static void rk30_gpiolib_set(struct gpio_chip *chip, unsigned offset, int val) spin_unlock_irqrestore(&bank->lock, flags); } -static int rk30_gpiolib_pull_updown(struct gpio_chip *chip, unsigned offset, unsigned enable) +static int rk30_gpiolib_pull_updown(struct gpio_chip *chip, unsigned offset, enum GPIOPullType type) { #if !defined(CONFIG_ARCH_RK3066B) struct rk30_gpio_bank *bank = to_rk30_gpio_bank(chip); - unsigned long flags; - - spin_lock_irqsave(&bank->lock, flags); - if(offset>=16) - rk30_gpio_bit_op((void *__iomem) RK30_GRF_BASE, GRF_GPIO0H_PULL + bank->id * 8, (1<id * 8; + + if (offset >= 16) + __raw_writel((1 << offset) | (val << (offset - 16)), base + GRF_GPIO0H_PULL); else - rk30_gpio_bit_op((void *__iomem) RK30_GRF_BASE, GRF_GPIO0L_PULL + bank->id * 8, (1<<(offset+16)) | offset_to_bit(offset), !enable); - spin_unlock_irqrestore(&bank->lock, flags); + __raw_writel((1 << (offset + 16)) | (val << offset), base + GRF_GPIO0L_PULL); #endif return 0; } -- 2.34.1