From 64a7e2cceb75ccabaec713944a95511605751b29 Mon Sep 17 00:00:00 2001 From: Vaibhav Agarwal Date: Tue, 29 Mar 2016 16:32:36 +0530 Subject: greybus: audio: Added jack support to audio module Register jack with ASoC sound card in case audio module populates it via codec FW. Currently, only a single jack with 4 buttons can be registered for each module. Signed-off-by: Vaibhav Agarwal Reviewed-by: Mark Greer Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/audio_codec.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'drivers/staging/greybus/audio_codec.h') diff --git a/drivers/staging/greybus/audio_codec.h b/drivers/staging/greybus/audio_codec.h index a2697dd62949..165b3595dae9 100644 --- a/drivers/staging/greybus/audio_codec.h +++ b/drivers/staging/greybus/audio_codec.h @@ -10,6 +10,7 @@ #define __LINUX_GBAUDIO_CODEC_H #include +#include #include "greybus.h" #include "greybus_protocols.h" @@ -57,6 +58,11 @@ enum gbcodec_reg_index { #define GBCODEC_APB1_MUX_REG_DEFAULT 0x00 #define GBCODEC_APB2_MUX_REG_DEFAULT 0x00 +#define GBCODEC_JACK_MASK (SND_JACK_HEADSET | SND_JACK_LINEOUT | \ + SND_JACK_LINEIN | SND_JACK_UNSUPPORTED) +#define GBCODEC_JACK_BUTTON_MASK (SND_JACK_BTN_0 | SND_JACK_BTN_1 | \ + SND_JACK_BTN_2 | SND_JACK_BTN_3) + static const u8 gbcodec_reg_defaults[GBCODEC_REG_COUNT] = { GBCODEC_CTL_REG_DEFAULT, GBCODEC_MUTE_REG_DEFAULT, @@ -139,6 +145,15 @@ struct gbaudio_module_info { int manager_id; char name[NAME_SIZE]; + /* jack related */ + char jack_name[NAME_SIZE]; + char button_name[NAME_SIZE]; + int num_jacks; + int jack_type; + int button_status; + struct snd_soc_jack headset_jack; + struct snd_soc_jack button_jack; + /* used by codec_ops */ struct mutex lock; int is_connected; -- cgit v1.2.3