There are macros in gpio kernel's headers to define direction
of a gpio. Use them instead of return custom '0' and '1' values.
Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
#include <linux/io.h>
#include <linux/err.h>
+#include <linux/gpio.h>
#include <linux/gpio/driver.h>
#include <linux/module.h>
#include <linux/of_irq.h>
struct mtk_gc *rg = to_mediatek_gpio(chip);
u32 t = mtk_gpio_r32(rg, GPIO_REG_CTRL);
- return (t & BIT(offset)) ? 0 : 1;
+ return (t & BIT(offset)) ? GPIOF_DIR_OUT : GPIOF_DIR_IN;
}
static int