diff options
author | Cheng-Yi Chiang <cychiang@chromium.org> | 2016-09-15 19:10:06 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2016-09-16 06:53:16 -0400 |
commit | 22b93eaf55edfd2f1fe9d1fc0d7338f582f12745 (patch) | |
tree | e13a351945ca4d2d4447b06b8ab5a2ce19af4215 | |
parent | 3628c6987fb45d719cd963805bbba9f15017290e (diff) |
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>
-rw-r--r-- | sound/soc/rockchip/rk3399_gru_sound.c | 9 |
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 @@ | |||
23 | #include <linux/of_gpio.h> | 23 | #include <linux/of_gpio.h> |
24 | #include <linux/delay.h> | 24 | #include <linux/delay.h> |
25 | #include <linux/spi/spi.h> | 25 | #include <linux/spi/spi.h> |
26 | #include <linux/input.h> | ||
26 | #include <sound/core.h> | 27 | #include <sound/core.h> |
27 | #include <sound/jack.h> | 28 | #include <sound/jack.h> |
28 | #include <sound/pcm.h> | 29 | #include <sound/pcm.h> |
@@ -209,6 +210,14 @@ static int rockchip_sound_da7219_init(struct snd_soc_pcm_runtime *rtd) | |||
209 | return ret; | 210 | return ret; |
210 | } | 211 | } |
211 | 212 | ||
213 | snd_jack_set_key(rockchip_sound_jack.jack, SND_JACK_BTN_0, KEY_MEDIA); | ||
214 | snd_jack_set_key( | ||
215 | rockchip_sound_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP); | ||
216 | snd_jack_set_key( | ||
217 | rockchip_sound_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); | ||
218 | snd_jack_set_key( | ||
219 | rockchip_sound_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); | ||
220 | |||
212 | da7219_aad_jack_det(codec, &rockchip_sound_jack); | 221 | da7219_aad_jack_det(codec, &rockchip_sound_jack); |
213 | 222 | ||
214 | return 0; | 223 | return 0; |