OSDN Git Service

pinctrl: bcm2835: Add support for output-low output-high properties
authorMatheus Castello <matheus@castello.eng.br>
Tue, 1 May 2018 00:42:14 +0000 (20:42 -0400)
committerLinus Walleij <linus.walleij@linaro.org>
Wed, 16 May 2018 12:01:37 +0000 (14:01 +0200)
Properties to set initial value of pin output buffer.
This can be useful for configure hardware in overlay files, and in early
boot for checking it states in QA sanity tests.

Signed-off-by: Matheus Castello <matheus@castello.eng.br>
Reviewed-by: Eric Anholt <eric@anholt.net>
Acked-by: Stefan Wahren <stefan.wahren@i2se.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/bcm/pinctrl-bcm2835.c

index a0b1f5f..136ccaf 100644 (file)
@@ -965,6 +965,11 @@ static int bcm2835_pinconf_set(struct pinctrl_dev *pctldev,
                        bcm2835_pull_config_set(pc, pin, BCM2835_PUD_UP);
                        break;
 
+               /* Set output-high or output-low */
+               case PIN_CONFIG_OUTPUT:
+                       bcm2835_gpio_set_bit(pc, arg ? GPSET0 : GPCLR0, pin);
+                       break;
+
                default:
                        return -EINVAL;