diff options
Diffstat (limited to 'drivers/gpio')
-rw-r--r-- | drivers/gpio/omap_gpio.c | 2 | ||||
-rw-r--r-- | drivers/gpio/s3c2440_gpio.c | 6 | ||||
-rw-r--r-- | drivers/gpio/s5p_gpio.c | 9 |
3 files changed, 5 insertions, 12 deletions
diff --git a/drivers/gpio/omap_gpio.c b/drivers/gpio/omap_gpio.c index a30d7f0603..f16e9ae4d2 100644 --- a/drivers/gpio/omap_gpio.c +++ b/drivers/gpio/omap_gpio.c @@ -55,7 +55,7 @@ static inline int get_gpio_index(int gpio) int gpio_is_valid(int gpio) { - return (gpio >= 0) && (gpio < 192); + return (gpio >= 0) && (gpio < OMAP_MAX_GPIO); } static int check_gpio(int gpio) diff --git a/drivers/gpio/s3c2440_gpio.c b/drivers/gpio/s3c2440_gpio.c index 43bbf1160c..09b04eb94a 100644 --- a/drivers/gpio/s3c2440_gpio.c +++ b/drivers/gpio/s3c2440_gpio.c @@ -61,7 +61,7 @@ int gpio_set_value(unsigned gpio, int value) else l &= ~bit; - return writel(port, l); + return writel(l, port); } int gpio_get_value(unsigned gpio) @@ -85,11 +85,11 @@ int gpio_free(unsigned gpio) int gpio_direction_input(unsigned gpio) { - return writel(GPIO_FULLPORT(gpio), GPIO_INPUT << GPIO_BIT(gpio)); + return writel(GPIO_INPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio)); } int gpio_direction_output(unsigned gpio, int value) { - writel(GPIO_FULLPORT(gpio), GPIO_OUTPUT << GPIO_BIT(gpio)); + writel(GPIO_OUTPUT << GPIO_BIT(gpio), GPIO_FULLPORT(gpio)); return gpio_set_value(gpio, value); } diff --git a/drivers/gpio/s5p_gpio.c b/drivers/gpio/s5p_gpio.c index 656bf4a06c..4efb768551 100644 --- a/drivers/gpio/s5p_gpio.c +++ b/drivers/gpio/s5p_gpio.c @@ -48,15 +48,8 @@ void s5p_gpio_cfg_pin(struct s5p_gpio_bank *bank, int gpio, int cfg) void s5p_gpio_direction_output(struct s5p_gpio_bank *bank, int gpio, int en) { - unsigned int value; - s5p_gpio_cfg_pin(bank, gpio, GPIO_OUTPUT); - - value = readl(&bank->dat); - value &= ~DAT_MASK(gpio); - if (en) - value |= DAT_SET(gpio); - writel(value, &bank->dat); + s5p_gpio_set_value(bank, gpio, en); } void s5p_gpio_direction_input(struct s5p_gpio_bank *bank, int gpio) |