pinctrl-bcm2835: bcm2835_gpio_direction_output must set the value

This commit is contained in:
Phil Elwell
2015-02-04 10:02:24 +00:00
committed by popcornmix
parent d8649400d6
commit 1db9a8548d

View File

@@ -355,7 +355,14 @@ static int bcm2835_gpio_get(struct gpio_chip *chip, unsigned offset)
static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
unsigned offset, int value)
{
return pinctrl_gpio_direction_output(chip->base + offset);
struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
int ret;
ret = pinctrl_gpio_direction_output(chip->base + offset);
if (ret >= 0)
bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);
return ret;
}
static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)