Skip to content

Commit

Permalink
pinctrl: meson: fix pin input property for a4
Browse files Browse the repository at this point in the history
The register of pin input attribute means the opposite.
value of reigster meaning is 1 for input and 0 for output.
So fix it.

Fixes: 6e9be3a ("pinctrl: Add driver support for Amlogic SoCs")
Signed-off-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
Link: https://lore.kernel.org/20250303-fix-a4-pinctl-v1-1-6579888b4272@amlogic.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Xianwei Zhao authored and Linus Walleij committed Mar 4, 2025
1 parent 75f87f5 commit c3a0b61
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/pinctrl/meson/pinctrl-amlogic-a4.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,7 +775,7 @@ static int aml_gpio_get_direction(struct gpio_chip *chip, unsigned int gpio)
if (ret)
return ret;

return BIT(bit) & val ? GPIO_LINE_DIRECTION_OUT : GPIO_LINE_DIRECTION_IN;
return BIT(bit) & val ? GPIO_LINE_DIRECTION_IN : GPIO_LINE_DIRECTION_OUT;
}

static int aml_gpio_direction_input(struct gpio_chip *chip, unsigned int gpio)
Expand All @@ -785,7 +785,7 @@ static int aml_gpio_direction_input(struct gpio_chip *chip, unsigned int gpio)

aml_gpio_calc_reg_and_bit(bank, AML_REG_DIR, gpio, &reg, &bit);

return regmap_update_bits(bank->reg_gpio, reg, BIT(bit), 0);
return regmap_update_bits(bank->reg_gpio, reg, BIT(bit), BIT(bit));
}

static int aml_gpio_direction_output(struct gpio_chip *chip, unsigned int gpio,
Expand All @@ -796,7 +796,7 @@ static int aml_gpio_direction_output(struct gpio_chip *chip, unsigned int gpio,
int ret;

aml_gpio_calc_reg_and_bit(bank, AML_REG_DIR, gpio, &reg, &bit);
ret = regmap_update_bits(bank->reg_gpio, reg, BIT(bit), BIT(bit));
ret = regmap_update_bits(bank->reg_gpio, reg, BIT(bit), 0);
if (ret < 0)
return ret;

Expand Down

0 comments on commit c3a0b61

Please sign in to comment.