[PATCH 3/3] ASoC: fsl_sai: add error message in case of missing imx-pcm-dma support

Shengjiu Wang shengjiu.wang at gmail.com
Mon Jun 6 13:20:16 AEST 2022


On Wed, Jun 1, 2022 at 5:23 PM Marco Felsch <m.felsch at pengutronix.de> wrote:

> If the imx-pcm-dma is required we need to have the module enabled. For
> all NXP/FSL sound cards using the ASoC architecture this is the case but
> in case of using the simple-audio-card sound card this isn't the case.
>
> In such case the driver probe fails silently and the card isn't
> available. It took a while to find the missing Kconfig. Make this easier
> for others by printing a error if this the module isn't available but
> required by the HW.
>
> Signed-off-by: Marco Felsch <m.felsch at pengutronix.de>
>

Acked-by: Shengjiu Wang <shengjiu.wang at gmail.com>

Best regards
Wang Shengjiu

> ---
>  sound/soc/fsl/fsl_sai.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
> index 3e54f1f71c1e..2371da814b09 100644
> --- a/sound/soc/fsl/fsl_sai.c
> +++ b/sound/soc/fsl/fsl_sai.c
> @@ -1152,8 +1152,11 @@ static int fsl_sai_probe(struct platform_device
> *pdev)
>          */
>         if (sai->soc_data->use_imx_pcm) {
>                 ret = imx_pcm_dma_init(pdev);
> -               if (ret)
> +               if (ret) {
> +                       if (!IS_ENABLED(CONFIG_SND_SOC_IMX_PCM_DMA))
> +                               dev_err(dev, "Error: You must enable the
> imx-pcm-dma support!\n");
>                         goto err_pm_get_sync;
> +               }
>         } else {
>                 ret = devm_snd_dmaengine_pcm_register(dev, NULL, 0);
>                 if (ret)
> --
> 2.30.2
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ozlabs.org/pipermail/linuxppc-dev/attachments/20220606/b2208470/attachment-0001.htm>


More information about the Linuxppc-dev mailing list