diff options
author | Tzung-Bi Shih <tzungbi@google.com> | 2020-05-11 06:40:00 +0200 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2020-05-11 13:24:58 +0200 |
commit | d9a2d100c96d3ae6253926e3f11c55242907a30c (patch) | |
tree | 5871783799d6b1c6999f7b4767497b90b271a6e9 | |
parent | ASoC: cros_ec_codec: allocate shash_desc dynamically (diff) | |
download | linux-d9a2d100c96d3ae6253926e3f11c55242907a30c.tar.xz linux-d9a2d100c96d3ae6253926e3f11c55242907a30c.zip |
ASoC: mediatek: mt8183-da7219: set headset button maps
Sets headset button maps.
Signed-off-by: Tzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200511044000.86161-1-tzungbi@google.com
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c index 5b3dfa79b4ae..ffd7c931e7bb 100644 --- a/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c +++ b/sound/soc/mediatek/mt8183/mt8183-da7219-max98357.c @@ -6,11 +6,12 @@ // Copyright (c) 2018 MediaTek Inc. // Author: Shunli Wang <shunli.wang@mediatek.com> +#include <linux/input.h> #include <linux/module.h> +#include <linux/pinctrl/consumer.h> +#include <sound/jack.h> #include <sound/pcm_params.h> #include <sound/soc.h> -#include <sound/jack.h> -#include <linux/pinctrl/consumer.h> #include "mt8183-afe-common.h" #include "../../codecs/da7219-aad.h" @@ -471,9 +472,18 @@ mt8183_da7219_max98357_headset_init(struct snd_soc_component *component) if (ret) return ret; + snd_jack_set_key( + priv->headset_jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE); + snd_jack_set_key( + priv->headset_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP); + snd_jack_set_key( + priv->headset_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN); + snd_jack_set_key( + priv->headset_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND); + da7219_aad_jack_det(component, &priv->headset_jack); - return ret; + return 0; } static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) |