kernel: bump 4.19 to 4.19.95
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0701-gpio-Enable-nonexclusive-gpiods-from-DT-nodes.patch
1 From 76870d237adff4c8e419064e7d4f5a8ef87c1085 Mon Sep 17 00:00:00 2001
2 From: Linus Walleij <linus.walleij@linaro.org>
3 Date: Thu, 6 Dec 2018 13:43:44 +0100
4 Subject: [PATCH] gpio: Enable nonexclusive gpiods from DT nodes
5
6 commit ec757001c818c175e6b610e8ef80c2a25d1ed1a5 upstream.
7
8 This makes gpiod_get_from_of_node() respect the
9 GPIOD_FLAGS_BIT_NONEXCLUSIVE flag which is especially
10 nice when getting regulator GPIOs right out of device
11 tree nodes.
12
13 Suggested-by: Marek Szyprowski <m.szyprowski@samsung.com>
14 Fixes: b0ce7b29bfcd ("regulator/gpio: Allow nonexclusive GPIO access")
15 Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
16 Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
17 Tested-by: Marek Szyprowski <m.szyprowski@samsung.com>
18 Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com>
19 Signed-off-by: Mark Brown <broonie@kernel.org>
20 ---
21 drivers/gpio/gpiolib.c | 2 ++
22 1 file changed, 2 insertions(+)
23
24 --- a/drivers/gpio/gpiolib.c
25 +++ b/drivers/gpio/gpiolib.c
26 @@ -4061,6 +4061,8 @@ struct gpio_desc *gpiod_get_from_of_node
27 transitory = flags & OF_GPIO_TRANSITORY;
28
29 ret = gpiod_request(desc, label);
30 + if (ret == -EBUSY && (flags & GPIOD_FLAGS_BIT_NONEXCLUSIVE))
31 + return desc;
32 if (ret)
33 return ERR_PTR(ret);
34