Skip to content

Commit 9bf3ac4

Browse files
BoughChenbrgl
authored andcommitted
gpio: gpio-vf610: do not touch other bits when set the target bit
For gpio controller contain register PDDR, when set one target bit, current logic will clear all other bits, this is wrong. Use operator '|=' to fix it. Fixes: 659d8a6 ("gpio: vf610: add imx7ulp support") Reviewed-by: Peng Fan <peng.fan@nxp.com> Signed-off-by: Haibo Chen <haibo.chen@nxp.com> Signed-off-by: Bartosz Golaszewski <brgl@bgdev.pl>
1 parent 42226c9 commit 9bf3ac4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

drivers/gpio/gpio-vf610.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,13 @@ static int vf610_gpio_direction_output(struct gpio_chip *chip, unsigned gpio,
125125
{
126126
struct vf610_gpio_port *port = gpiochip_get_data(chip);
127127
unsigned long mask = BIT(gpio);
128+
u32 val;
128129

129-
if (port->sdata && port->sdata->have_paddr)
130-
vf610_gpio_writel(mask, port->gpio_base + GPIO_PDDR);
130+
if (port->sdata && port->sdata->have_paddr) {
131+
val = vf610_gpio_readl(port->gpio_base + GPIO_PDDR);
132+
val |= mask;
133+
vf610_gpio_writel(val, port->gpio_base + GPIO_PDDR);
134+
}
131135

132136
vf610_gpio_set(chip, gpio, value);
133137

0 commit comments

Comments
 (0)