Commit 8c045ca5 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski

gpiolib: legacy: Kill GPIOF_DIR_* definitions

Besides the fact that (old) drivers use wrong definitions, e.g.,
GPIOF_DIR_IN instead of GPIOF_IN, shrink the legacy definitions
by killing those GPIOF_DIR_* completely.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Acked-by: default avatarAlexander Sverdlin <alexander.sverdlin@gmail.com>
Reviewed-by: default avatarAlexander Sverdlin <alexander.sverdlin@gmail.com>
Link: https://lore.kernel.org/r/20240828142554.2424189-3-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 4b2b0a2c
...@@ -292,8 +292,7 @@ static void __init vision_init_machine(void) ...@@ -292,8 +292,7 @@ static void __init vision_init_machine(void)
* Request the gpio expander's interrupt gpio line now to prevent * Request the gpio expander's interrupt gpio line now to prevent
* the kernel from doing a WARN in gpiolib:gpio_ensure_requested(). * the kernel from doing a WARN in gpiolib:gpio_ensure_requested().
*/ */
if (gpio_request_one(EP93XX_GPIO_LINE_F(7), GPIOF_DIR_IN, if (gpio_request_one(EP93XX_GPIO_LINE_F(7), GPIOF_IN, "pca9539:74"))
"pca9539:74"))
pr_warn("cannot request interrupt gpio for pca9539:74\n"); pr_warn("cannot request interrupt gpio for pca9539:74\n");
vision_i2c_info[1].irq = gpio_to_irq(EP93XX_GPIO_LINE_F(7)); vision_i2c_info[1].irq = gpio_to_irq(EP93XX_GPIO_LINE_F(7));
......
...@@ -40,7 +40,7 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) ...@@ -40,7 +40,7 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
if (flags & GPIOF_ACTIVE_LOW) if (flags & GPIOF_ACTIVE_LOW)
set_bit(FLAG_ACTIVE_LOW, &desc->flags); set_bit(FLAG_ACTIVE_LOW, &desc->flags);
if (flags & GPIOF_DIR_IN) if (flags & GPIOF_IN)
err = gpiod_direction_input(desc); err = gpiod_direction_input(desc);
else else
err = gpiod_direction_output_raw(desc, !!(flags & GPIOF_OUT_INIT_HIGH)); err = gpiod_direction_output_raw(desc, !!(flags & GPIOF_OUT_INIT_HIGH));
......
...@@ -17,12 +17,9 @@ ...@@ -17,12 +17,9 @@
struct device; struct device;
/* make these flag values available regardless of GPIO kconfig options */ /* make these flag values available regardless of GPIO kconfig options */
#define GPIOF_DIR_OUT (0 << 0) #define GPIOF_IN ((1 << 0))
#define GPIOF_DIR_IN (1 << 0) #define GPIOF_OUT_INIT_LOW ((0 << 0) | (0 << 1))
#define GPIOF_OUT_INIT_HIGH ((0 << 0) | (1 << 1))
#define GPIOF_IN (GPIOF_DIR_IN)
#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | (0 << 1))
#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | (1 << 1))
/* Gpio pin is active-low */ /* Gpio pin is active-low */
#define GPIOF_ACTIVE_LOW (1 << 2) #define GPIOF_ACTIVE_LOW (1 << 2)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment