Skip to content

Commit 4ff8b4c

Browse files
Phil Elwellpopcornmix
authored andcommitted
pinctrl-bcm2835: bcm2835_gpio_direction_output must set the value
1 parent 81042a7 commit 4ff8b4c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

drivers/pinctrl/pinctrl-bcm2835.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,14 @@ static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset)
355355
static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
356356
unsigned offset, int value)
357357
{
358-
return pinctrl_gpio_direction_output(chip->base + offset);
358+
struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
359+
int ret;
360+
361+
ret = pinctrl_gpio_direction_output(chip->base + offset);
362+
if (ret >= 0)
363+
bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);
364+
365+
return ret;
359366
}
360367

361368
static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)

0 commit comments

Comments
 (0)