• Hans de Goede's avatar
    ASoC: Intel: bytcht_es8316: Add external speaker mux support · 0d3e91da
    Hans de Goede authored
    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: default avatarHans de Goede <hdegoede@redhat.com>
    Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    0d3e91da
bytcht_es8316.c 14.9 KB