Skip to contentSkip to conversation

ASoC: Intel: Headset button support in kabylake machine driver

PATCH In review Harsha Priya 3 participants 3 messages Aug 21, 2017 – Aug 22, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: Intel: Headset button support in kabylake machine driver

This patch adds headset button support for kabylake machine driver (kbl_rt5663_rt5514_max98927).

---
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 8 ++++++++
 1 file changed, 8 insertions(+)
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +8 -0
index 441a397..b350aa7 100644
@@ -18,6 +18,7 @@
  * GNU General Public License for more details.
  */
 
+#include <linux/input.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <sound/core.h>
@@ -174,6 +175,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
 	int ret;
 	struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card);
 	struct snd_soc_codec *codec = rtd->codec;
+	struct snd_soc_jack *jack;
 
 	/*
 	 * Headset buttons map to the google Reference headset.
@@ -188,6 +190,12 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
 		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);
 
 	ret = snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "DMIC");
Signature · 1 line
1.9.1
Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Harsha Priya

This patch adds headset button support for kabylake machine driver (kbl_rt5663_rt5514_max98927).

Signature · 1 line
~Vinod
maintainer
#2 lore raw

Applied "ASoC: Intel: Headset button support in kabylake machine driver" to the asoc tree

In reply to Harsha Priya

The patch

ASoC: Intel: Headset button support in kabylake machine driver

has been applied to the asoc tree at

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git

All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying to this mail.

Thanks,
Mark

Quoted 1 line

From 80b649039240ec41a6ab0a5e347853bc78abfd2d Mon Sep 17 00:00:00 2001

From: Harsha Priya N <[email protected]>
Date: Mon, 21 Aug 2017 12:26:52 -0700
Subject: [PATCH] ASoC: Intel: Headset button support in kabylake machine
driver

This patch adds headset button support for kabylake machine driver (kbl_rt5663_rt5514_max98927).

---
 sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 8 ++++++++
 1 file changed, 8 insertions(+)
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +8 -0
index b51dff6fe25b..69681b04d7fc 100644
@@ -18,6 +18,7 @@
  * GNU General Public License for more details.
  */
 
+#include <linux/input.h>
 #include <linux/module.h>
 #include <linux/platform_device.h>
 #include <sound/core.h>
@@ -176,6 +177,7 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
 	int ret;
 	struct kbl_codec_private *ctx = snd_soc_card_get_drvdata(rtd->card);
 	struct snd_soc_codec *codec = rtd->codec;
+	struct snd_soc_jack *jack;
 
 	/*
 	 * Headset buttons map to the google Reference headset.
@@ -190,6 +192,12 @@ static int kabylake_rt5663_codec_init(struct snd_soc_pcm_runtime *rtd)
 		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);
 
 	ret = snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "DMIC");
Signature · 1 line
2.13.2