Commit 80b64903 authored by Harsha Priya N's avatar Harsha Priya N Committed by Mark Brown

ASoC: Intel: Headset button support in kabylake machine driver

This patch adds headset button support for kabylake machine driver
(kbl_rt5663_rt5514_max98927).
Signed-off-by: default avatarHsin-yu Chao <hychao@google.com>
Signed-off-by: default avatarHarsha Priya <harshapriya.n@intel.com>
Acked-By: default avatarVinod Koul <vinod.koul@intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent d46b1828
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
* GNU General Public License for more details. * GNU General Public License for more details.
*/ */
#include <linux/input.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/platform_device.h> #include <linux/platform_device.h>
#include <sound/core.h> #include <sound/core.h>
...@@ -176,6 +177,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -176,6 +177,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
int ret; int ret;
struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card); struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card);
struct snd_soc_codec *codec = rtd->codec; struct snd_soc_codec *codec = rtd->codec;
struct snd_soc_jack *jack;
/* /*
* Headset buttons map to the google Reference headset. * Headset buttons map to the google Reference headset.
...@@ -190,6 +192,12 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd) ...@@ -190,6 +192,12 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
return ret; return ret;
} }
jack = &ctx->kabylake_headset;
snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_MEDIA);
snd_jack_set_key(jack->jack, SND_JACK_BTN_1, KEY_VOICECOMMAND);
snd_jack_set_key(jack->jack, SND_JACK_BTN_2, KEY_VOLUMEUP);
snd_jack_set_key(jack->jack, SND_JACK_BTN_3, KEY_VOLUMEDOWN);
rt5663_set_jack_detect(codec, &ctx->kabylake_headset); rt5663_set_jack_detect(codec, &ctx->kabylake_headset);
ret = snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "DMIC"); ret = snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "DMIC");
......
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