pinctrl: cherryview: Use GPIO direction definitions
authorMatti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Thu, 12 Dec 2019 06:35:19 +0000 (08:35 +0200)
committerAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 13 Dec 2019 14:48:47 +0000 (16:48 +0200)
Use new GPIO_LINE_DIRECTION_IN and GPIO_LINE_DIRECTION_OUT when
returning GPIO direction to GPIO framework.

Signed-off-by: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
drivers/pinctrl/intel/pinctrl-cherryview.c

index 60527b9..4c74fdd 100644 (file)
@@ -1289,7 +1289,10 @@ static int chv_gpio_get_direction(struct gpio_chip *chip, unsigned int offset)
        direction = ctrl0 & CHV_PADCTRL0_GPIOCFG_MASK;
        direction >>= CHV_PADCTRL0_GPIOCFG_SHIFT;
 
-       return direction != CHV_PADCTRL0_GPIOCFG_GPO;
+       if (direction == CHV_PADCTRL0_GPIOCFG_GPO)
+               return GPIO_LINE_DIRECTION_OUT;
+
+       return GPIO_LINE_DIRECTION_IN;
 }
 
 static int chv_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)