• Rander Wang's avatar
    ASoC:hdac_hda:use correct format to setup hda codec · 03d0aa4d
    Rander Wang authored
    The current implementation of the hdac_hda codec results in zero-valued
    samples on capture and noise with headset playback when SOF is used on
    platforms with an on-board HDaudio codec. This is root-caused to SOF
    using be_hw_params_fixup, and the prepare() call using invalid runtime
    fields to determine the format.
    
    This patch moves the format handling to the hw_params() callback, as
    done already for hdac_hdmi, to make sure the fixed-up information is
    taken into account but keeps the codec initialization in prepare() as
    the stream_tag is only available at that time. Moving everything in the
    prepare() callback is possible but the code is less elegant so this
    two-step solution was chosen.
    
    The solution was tested with the SST driver with no regressions, and all
    the issues with SOF playback and capture are solved.
    Signed-off-by: default avatarRander Wang <rander.wang@linux.intel.com>
    Acked-by: default avatarPierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    03d0aa4d
hdac_hda.c 13.4 KB