diff options
author | Hans de Goede <hdegoede@redhat.com> | 2019-01-03 16:45:26 +0300 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2019-01-04 18:09:48 +0300 |
commit | 822257661031faa437336058d8a32bf1844ad9c6 (patch) | |
tree | 355e47b95658608421764102308705606f5f502c /sound/soc/codecs/es8316.h | |
parent | e1de3d237b5083fcd0da6fcf600848a4cef9cc67 (diff) | |
download | linux-822257661031faa437336058d8a32bf1844ad9c6.tar.xz |
ASoC: es8316: Add jack-detect support
Adding jack-detect support may seem weird for a codec with only
a single output, but it is necessary. The ES8316 appnote showing
the intended usage uses a jack-receptacle which physically disconnects
the speakers from the output when a jack is plugged in.
But all 3 devices using the es8316 which I have (2 Cherry Trail
devices and one Bay Trail CR device), use an analog mux to disconnect
the speakers, driven by a GPIO. In order to enable/disable the speakers
at the right time, we need jack-detect.
The same goes for the microphone where we must correctly set the mux
for the single ADC to either the internal or the headset microphone.
All devices I have support the es8316's builtin jack-detect functionality.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/codecs/es8316.h')
-rw-r--r-- | sound/soc/codecs/es8316.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sound/soc/codecs/es8316.h b/sound/soc/codecs/es8316.h index 6bcdd63ea459..439a0130cbb7 100644 --- a/sound/soc/codecs/es8316.h +++ b/sound/soc/codecs/es8316.h @@ -126,4 +126,11 @@ #define ES8316_SERDATA2_LEN_16 0x0c #define ES8316_SERDATA2_LEN_32 0x10 +/* ES8316_GPIO_DEBOUNCE */ +#define ES8316_GPIO_ENABLE_INTERRUPT 0x02 + +/* ES8316_GPIO_FLAG */ +#define ES8316_GPIO_FLAG_GM_NOT_SHORTED 0x02 +#define ES8316_GPIO_FLAG_HP_NOT_INSERTED 0x04 + #endif |