diff options
author | Vaibhav Agarwal <vaibhav.agarwal@linaro.org> | 2016-03-29 14:02:36 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@google.com> | 2016-03-31 20:19:57 +0300 |
commit | 64a7e2cceb75ccabaec713944a95511605751b29 (patch) | |
tree | 1c745b4cb31d73c8acb1c3ac2eda3b087195142f /drivers/staging/greybus/audio_codec.h | |
parent | 6da549ec851117293a07e64f97170f7dc9d55578 (diff) | |
download | linux-64a7e2cceb75ccabaec713944a95511605751b29.tar.xz |
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 <vaibhav.agarwal@linaro.org>
Reviewed-by: Mark Greer <mgreer@animalcreek.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Diffstat (limited to 'drivers/staging/greybus/audio_codec.h')
-rw-r--r-- | drivers/staging/greybus/audio_codec.h | 15 |
1 files changed, 15 insertions, 0 deletions
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 <sound/soc.h> +#include <sound/jack.h> #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; |