Commit d9a2d100 authored by Tzung-Bi Shih's avatar Tzung-Bi Shih Committed by Mark Brown

ASoC: mediatek: mt8183-da7219: set headset button maps

Sets headset button maps.
Signed-off-by: default avatarTzung-Bi Shih <tzungbi@google.com>
Link: https://lore.kernel.org/r/20200511044000.86161-1-tzungbi@google.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent a1304cba
...@@ -6,11 +6,12 @@ ...@@ -6,11 +6,12 @@
// Copyright (c) 2018 MediaTek Inc. // Copyright (c) 2018 MediaTek Inc.
// Author: Shunli Wang <shunli.wang@mediatek.com> // Author: Shunli Wang <shunli.wang@mediatek.com>
#include <linux/input.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/pinctrl/consumer.h>
#include <sound/jack.h>
#include <sound/pcm_params.h> #include <sound/pcm_params.h>
#include <sound/soc.h> #include <sound/soc.h>
#include <sound/jack.h>
#include <linux/pinctrl/consumer.h>
#include "mt8183-afe-common.h" #include "mt8183-afe-common.h"
#include "../../codecs/da7219-aad.h" #include "../../codecs/da7219-aad.h"
...@@ -471,9 +472,18 @@ mt8183_da7219_max98357_headset_init(struct snd_soc_component *component) ...@@ -471,9 +472,18 @@ mt8183_da7219_max98357_headset_init(struct snd_soc_component *component)
if (ret) if (ret)
return 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); da7219_aad_jack_det(component, &priv->headset_jack);
return ret; return 0;
} }
static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev) static int mt8183_da7219_max98357_dev_probe(struct platform_device *pdev)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment