[PATCH 1/2] ASoC: SOF: imx: Add i.MX8ULP HW support

Shengjiu Wang shengjiu.wang at gmail.com
Wed Jul 20 08:12:45 CEST 2022


On Tue, Jul 19, 2022 at 7:41 PM Mark Brown <broonie at kernel.org> wrote:

> On Tue, Jul 19, 2022 at 01:26:06PM +0800, Shengjiu Wang wrote:
>
> Not a thorough review, just a few nitpicks:
>

Thanks.

>
> > +#define MBOX_SIZE            0x1000
> > +
> > +struct arm_smccc_res         smc_resource;
>
> This should be static shouldn't it?
>

I will move it to function as a local variable.

>
> > +static void imx8ulp_dsp_handle_reply(struct imx_dsp_ipc *ipc)
> > +{
> > +     struct imx8ulp_priv *priv = imx_dsp_get_data(ipc);
> > +     unsigned long flags;
> > +
> > +     spin_lock_irqsave(&priv->sdev->ipc_lock, flags);
> > +
> > +     imx8ulp_get_reply(priv->sdev);
> > +     snd_sof_ipc_reply(priv->sdev, 0);
> > +     spin_unlock_irqrestore(&priv->sdev->ipc_lock, flags);
>
> Minor nitpick but a blank line before the unlock to match the one after
> the lock would be a bit easier to read.
>

ok, will update

>
> > +     regmap_update_bits(priv->regmap, SYSCTRL0, EXECUTE_BIT,
> EXECUTE_BIT);
> > +     usleep_range(1, 2);
> > +
> > +     arm_smccc_smc(FSL_SIP_HIFI_XRDC, 0, 0, 0, 0, 0, 0, 0,
> &smc_resource);
>
> You need linux/arm-smccc.h for this (as 0day said).
>
Yes, right.


>
> > +     if (ret) {
> > +             dev_err(&pdev->dev, "failed to init reserved memory region
> %d\n", ret);
> > +             goto exit_pdev_unregister;
> > +     }
> > +
> > +     priv->clks->dsp_clks = imx8ulp_dsp_clks;
> > +     priv->clks->num_dsp_clks = ARRAY_SIZE(imx8ulp_dsp_clks);
> > +
> > +     ret = imx8_parse_clocks(sdev, priv->clks);
> > +     if (ret < 0)
> > +             goto exit_pdev_unregister;
> > +
> > +     ret = imx8_enable_clocks(sdev, priv->clks);
> > +     if (ret < 0)
> > +             goto exit_pdev_unregister;
>
> We're registering the platform device before we enable the clocks - is
> that safe?
>

Yes, it is safe.

>
> > +static int imx8ulp_remove(struct snd_sof_dev *sdev)
> > +{
> > +     struct imx8ulp_priv *priv = sdev->pdata->hw_pdata;
> > +
> > +     platform_device_unregister(priv->ipc_dev);
> > +
> > +     return 0;
> > +}
>
> Could we just use devm?  I'm not seeing an ordering issue but I might be
> missing something.
>

Which devm do you mean?  There seems no
devm_platform_device_register_data().

best regards
wang shengjiu


More information about the Alsa-devel mailing list