• Manuel Lauss's avatar
    ASoC: au1x: PSC-AC97 bugfixes · cdc65fbe
    Manuel Lauss authored
    This patch fixes the following bugs:
    
    - only reprogram bitdepth if it has changed since last call to hw_params.
    - add locking inside ac97_read/write functions:
      When reprogramming sample depth, the ac97 unit has to be disabled,
      which should not be done in the middle of codec register accesses.
    
    - retry timed-out codec register accesses.
    
    - wait for status bits to set/clear when starting/stopping various
      functional blocks; very important after reenabling AC97 unit else
      sound may be distorted (e.g. high-pitch noise in 1kHz sine wave).
    
    - clear fifos before/after starting/stopping RX/TX.
    
    - longer timeouts waiting for PSC/AC97 ready after cold reset
      with certain codecs this can take ridiculous amounts of time.
    
    Run-tested on various Au1200 platforms with various codecs.
    Signed-off-by: default avatarManuel Lauss <manuel.lauss@gmail.com>
    Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
    cdc65fbe
psc-ac97.c 11 KB