summaryrefslogtreecommitdiffstats
path: root/sound/soc/rockchip/rk3399_gru_sound.c
diff options
context:
space:
mode:
authorCheng-Yi Chiang <cychiang@chromium.org>2016-09-16 01:10:06 +0200
committerMark Brown <broonie@kernel.org>2016-09-16 12:53:16 +0200
commit22b93eaf55edfd2f1fe9d1fc0d7338f582f12745 (patch)
treee13a351945ca4d2d4447b06b8ab5a2ce19af4215 /sound/soc/rockchip/rk3399_gru_sound.c
parentASoC: rockchip: spdif: restore register during runtime_suspend/resume cycle (diff)
downloadlinux-22b93eaf55edfd2f1fe9d1fc0d7338f582f12745.tar.xz
linux-22b93eaf55edfd2f1fe9d1fc0d7338f582f12745.zip
ASoC: rockchip: Support headset button function on rk3399
Set the mapping between button and media key event. Signed-off-by: Cheng-Yi Chiang <cychiang@chromium.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/rockchip/rk3399_gru_sound.c')
-rw-r--r--sound/soc/rockchip/rk3399_gru_sound.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/sound/soc/rockchip/rk3399_gru_sound.c b/sound/soc/rockchip/rk3399_gru_sound.c
index 164b6da4f2cf..ee0648927afc 100644
--- a/sound/soc/rockchip/rk3399_gru_sound.c
+++ b/sound/soc/rockchip/rk3399_gru_sound.c
@@ -23,6 +23,7 @@
#include <linux/of_gpio.h>
#include <linux/delay.h>
#include <linux/spi/spi.h>
+#include <linux/input.h>
#include <sound/core.h>
#include <sound/jack.h>
#include <sound/pcm.h>
@@ -209,6 +210,14 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd)
return ret;
}
+ snd_jack_set_key(rockchip_sound_jack.jack, SND_JACK_BTN_0, KEY_MEDIA);
+ snd_jack_set_key(
+ rockchip_sound_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
+ snd_jack_set_key(
+ rockchip_sound_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
+ snd_jack_set_key(
+ rockchip_sound_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
+
da7219_aad_jack_det(codec, &rockchip_sound_jack);
return 0;