• Damien Riegel's avatar
    ASoC: codecs: msm8916-wcd-analog: use btn0 released detection · d430a7e3
    Damien Riegel authored
    msm8916-wcd-analog uses button0 to differentiate between headphone and
    headset. Under some circumstances, button pressed and released
    interrupts are not fired as the driver expects it.
    
    For instance, with some connectors, there are spurious button-pressed
    interrupts when unplugging a headphone, without the corresponding
    button-released interrupt. But the codec always alternates between
    button pressed and released interrupts, it cannot fire two interrupts of
    the same kind in a row. That means that when the headphone is plugged
    back, only a button-released interrupt will be fired instead of pressed
    then released. This causes the driver to report headphone as headset.
    
    By changing the logic and relying on button 0 release interrupt, the
    driver could be made more robust for connectors that differ from the one
    used on the Dragonboard's audio mezzanine.
    Signed-off-by: default avatarDamien Riegel <damien.riegel@savoirfairelinux.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    d430a7e3
msm8916-wcd-analog.c 39.2 KB