summary refs log tree commit diff
path: root/gnu/packages/patches/linux-libre-pinebook-pro-13-ASoC-soc-jack.c-supported-inverted-jack-detect-GPIOs.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/linux-libre-pinebook-pro-13-ASoC-soc-jack.c-supported-inverted-jack-detect-GPIOs.patch')
-rw-r--r--gnu/packages/patches/linux-libre-pinebook-pro-13-ASoC-soc-jack.c-supported-inverted-jack-detect-GPIOs.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/gnu/packages/patches/linux-libre-pinebook-pro-13-ASoC-soc-jack.c-supported-inverted-jack-detect-GPIOs.patch b/gnu/packages/patches/linux-libre-pinebook-pro-13-ASoC-soc-jack.c-supported-inverted-jack-detect-GPIOs.patch
new file mode 100644
index 0000000000..4474287811
--- /dev/null
+++ b/gnu/packages/patches/linux-libre-pinebook-pro-13-ASoC-soc-jack.c-supported-inverted-jack-detect-GPIOs.patch
@@ -0,0 +1,45 @@
+From f171e08de69e55167fbab2fd3e15b5ee10024e80 Mon Sep 17 00:00:00 2001
+From: Tobias Schramm <t.schramm@manjaro.org>
+Date: Thu, 28 May 2020 14:36:47 +0200
+Subject: [PATCH 13/22] ASoC: soc-jack.c: supported inverted jack detect GPIOs
+
+Signed-off-by: Tobias Schramm <t.schramm@manjaro.org>
+---
+ sound/soc/soc-jack.c | 7 ++++---
+ 1 file changed, 4 insertions(+), 3 deletions(-)
+
+diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
+index 0f1820f36b4d..8d9d77814f33 100644
+--- a/sound/soc/soc-jack.c
++++ b/sound/soc/soc-jack.c
+@@ -216,8 +216,6 @@ static void snd_soc_jack_gpio_detect(struct snd_soc_jack_gpio *gpio)
+ 	int report;
+ 
+ 	enable = gpiod_get_value_cansleep(gpio->desc);
+-	if (gpio->invert)
+-		enable = !enable;
+ 
+ 	if (enable)
+ 		report = gpio->report;
+@@ -346,6 +344,9 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
+ 				goto undo;
+ 			}
+ 		} else {
++			int flags = GPIOF_IN;
++			if (gpios[i].invert)
++				flags |= GPIOF_ACTIVE_LOW;
+ 			/* legacy GPIO number */
+ 			if (!gpio_is_valid(gpios[i].gpio)) {
+ 				dev_err(jack->card->dev,
+@@ -355,7 +356,7 @@ int snd_soc_jack_add_gpios(struct snd_soc_jack *jack, int count,
+ 				goto undo;
+ 			}
+ 
+-			ret = gpio_request_one(gpios[i].gpio, GPIOF_IN,
++			ret = gpio_request_one(gpios[i].gpio, flags,
+ 					       gpios[i].name);
+ 			if (ret)
+ 				goto undo;
+-- 
+2.30.0
+