• Ben Zhang's avatar
    ASoC: rt5677: Disable irq at suspend · ee0be4a9
    Ben Zhang authored
    The irq is disabled at suspend to avoid running the threaded irq
    handler after the codec has been powered off. At resume, codec irq is
    re-enabled and the interrupt status register is checked to see if
    headphone has been pluggnd/unplugged while the device is suspended.
    
    There is still a chance that the headphone gets enabled or disabled
    after the codec is suspended. disable_irq syncs the threaded irq
    handler, but soc-jack's threaded irq handler schedules a delayed
    work to poll gpios (for debounce). This is still OK. The codec won't
    be powered back on again because all audio paths have been suspended,
    and there are no force enabled supply widgets (MICBIAS1 is disabled).
    The gpio status read after codec power off could be wrong, so the
    gpio values are checked again after resume.
    Signed-off-by: default avatarBen Zhang <benzh@chromium.org>
    Signed-off-by: default avatarCurtis Malainey <cujomalainey@chromium.org>
    Link: https://lore.kernel.org/r/20191106011335.223061-8-cujomalainey@chromium.orgSigned-off-by: default avatarMark Brown <broonie@kernel.org>
    ee0be4a9
rt5677.h 64.6 KB