bcm27xx: update 6.1 patches from RPi foundation
[openwrt/staging/xback.git] / target / linux / bcm27xx / patches-6.1 / 950-1249-Pisound-Don-t-export-the-button-GPIO-via-sysfs-GPIO-.patch
1 From cd62562b276b5724d1c75ea1465937a5bd9037db Mon Sep 17 00:00:00 2001
2 From: Giedrius <giedrius@blokas.io>
3 Date: Fri, 19 Jan 2024 10:55:55 +0000
4 Subject: [PATCH 1249/1295] Pisound: Don't export the button GPIO via sysfs
5 GPIO class.
6 MIME-Version: 1.0
7 Content-Type: text/plain; charset=UTF-8
8 Content-Transfer-Encoding: 8bit
9
10 Signed-off-by: Giedrius Trainavičius <giedrius@blokas.io>
11 ---
12 sound/soc/bcm/pisound.c | 9 +--------
13 1 file changed, 1 insertion(+), 8 deletions(-)
14
15 --- a/sound/soc/bcm/pisound.c
16 +++ b/sound/soc/bcm/pisound.c
17 @@ -857,7 +857,6 @@ static int pisnd_ctl_uninit(void)
18
19 static struct gpio_desc *osr0, *osr1, *osr2;
20 static struct gpio_desc *reset;
21 -static struct gpio_desc *button;
22
23 static int pisnd_hw_params(
24 struct snd_pcm_substream *substream,
25 @@ -1016,8 +1015,6 @@ static int pisnd_init_gpio(struct device
26
27 reset = gpiod_get_index(dev, "reset", 0, GPIOD_ASIS);
28
29 - button = gpiod_get_index(dev, "button", 0, GPIOD_ASIS);
30 -
31 gpiod_direction_output(osr0, 1);
32 gpiod_direction_output(osr1, 1);
33 gpiod_direction_output(osr2, 1);
34 @@ -1029,8 +1026,6 @@ static int pisnd_init_gpio(struct device
35 gpiod_set_value(osr2, false);
36 gpiod_set_value(reset, true);
37
38 - gpiod_export(button, false);
39 -
40 return 0;
41 }
42
43 @@ -1039,11 +1034,9 @@ static int pisnd_uninit_gpio(void)
44 int i;
45
46 struct gpio_desc **gpios[] = {
47 - &osr0, &osr1, &osr2, &reset, &button,
48 + &osr0, &osr1, &osr2, &reset,
49 };
50
51 - gpiod_unexport(button);
52 -
53 for (i = 0; i < ARRAY_SIZE(gpios); ++i) {
54 if (*gpios[i] == NULL) {
55 printd("weird, GPIO[%d] is NULL already\n", i);