summaryrefslogtreecommitdiffstats
path: root/sound/soc/intel/boards
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-08-21 13:43:37 +0200
committerMark Brown <broonie@kernel.org>2018-08-28 20:38:10 +0100
commitf8fc397e13107f925186ee742e9e8dfbfe9a3d03 (patch)
tree78e6b55c956dc064af49754693190f7c54a14e95 /sound/soc/intel/boards
parent2ca426a24dd75e775ece1466ae45e019f0035b8d (diff)
downloadtalos-obmc-linux-f8fc397e13107f925186ee742e9e8dfbfe9a3d03.tar.gz
talos-obmc-linux-f8fc397e13107f925186ee742e9e8dfbfe9a3d03.zip
ASoC: Intel: cht-bsw-rt5672: Add key-mappings for the headset buttons
Having the headset buttons send BTN_0, BTN_1 and BTN_2 events is not really useful. Add mappings to PLAYPAUSE VOLUME_UP and VOLUME_DOWN like we do in other Intel machine drivers. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel/boards')
-rw-r--r--sound/soc/intel/boards/cht_bsw_rt5672.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/cht_bsw_rt5672.c b/sound/soc/intel/boards/cht_bsw_rt5672.c
index e5aa13058dd7..e054318185ea 100644
--- a/sound/soc/intel/boards/cht_bsw_rt5672.c
+++ b/sound/soc/intel/boards/cht_bsw_rt5672.c
@@ -16,6 +16,7 @@
* General Public License for more details.
*/
+#include <linux/input.h>
#include <linux/module.h>
#include <linux/platform_device.h>
#include <linux/slab.h>
@@ -212,6 +213,10 @@ static int cht_codec_init(struct snd_soc_pcm_runtime *runtime)
if (ret)
return ret;
+ snd_jack_set_key(ctx->headset.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
+ snd_jack_set_key(ctx->headset.jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
+ snd_jack_set_key(ctx->headset.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
+
rt5670_set_jack_detect(component, &ctx->headset);
if (ctx->mclk) {
/*
OpenPOWER on IntegriCloud