armbian-build/patch/kernel/archive/spacemit-6.18/015-OrangePi-RV2-fix-internal-audio-activate-headphone-g.patch
Sven-Ola Tuecke bfb16c7a7b OrangePi-RV2: fix internal audio, activate headphone gpio
Signed-off-by: Sven-Ola Tuecke <sven-ola@gmx.de>
2026-02-19 22:10:34 -05:00

48 lines
1.3 KiB
Diff

From eebcbe5544947e1c0d7134c6f8655a5ba74cec72 Mon Sep 17 00:00:00 2001
From: Sven-Ola Tuecke <sven-ola@gmx.de>
Date: Sun, 25 Jan 2026 18:32:42 +0100
Subject: [PATCH] OrangePi-RV2: fix internal audio, activate headphone gpio
Signed-off-by: Sven-Ola Tuecke <sven-ola@gmx.de>
---
sound/soc/codecs/es8323.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)
diff --git a/sound/soc/codecs/es8323.c b/sound/soc/codecs/es8323.c
index eb85b71e8..f3ebcfd76 100644
--- a/sound/soc/codecs/es8323.c
+++ b/sound/soc/codecs/es8323.c
@@ -24,6 +24,10 @@
#include <sound/soc.h>
#include <sound/soc-dapm.h>
#include <sound/tlv.h>
+#ifdef CONFIG_SOC_SPACEMIT
+#include <linux/gpio.h>
+#include <linux/of_gpio.h>
+#endif
#include "es8323.h"
@@ -751,6 +755,18 @@ static int es8323_i2c_probe(struct i2c_client *i2c_client)
if (IS_ERR(es8323->regmap))
return PTR_ERR(es8323->regmap);
+#ifdef CONFIG_SOC_SPACEMIT
+ {
+ int gpio = of_get_named_gpio(i2c_client->dev.of_node, "earphone-sw-gpio", 0);
+ if (0 <= gpio) {
+ devm_gpio_request_one(&i2c_client->dev, gpio,
+ GPIOF_OUT_INIT_HIGH, NULL);
+ }
+ else {
+ dev_info(&i2c_client->dev, "No earphone-sw-gpio\n");
+ }
+ }
+#endif
return devm_snd_soc_register_component(dev,
&soc_component_dev_es8323,
&es8323_dai, 1);
--
2.34.1