From f7efa30eb10d2d70de8b13110f99717ad8b1909a Mon Sep 17 00:00:00 2001
From: Ondrej Jirman <megi@xff.cz>
Date: Fri, 23 Feb 2024 01:58:40 +0100
Subject: [PATCH 192/463] 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 09fc25f67a156..67e304cb4238f 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.46.0

