summaryrefslogtreecommitdiff
path: root/drivers/gpio
diff options
context:
space:
mode:
authorAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-07-10 20:40:47 +0200
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>2013-07-10 20:40:47 +0200
commit630aacb0859c6e26b2b0311d8e245da5e5b8ac67 (patch)
treee9f6f6c28ae4a655f4519ca0db7bc882f8ee9abc /drivers/gpio
parent87bd05d78f0f5765f3d3e1517c76794c82dab7cc (diff)
parent1ae76d438b602fe8be1f0ef8b8ce47c89d371047 (diff)
Merge branch 'u-boot-samsung/master' into 'u-boot-arm/master'
Diffstat (limited to 'drivers/gpio')
-rw-r--r--drivers/gpio/s3c2440_gpio.c6
-rw-r--r--drivers/gpio/s5p_gpio.c9
2 files changed, 4 insertions, 11 deletions
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)