ASoC: Intel: bytcht_es8316: Add external speaker mux support
authorHans de Goede <hdegoede@redhat.com>
Thu, 3 Jan 2019 13:45:32 +0000 (14:45 +0100)
committerMark Brown <broonie@kernel.org>
Fri, 4 Jan 2019 15:15:32 +0000 (15:15 +0000)
commit0d3e91da0750835cfd5c16487ffb3cdd752ea53a
treef0352c556614abb8c11d663bef5d061d2cf8b3ca
parent4bf538b42933253296daf86aab7ede56b5fb97bf
ASoC: Intel: bytcht_es8316: Add external speaker mux support

The ES8316 only has a single (amplified) output. 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.

This commit adds support for this, modelling this as a separate speaker
widget / dapm pin-switch which sets the mux to drive the speakers when
selected.

The intend is for userspace to use the recently added jack-detect support
and then automatically select either the Headphone or Speaker output based
on that.

Note this commit includes a workaround for an ACPI table bug which is
present on 2 of the 3 devices I have, see the added comment in the code.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/boards/bytcht_es8316.c