armbian_build/patch/kernel/archive/sunxi-6.13/patches.megous/ASoC-sun8i-codec-define-button-keycodes.patch
2025-03-21 10:24:35 +01:00

32 lines
983 B
Diff

From 6e28a1f40c8dc559c2b14f97c6584adb1a5b2191 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