Commit 4b2b0a2c authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Bartosz Golaszewski

gpiolib: legacy: Kill GPIOF_INIT_* definitions

Besides the fact that (old) drivers use wrong definitions, e.g.,
GPIOF_INIT_HIGH instead of GPIOF_OUT_INIT_HIGH, shrink the legacy
definitions by killing those GPIOF_INIT_* 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-2-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarBartosz Golaszewski <bartosz.golaszewski@linaro.org>
parent 1882e769
...@@ -76,8 +76,7 @@ static int vision_lcd_setup(struct platform_device *pdev) ...@@ -76,8 +76,7 @@ static int vision_lcd_setup(struct platform_device *pdev)
{ {
int err; int err;
err = gpio_request_one(VISION_LCD_ENABLE, GPIOF_INIT_HIGH, err = gpio_request_one(VISION_LCD_ENABLE, GPIOF_OUT_INIT_HIGH, dev_name(&pdev->dev));
dev_name(&pdev->dev));
if (err) if (err)
return err; return err;
......
...@@ -42,7 +42,7 @@ static struct board_info __initdata board_cvg834g = { ...@@ -42,7 +42,7 @@ static struct board_info __initdata board_cvg834g = {
.expected_cpu_id = 0x3368, .expected_cpu_id = 0x3368,
.ephy_reset_gpio = 36, .ephy_reset_gpio = 36,
.ephy_reset_gpio_flags = GPIOF_INIT_HIGH, .ephy_reset_gpio_flags = GPIOF_OUT_INIT_HIGH,
.has_pci = 1, .has_pci = 1,
.has_uart0 = 1, .has_uart0 = 1,
.has_uart1 = 1, .has_uart1 = 1,
......
...@@ -43,8 +43,7 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label) ...@@ -43,8 +43,7 @@ int gpio_request_one(unsigned gpio, unsigned long flags, const char *label)
if (flags & GPIOF_DIR_IN) if (flags & GPIOF_DIR_IN)
err = gpiod_direction_input(desc); err = gpiod_direction_input(desc);
else else
err = gpiod_direction_output_raw(desc, err = gpiod_direction_output_raw(desc, !!(flags & GPIOF_OUT_INIT_HIGH));
(flags & GPIOF_INIT_HIGH) ? 1 : 0);
if (err) if (err)
goto free_gpio; goto free_gpio;
......
...@@ -20,12 +20,9 @@ struct device; ...@@ -20,12 +20,9 @@ struct device;
#define GPIOF_DIR_OUT (0 << 0) #define GPIOF_DIR_OUT (0 << 0)
#define GPIOF_DIR_IN (1 << 0) #define GPIOF_DIR_IN (1 << 0)
#define GPIOF_INIT_LOW (0 << 1)
#define GPIOF_INIT_HIGH (1 << 1)
#define GPIOF_IN (GPIOF_DIR_IN) #define GPIOF_IN (GPIOF_DIR_IN)
#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW) #define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | (0 << 1))
#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH) #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