All of lore.kernel.org
 help / color / mirror / Atom feed
From: Naveen Manohar <naveen.m@intel.com>
To: alsa-devel@alsa-project.org
Cc: vinod.koul@intel.com, harshapriya.n@intel.com,
	naveen.m@intel.com, broonie@kernel.org,
	pierre-louis.bossart@intel.com
Subject: [alsa-devel] [PATCH v2 2/5] ASoC: Intel: Headset button support in broxton machine driver
Date: Wed, 11 Apr 2018 15:55:00 +0530	[thread overview]
Message-ID: <1523442303-12710-3-git-send-email-naveen.m@intel.com> (raw)
In-Reply-To: <1523442303-12710-1-git-send-email-naveen.m@intel.com>

Patch adds headset button support for broxton machine driver
(bxt_da7219_max98357a).

Signed-off-by: Naveen Manohar <naveen.m@intel.com>
---
 sound/soc/intel/boards/bxt_da7219_max98357a.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/sound/soc/intel/boards/bxt_da7219_max98357a.c b/sound/soc/intel/boards/bxt_da7219_max98357a.c
index ce021a3..2eff1f0 100644
--- a/sound/soc/intel/boards/bxt_da7219_max98357a.c
+++ b/sound/soc/intel/boards/bxt_da7219_max98357a.c
@@ -16,6 +16,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>
@@ -168,6 +169,7 @@ static int broxton_ssp_fixup(struct snd_soc_pcm_runtime *rtd,
 static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
 {
 	int ret;
+	struct snd_soc_jack *jack;
 	struct snd_soc_dai *codec_dai = rtd->codec_dai;
 	struct snd_soc_component *component = rtd->codec_dai->component;
 
@@ -192,7 +194,12 @@ static int broxton_da7219_codec_init(struct snd_soc_pcm_runtime *rtd)
 		return ret;
 	}
 
-	da7219_aad_jack_det(component, &broxton_headset);
+	jack = &broxton_headset;
+	snd_jack_set_key(jack->jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
+	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);
+	da7219_aad_jack_det(component, jack);
 
 	snd_soc_dapm_ignore_suspend(&rtd->card->dapm, "SoC DMIC");
 
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2018-04-11 10:25 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 10:24 [alsa-devel] [PATCH v2 0/5] ASoC: Intel: geminilake: Adds da7219+max98537 machine driver support Naveen Manohar
2018-04-11 10:24 ` [alsa-devel] [PATCH v2 1/5] ASoC: Intel: broxton: reduce machine name for bxt_da7219_max98357a Naveen Manohar
2018-04-11 10:25 ` Naveen Manohar [this message]
2018-04-11 10:25 ` [alsa-devel] [PATCH v2 3/5] ASoC: Intel: Add Geminilake Dialog Maxim machine driver support Naveen Manohar
2018-04-11 16:20   ` Pierre-Louis Bossart
2018-04-11 16:34     ` Mark Brown
2018-04-11 17:06       ` Pierre-Louis Bossart
2018-04-11 17:33         ` Naveen M
2018-04-11 10:25 ` [alsa-devel] [PATCH v2 4/5] ASoC: Intel: glk: Add DAI links for Multi-Playback Naveen Manohar
2018-04-11 10:25 ` [alsa-devel] [PATCH v2 5/5] ASoC: Intel: Add Geminilake Dialog+Maxim machine driver entry Naveen Manohar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1523442303-12710-3-git-send-email-naveen.m@intel.com \
    --to=naveen.m@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=harshapriya.n@intel.com \
    --cc=pierre-louis.bossart@intel.com \
    --cc=vinod.koul@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.