diff mbox series

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

Message ID 20220601092342.3328644-3-m.felsch@pengutronix.de (mailing list archive)
State Accepted
Commit 22205521770ee740f64a3ec90301f50e34738cfd
Headers show
Series [1/3] ASoC: fsl_sai: use local device pointer | expand

Commit Message

Marco Felsch June 1, 2022, 9:23 a.m. UTC
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@pengutronix.de>
---
 sound/soc/fsl/fsl_sai.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Shengjiu Wang June 6, 2022, 3:20 a.m. UTC | #1
On Wed, Jun 1, 2022 at 5:23 PM Marco Felsch <m.felsch@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@pengutronix.de>
>

Acked-by: Shengjiu Wang <shengjiu.wang@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
>
>
diff mbox series

Patch

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)