[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YtaYe58xS4ynZ+A4@sirena.org.uk>
Date: Tue, 19 Jul 2022 12:41:47 +0100
From: Mark Brown <broonie@...nel.org>
To: Shengjiu Wang <shengjiu.wang@....com>
Cc: pierre-louis.bossart@...ux.intel.com, lgirdwood@...il.com,
peter.ujfalusi@...ux.intel.com, yung-chuan.liao@...ux.intel.com,
ranjani.sridharan@...ux.intel.com, kai.vehmanen@...ux.intel.com,
daniel.baluta@....com, perex@...ex.cz, tiwai@...e.com,
shawnguo@...nel.org, s.hauer@...gutronix.de, kernel@...gutronix.de,
festevam@...il.com, linux-imx@....com, robh+dt@...nel.org,
krzysztof.kozlowski+dt@...aro.org, devicetree@...r.kernel.org,
shengjiu.wang@...il.com, linux-kernel@...r.kernel.org,
sound-open-firmware@...a-project.org, alsa-devel@...a-project.org,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 1/2] ASoC: SOF: imx: Add i.MX8ULP HW support
On Tue, Jul 19, 2022 at 01:26:06PM +0800, Shengjiu Wang wrote:
Not a thorough review, just a few nitpicks:
> +#define MBOX_SIZE 0x1000
> +
> +struct arm_smccc_res smc_resource;
This should be static shouldn't it?
> +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.
> + 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).
> + 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?
> +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.
Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)
Powered by blists - more mailing lists