]> Git Repo - linux.git/commitdiff
ASoC: AMD: Support headset button on Stoney DA7219
authorAgrawal, Akshu <[email protected]>
Thu, 12 Apr 2018 09:57:11 +0000 (17:57 +0800)
committerMark Brown <[email protected]>
Mon, 16 Apr 2018 10:53:53 +0000 (11:53 +0100)
Adds headset button support.

TEST=Tested Volume UP/Down, Play/Pause functionality

Signed-off-by: Akshu Agrawal <[email protected]>
Reviewed-by: Daniel Kurtz <[email protected]>
Signed-off-by: Mark Brown <[email protected]>
sound/soc/amd/acp-da7219-max98357a.c

index b205c782e494133d05fd27cb76509e7e690d5f85..d281c227d64ced530e02d6a9d32f60f5d0092e50 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/gpio.h>
 #include <linux/module.h>
 #include <linux/i2c.h>
+#include <linux/input.h>
 #include <linux/acpi.h>
 
 #include "../codecs/da7219.h"
@@ -80,6 +81,11 @@ static int cz_da7219_init(struct snd_soc_pcm_runtime *rtd)
                return ret;
        }
 
+       snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_0, KEY_PLAYPAUSE);
+       snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_1, KEY_VOLUMEUP);
+       snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_2, KEY_VOLUMEDOWN);
+       snd_jack_set_key(cz_jack.jack, SND_JACK_BTN_3, KEY_VOICECOMMAND);
+
        da7219_aad_jack_det(component, &cz_jack);
 
        return 0;
This page took 0.058263 seconds and 4 git commands to generate.