Skip to content

Commit bae071a

Browse files
yn386broonie
authored andcommitted
ASoC: ti: omap-hdmi: Re-add dai_link->platform to fix card init
The removed dai_link->platform component cause a fail which is exposed at runtime. (ex: when a sound tool is used) This patch re-adds the dai_link->platform component to have a full card registered. Before this patch: $ aplay -l **** List of PLAYBACK Hardware Devices **** card 1: HDMI [HDMI], device 0: HDMI snd-soc-dummy-dai-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 $ speaker-test -D plughw:1,0 -t sine speaker-test 1.2.8 Playback device is plughw:1,0 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 platform component: $ aplay -l **** List of PLAYBACK Hardware Devices **** card 0: HDMI [HDMI], device 0: HDMI snd-soc-dummy-dai-0 [HDMI snd-soc-dummy-dai-0] Subdevices: 0/1 Subdevice #0: subdevice #0 -> Resolve the playback error. Fixes: 3b0db24 ("ASoC: ti: remove unnecessary dai_link->platform") Signed-off-by: Yuuki NAGAO <wf.yn386@gmail.com> Link: https://patch.msgid.link/20250531141341.81164-1-wf.yn386@gmail.com Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 59a4d9a commit bae071a

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

sound/soc/ti/omap-hdmi.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -361,17 +361,20 @@ static int omap_hdmi_audio_probe(struct platform_device *pdev)
361361
if (!card->dai_link)
362362
return -ENOMEM;
363363

364-
compnent = devm_kzalloc(dev, sizeof(*compnent), GFP_KERNEL);
364+
compnent = devm_kzalloc(dev, 2 * sizeof(*compnent), GFP_KERNEL);
365365
if (!compnent)
366366
return -ENOMEM;
367-
card->dai_link->cpus = compnent;
367+
card->dai_link->cpus = &compnent[0];
368368
card->dai_link->num_cpus = 1;
369369
card->dai_link->codecs = &snd_soc_dummy_dlc;
370370
card->dai_link->num_codecs = 1;
371+
card->dai_link->platforms = &compnent[1];
372+
card->dai_link->num_platforms = 1;
371373

372374
card->dai_link->name = card->name;
373375
card->dai_link->stream_name = card->name;
374376
card->dai_link->cpus->dai_name = dev_name(ad->dssdev);
377+
card->dai_link->platforms->name = dev_name(ad->dssdev);
375378
card->num_links = 1;
376379
card->dev = dev;
377380

0 commit comments

Comments
 (0)