[alsa-devel] No sound captured with SGTL5000 on i.MX6 in I²S master mode
Nicolin Chen
nicoleotsuka at gmail.com
Thu Sep 18 19:45:27 CEST 2014
On Thu, Sep 18, 2014 at 07:26:11PM +0200, Michael Trimarchi wrote:
> bug was reported by Jean-Michel. I don't know if it works because I can not
> test but seems ok. Do we need this _set_dai_fmt in probe function?
I think yes. The AC97 part might need this _set_dai_fmt call in the
probe().
> code is a bit broken just because panic on probe path if pdev is null
> [...]
> /*
> * If codec-handle property is missing from SSI node, we assume
> * that the machine driver uses new binding which does not require
> * SSI driver to trigger machine driver's probe.
> */
> if (!of_get_property(np, "codec-handle", NULL))
> goto done;
> [...]
> ssi_private->pdev =
> platform_device_register_data(&pdev->dev, name, 0, NULL, 0);
> [...]
> done:
> if (ssi_private->dai_fmt)
> _fsl_ssi_set_dai_fmt(ssi_private, ssi_private->dai_fmt);
>
>
> diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
> index 87eb577..f63bc02 100644
> --- a/sound/soc/fsl/fsl_ssi.c
> +++ b/sound/soc/fsl/fsl_ssi.c
> @@ -758,7 +758,8 @@ static int _fsl_ssi_set_dai_fmt(struct fsl_ssi_private *ssi_private,
> ssi_private->dai_fmt = fmt;
>
> if (fsl_ssi_is_i2s_master(ssi_private) && IS_ERR(ssi_private->baudclk)) {
> - dev_err(&ssi_private->pdev->dev, "baudclk is missing which is necessary for master mode\n");
> + pr_err("baudclk is missing which is necessary"
> + " for master mode\n");
Ah, this is a problem. We should not use ssi_private->pdev->dev here.
I think it'll be better if adding a new parameter of *dev pointer to
this _set_dai_fmt() -- passing pdev->dev in probe() and cpu_dai->dev
in fsl_ssi_set_dai_fmt().
Nicolin
More information about the Alsa-devel
mailing list