• Koro Chen's avatar
    ASoC: dpcm: Add checks of playback/capture before dpcm_get_be · c5b8540d
    Koro Chen authored
    In dpcm_get_be(), it looks for a BE rtd that has the DAI widget
    according to current stream type. Only playback_widgets are searched
    in the case of playback stream and vice versa. However, the DAI widget
    itself can be playback or capture.
    
    If the DAI widget is capture, but current stream type is playback,
    dpcm_get_be() will always fail to find a rtd, print error messages,
    and continue to the next DAI widget in list. We can just skip this
    DAI widget to further suppress error messages. This happens in a
    special case when 2 codecs are inter-connected, and the 1st codec's
    "capture" widget is used to send data to the 2nd codec during "playback":
    
    mtk-rt5650-rt5676 sound: ASoC: can't get playback BE for Sub AIF2 Capture
    rt5650_rt5676 Playback: ASoC: no BE found for Sub AIF2 Capture
    
    Add checks to continue to next DAI widget if current DAI widget's
    direction does not match the stream type.
    Signed-off-by: default avatarKoro Chen <koro.chen@mediatek.com>
    Signed-off-by: default avatarMark Brown <broonie@kernel.org>
    c5b8540d
soc-pcm.c 79 KB