ASoC: spear: Update the SPDIF drivers for current ASoC APIs

bui duc phuc <phucduc.bui@gmail.com> says:

While cleaning up the SPEAr SPDIF driver probe path by removing
redundant error messages, build testing revealed several compilation
failures caused by outdated ASoC APIs.

The series first removes the redundant error messages, then updates the
driver to match the current ASoC APIs by replacing the removed
capture_dma_data field usage with the corresponding helper API, and
moving the DAI probe callback to struct snd_soc_dai_ops.

Link: https://patch.msgid.link/20260730095407.33894-1-phucduc.bui@gmail.com
This commit is contained in:
Mark Brown
2026-08-01 02:41:18 +01:00
2 changed files with 5 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ static int spdif_in_dai_probe(struct snd_soc_dai *dai)
struct spdif_in_dev *host = snd_soc_dai_get_drvdata(dai);
host->dma_params_rx.filter_data = &host->dma_params;
dai->capture_dma_data = &host->dma_params_rx;
snd_soc_dai_dma_data_set_capture(dai, &host->dma_params_rx);
return 0;
}
@@ -150,12 +150,12 @@ static int spdif_in_trigger(struct snd_pcm_substream *substream, int cmd,
static const struct snd_soc_dai_ops spdif_in_dai_ops = {
.shutdown = spdif_in_shutdown,
.probe = spdif_in_dai_probe,
.trigger = spdif_in_trigger,
.hw_params = spdif_in_hw_params,
};
static struct snd_soc_dai_driver spdif_in_dai = {
.probe = spdif_in_dai_probe,
.capture = {
.channels_min = 2,
.channels_max = 2,
@@ -218,10 +218,8 @@ static int spdif_in_probe(struct platform_device *pdev)
host->io_base = io_base;
host->irq = platform_get_irq(pdev, 0);
if (host->irq < 0) {
dev_warn(&pdev->dev, "failed to get IRQ: %d\n", host->irq);
if (host->irq < 0)
return host->irq;
}
host->clk = devm_clk_get(&pdev->dev, NULL);
if (IS_ERR(host->clk))
@@ -243,10 +241,8 @@ static int spdif_in_probe(struct platform_device *pdev)
ret = devm_request_irq(&pdev->dev, host->irq, spdif_in_irq, 0,
"spdif-in", host);
if (ret) {
dev_warn(&pdev->dev, "request_irq failed\n");
if (ret)
return ret;
}
ret = devm_snd_soc_register_component(&pdev->dev, &spdif_in_component,
&spdif_in_dai, 1);

View File

@@ -249,6 +249,7 @@ static int spdif_soc_dai_probe(struct snd_soc_dai *dai)
}
static const struct snd_soc_dai_ops spdif_out_dai_ops = {
.probe = spdif_soc_dai_probe,
.mute_stream = spdif_mute,
.startup = spdif_out_startup,
.shutdown = spdif_out_shutdown,
@@ -266,7 +267,6 @@ static struct snd_soc_dai_driver spdif_out_dai = {
SNDRV_PCM_RATE_192000),
.formats = SNDRV_PCM_FMTBIT_S16_LE,
},
.probe = spdif_soc_dai_probe,
.ops = &spdif_out_dai_ops,
};