• John Hsu's avatar
    ASoC: nau8825: fix bug in playback when suspend · ca6ac305
    John Hsu authored
    In chromium, the following steps will make codec function fail.
    \1. plug in headphones, Play music
    \2. run "powerd_dbus_suspend"
    \3. resume from S3
    After resume, the jack detection will restart and make configuration
    for the headset. Meanwhile, the playback prepares and starts to work.
    The two sequences will conflict and make wrong register configuration.
    
    Originally, the driver adds protection for the case when it finds
    the playback is active. But the "powerd_dbus_suspend" command will
    close the pcm stream before suspend. Therefore, the driver can't
    detect the playback after resume, and the protection not works.
    For the issue, the driver raises protection every time after resume.
    The protection will release after jack detection and configuration
    completes, and then the playback just will goes on.
    Signed-off-by: default avatarJohn Hsu <KCHSU0@nuvoton.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    ca6ac305
nau8825.c 79.6 KB