armbian_build/patch/kernel/archive/sunxi-6.14/patches.megous/ASoC-sun8i-codec-define-button-keycodes.patch
2025-05-14 17:19:40 +02:00

32 lines
983 B
Diff

From 14100a8e3e83aeb304a3f136eb5aad44b7026feb Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Fri, 23 Feb 2024 01:58:40 +0100
Subject: ASoC: sun8i-codec: define button keycodes
This is likely not upstreamable, but simple. :)
---
sound/soc/sunxi/sun8i-codec.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/sound/soc/sunxi/sun8i-codec.c b/sound/soc/sunxi/sun8i-codec.c
index 838880cf5bd4..c5948b650777 100644
--- a/sound/soc/sunxi/sun8i-codec.c
+++ b/sound/soc/sunxi/sun8i-codec.c
@@ -1541,6 +1541,13 @@ static int sun8i_codec_enable_jack_detect(struct snd_soc_component *component,
if (ret)
return ret;
+ if (jack->jack->type & SND_JACK_MICROPHONE) {
+ snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
+ snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
+ snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
+ snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
+ }
+
return 0;
}
--
2.35.3