Hi Pierre-Louis
Thank you for your feedback
The code looks fine, but what are we trying to achieve? I thought the idea was to have a single field at the dailink, and with the example above we would still have two - just like today. This looks like a lot of code churn in many drivers for limited benefits. Or I am missing something?
Yeah. Main purpose of this patch-set is cleanup soc-pcm code which is very complex today.
After sending mail, I noticed that xxx_only flag can be merged into new xxx_assertion flag. For example "playback_only" means it must playback available.
One note here is that xxx_assertion flag is not mandatory
dpcm_playback -> playabck_assertion = 1
dpcm_capture -> capture_assertion = 1
playback_only -> playback_assertion = 1 capture_assertion = 0
capture_only -> playback_assertion = 0 capture_assertion = 1
/* * Assertion check * * xxx_assertion flag is not mandatory */ if (dai_link->playback_assertion) { if (!has_playback) { dev_err(rtd->dev, ...); return -EINVAL; } /* makes it plyaback only */ if (!dai_link->capture_assertion) has_capture = 0; } if (dai_link->capture_assertion) { if (!has_capture) { dev_err(rtd->dev, ...); return -EINVAL; } /* makes it capture only */ if (!dai_link->playback_assertion) has_playback = 0; }
/* * Detect Mismatch */ if (!has_playback && !has_capture) { dev_err(rtd->dev, ...); return -EINVAL; }
Thank you for your help !!
Best regards --- Renesas Electronics Ph.D. Kuninori Morimoto