summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorPhil Elwell <phil@raspberrypi.org>2015-02-04 10:02:24 +0000
committerpopcornmix <popcornmix@gmail.com>2015-05-18 14:11:44 +0100
commit393edfb884e28cb4a319c5d8ad07a0cddd67c6eb (patch)
tree2945fef3b95cf1c75154246005d1b3f4ddd80447 /drivers
parentf088dd8360ec7ff7b6103b52db94068e5204dd9a (diff)
downloadlinux-393edfb884e28cb4a319c5d8ad07a0cddd67c6eb.tar.gz
pinctrl-bcm2835: bcm2835_gpio_direction_output must set the value
Diffstat (limited to 'drivers')
-rw-r--r--drivers/pinctrl/pinctrl-bcm2835.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/drivers/pinctrl/pinctrl-bcm2835.c b/drivers/pinctrl/pinctrl-bcm2835.c
index 9d1149e8fd2c..d9c727ba42c0 100644
--- a/drivers/pinctrl/pinctrl-bcm2835.c
+++ b/drivers/pinctrl/pinctrl-bcm2835.c
@@ -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)