mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-04 18:09:57 +00:00
ASoC: check channel mismatch between cpu_dai and codec_dai
Suppose we have: cpu_dai channels_min = 1 channels_max = 1 codec_dai channels_min = 2 channels_max = 2 This is a mismatch that should not happen, however according to the current code, the result of runtime->hw will be: channels_min = 2 channels_max = 1 We better spot it early. This patch checks this mismatch. Signed-off-by: Lu Guanqun <guanqun.lu@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This commit is contained in:
parent
deb2607e6c
commit
b04cfcf70b
1 changed files with 2 additions and 1 deletions
|
@ -640,7 +640,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream)
|
|||
codec_dai->name, cpu_dai->name);
|
||||
goto config_err;
|
||||
}
|
||||
if (!runtime->hw.channels_min || !runtime->hw.channels_max) {
|
||||
if (!runtime->hw.channels_min || !runtime->hw.channels_max ||
|
||||
runtime->hw.channels_min > runtime->hw.channels_max) {
|
||||
printk(KERN_ERR "asoc: %s <-> %s No matching channels\n",
|
||||
codec_dai->name, cpu_dai->name);
|
||||
goto config_err;
|
||||
|
|
Loading…
Reference in a new issue