Skip to content

Commit 5a04c18

Browse files
committed
ASoC: atmel-classd: Fix classd soundcard init
Before this patch: :~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: CLASSD [CLASSD], device 0: CLASSD PCM snd-soc-dummy-dai-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 :~$ speaker-test -t sine speaker-test 1.2.6 Playback device is default Stream parameters are 48000Hz, S16_LE, 1 channels Sine wave rate is 440.0000Hz Playback open error: -22,Invalid argument After this patch which restores the plaform component: :~$ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: CLASSD [CLASSD], device 0: CLASSD PCM snd-soc-dummy-dai-0 [CLASSD PCM snd-soc-dummy-dai-0] Subdevices: 1/1 Subdevice #0: subdevice #0 Resolve the playback error. Fixes: 2f650f8 ("ASoC: atmel: remove unnecessary dai_link->platform") Tested-by: Durai Manickam KR <[email protected]> Signed-off-by: Andrei Simion <[email protected]>
1 parent c2ea24d commit 5a04c18

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sound/soc/atmel/atmel-classd.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -473,19 +473,22 @@ static int atmel_classd_asoc_card_init(struct device *dev,
473473
if (!dai_link)
474474
return -ENOMEM;
475475

476-
comp = devm_kzalloc(dev, sizeof(*comp), GFP_KERNEL);
476+
comp = devm_kzalloc(dev, 2 * sizeof(*comp), GFP_KERNEL);
477477
if (!comp)
478478
return -ENOMEM;
479479

480-
dai_link->cpus = comp;
480+
dai_link->cpus = &comp[0];
481481
dai_link->codecs = &asoc_dummy_dlc;
482+
dai_link->platforms = &comp[1];
482483

483484
dai_link->num_cpus = 1;
484485
dai_link->num_codecs = 1;
486+
dai_link->num_platforms = 1;
485487

486488
dai_link->name = "CLASSD";
487489
dai_link->stream_name = "CLASSD PCM";
488490
dai_link->cpus->dai_name = dev_name(dev);
491+
dai_link->platforms->name = dev_name(dev);
489492

490493
card->dai_link = dai_link;
491494
card->num_links = 1;

0 commit comments

Comments
 (0)