[PATCH 1/4] gpio-imx: Do not use gpio_set_value()
Andrey Smirnov
andrew.smirnov at gmail.com
Mon May 22 08:24:17 PDT 2017
Do not use gpio_set_value() in imx_gpio_direction_output() for two
reasons:
- Since we don't check gpio_set_value's result, using it
instead of imx_gpio_set_value doesn't seem to have any
advantages
- Using gpiolib's function at this level makes it hard to
implement 'active low' support (commit that follows) since
gpio driver is dealing with physical GPIO levels, whereas
gpiolib is explected to accept logical levels.
As a remedy swithch imx_gpio_direction_output() to using
imx_gpio_set_value().
Cc: cphealy at gmail.com
Cc: Nikita Yushchenko <nikita.yoush at cogentembedded.com>
Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
drivers/gpio/gpio-imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpio/gpio-imx.c b/drivers/gpio/gpio-imx.c
index ab4f596..a9d44d4 100644
--- a/drivers/gpio/gpio-imx.c
+++ b/drivers/gpio/gpio-imx.c
@@ -93,7 +93,7 @@ static int imx_gpio_direction_output(struct gpio_chip *chip, unsigned gpio, int
void __iomem *base = imxgpio->base;
u32 val;
- gpio_set_value(gpio + chip->base, value);
+ imx_gpio_set_value(chip, gpio, value);
val = readl(base + imxgpio->regs->gdir);
val |= 1 << gpio;
--
2.9.3
More information about the barebox
mailing list