Files

32 lines
984 B
Diff
Raw Permalink Normal View History

2026-08-25 10:02:36 +08:00
From 0000000000000000000000000000000000000000 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 111111111111..222222222222 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;
}
--
Armbian