ASoC: pcm: Require both CODEC and CPU support when declaring stream caps
Subsystems (3)
PATCH 1/1 ASoC: pcm: Require both CODEC and CPU support when declaring stream caps
When declaring playback and capture capabilities check for both CODEC side and CPU side support rather than only checking for CODEC side support. While it is unusual some CPUs do have unidirectional DAIs.
--- sound/soc/soc-pcm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
sound/soc/soc-pcm.c +4 -2
@@ -2011,9 +2011,11 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num)if (cpu_dai->driver->capture.channels_min) capture =1 ; }else { -if (codec_dai->driver->playback.channels_min) +if (codec_dai->driver->playback.channels_min && + cpu_dai->driver->playback.channels_min) playback =1 ; -if (codec_dai->driver->capture.channels_min) +if (codec_dai->driver->capture.channels_min && + cpu_dai->driver->capture.channels_min) capture =1 ; }
Signature · 1 line
1.7.10.4
Fabio Estevam
reviewerHi Mark,
Quoted 5 lines · Mark Brown
When declaring playback and capture capabilities check for both CODEC side and CPU side support rather than only checking for CODEC side support. While it is unusual some CPUs do have unidirectional DAIs.
Signed-off-by Mark Brown <[email protected]>
Thanks for the patch, but I still got the same output:
$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: mxssgtl5000 [mxs_sgtl5000], device 0: HiFi Playback sgtl5000-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 0: mxssgtl5000 [mxs_sgtl5000], device 1: HiFi Capture sgtl5000-1 [] Subdevices: 1/1 Subdevice #0: subdevice #0
I also tried:
sound/soc/mxs/mxs-saif.c +11 -12
@@ -601,24 +601,21 @@ static const struct snd_soc_dai_ops mxs_saif_dai_ops = { .set_fmt = mxs_saif_set_dai_fmt, }; -static int mxs_saif_dai_probe (struct snd_soc_dai *dai) +static struct snd_soc_dai_driver mxs_saif_dai[] = { { -struct mxs_saif *saif =dev_get_drvdata (dai->dev); - -snd_soc_dai_set_drvdata (dai, saif); - -return 0 ; -} - -static struct snd_soc_dai_driver mxs_saif_dai = { - .name ="mxs-saif" , - .probe = mxs_saif_dai_probe, + .name ="saif0" , + .id =0 , .playback = { .channels_min =2 , .channels_max =2 , .rates =MXS_SAIF_RATES , .formats =MXS_SAIF_FORMATS , }, + .ops = &mxs_saif_dai_ops, +}, +{ + .name ="saif1" , + .id =1 , .capture = { .channels_min =2 , .channels_max =2 ,
@@ -626,6 +623,7 @@ static struct snd_soc_dai_driver mxs_saif_dai = { .formats = MXS_SAIF_FORMATS, }, .ops = &mxs_saif_dai_ops, +}, };static irqreturn_t mxs_saif_irq (int irq,void *dev_id)
@@ -772,7 +770,8 @@ static int mxs_saif_probe(struct platform_device *pdev)platform_set_drvdata (pdev, saif); - ret =snd_soc_register_dai (&pdev->dev, &mxs_saif_dai); + ret =snd_soc_register_dais (&pdev->dev, mxs_saif_dai, +ARRAY_SIZE (mxs_saif_dai));if (ret) {dev_err (&pdev->dev,"register DAI failed\n" );return ret;
Signature · 9 lines
1.8.1.2 ,but this did not work either. I will have to debug more. Thanks, Fabio Estevam
Hi Mark,
Quoted 5 lines · Mark Brown
When declaring playback and capture capabilities check for both CODEC side and CPU side support rather than only checking for CODEC side support. While it is unusual some CPUs do have unidirectional DAIs.
Signed-off-by Mark Brown <[email protected]>
Now I got it working and your patch does fix the "aplay -l/arecord -l" issue that I reported earlier:
I also need to patch sound/soc/mxs/mxs-saif.c and will send a separate patch for this.
Thanks a lot, really appreaciated!
Fabio Estevam
Mark Brown
maintainerQuoted 2 lines · Fabio Estevam
Now I got it working and your patch does fix the "aplay -l/arecord -l" issue that I reported earlier:
Ah, excellent - thanks for testing!
Quoted 6 lines · Mark Brown
When declaring playback and capture capabilities check for both CODEC side and CPU side support rather than only checking for CODEC side support. While it is unusual some CPUs do have unidirectional DAIs.
Signed-off-by Mark Brown <[email protected]>---