kernel: bump 4.19 to 4.19.85
[openwrt/openwrt.git] / target / linux / brcm2708 / patches-4.19 / 950-0129-gpiolib-Don-t-prevent-IRQ-usage-of-output-GPIOs.patch
1 From 1929780cf2cc997f990085bd878112b28f4175c9 Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Tue, 24 Apr 2018 14:42:27 +0100
4 Subject: [PATCH 129/806] gpiolib: Don't prevent IRQ usage of output GPIOs
5
6 Upstream Linux deems using output GPIOs to generate IRQs as a bogus
7 use case, even though the BCM2835 GPIO controller is capable of doing
8 so. A number of users would like to make use of this facility, so
9 disable the checks.
10
11 See: https://github.com/raspberrypi/linux/issues/2527
12
13 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
14 ---
15 drivers/gpio/gpiolib.c | 6 ++++--
16 1 file changed, 4 insertions(+), 2 deletions(-)
17
18 --- a/drivers/gpio/gpiolib.c
19 +++ b/drivers/gpio/gpiolib.c
20 @@ -53,6 +53,8 @@
21 #define extra_checks 0
22 #endif
23
24 +#define dont_test_bit(b,d) (0)
25 +
26 /* Device and char device-related information */
27 static DEFINE_IDA(gpio_ida);
28 static dev_t gpio_devt;
29 @@ -2654,7 +2656,7 @@ int gpiod_direction_output(struct gpio_d
30 value = !!value;
31
32 /* GPIOs used for IRQs shall not be set as output */
33 - if (test_bit(FLAG_USED_AS_IRQ, &desc->flags)) {
34 + if (dont_test_bit(FLAG_USED_AS_IRQ, &desc->flags)) {
35 gpiod_err(desc,
36 "%s: tried to set a GPIO tied to an IRQ as output\n",
37 __func__);
38 @@ -3353,7 +3355,7 @@ int gpiochip_lock_as_irq(struct gpio_chi
39 }
40 }
41
42 - if (test_bit(FLAG_IS_OUT, &desc->flags)) {
43 + if (dont_test_bit(FLAG_IS_OUT, &desc->flags)) {
44 chip_err(chip,
45 "%s: tried to flag a GPIO set as output for IRQ\n",
46 __func__);