[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <090b1b81-3c33-7d37-e0bb-a5f73ab76ad0@linaro.org>
Date: Thu, 16 Apr 2020 08:56:26 +0100
From: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
To: Ajit Pandey <ajitp@...eaurora.org>, alsa-devel@...a-project.org,
broonie@...nel.org, devicetree@...r.kernel.org,
plai@...eaurora.org, bgoswami@...eaurora.org
Cc: linux-kernel@...r.kernel.org, tiwai@...e.com
Subject: Re: [PATCH 04/11] ASoC: qcom: lpass-cpu: Make "ahbix-clk" an optional
clock.
On 11/04/2020 09:02, Ajit Pandey wrote:
> AHB-I/X bus clocks inside LPASS coreis not a mandatory clocks for
s/coreis/core is/
> newer lpass variants, hence make it an optional one.
>
Can you add more detail on which version of IP would not have this clk.
> Signed-off-by: Ajit Pandey <ajitp@...eaurora.org>
> ---
> sound/soc/qcom/lpass-cpu.c | 31 ++++++++++++++++++-------------
> 1 file changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/sound/soc/qcom/lpass-cpu.c b/sound/soc/qcom/lpass-cpu.c
> index 492f27b..f177932 100644
> --- a/sound/soc/qcom/lpass-cpu.c
> +++ b/sound/soc/qcom/lpass-cpu.c
> @@ -504,26 +504,31 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)
> return ret;
> }
>
> - drvdata->ahbix_clk = devm_clk_get(&pdev->dev, "ahbix-clk");
> + drvdata->ahbix_clk = devm_clk_get_optional(&pdev->dev, "ahbix-clk");
> if (IS_ERR(drvdata->ahbix_clk)) {
> dev_err(&pdev->dev, "error getting ahbix-clk: %ld\n",
> PTR_ERR(drvdata->ahbix_clk));
> return PTR_ERR(drvdata->ahbix_clk);
> }
>
> - ret = clk_set_rate(drvdata->ahbix_clk, LPASS_AHBIX_CLOCK_FREQUENCY);
> - if (ret) {
> - dev_err(&pdev->dev, "error setting rate on ahbix_clk: %d\n",
> - ret);
> - return ret;
> - }
> - dev_dbg(&pdev->dev, "set ahbix_clk rate to %lu\n",
> - clk_get_rate(drvdata->ahbix_clk));
> + if (drvdata->ahbix_clk != NULL) {
No need for NULL checks here, clk apis already have checks.
--srini
> + ret = clk_set_rate(drvdata->ahbix_clk,
> + LPASS_AHBIX_CLOCK_FREQUENCY);
> + if (ret) {
> + dev_err(&pdev->dev,
> + "error setting rate on ahbix_clk: %d\n", ret);
> + return ret;
> + }
>
> - ret = clk_prepare_enable(drvdata->ahbix_clk);
> - if (ret) {
> - dev_err(&pdev->dev, "error enabling ahbix_clk: %d\n", ret);
> - return ret;
> + dev_dbg(&pdev->dev, "set ahbix_clk rate to %lu\n",
> + clk_get_rate(drvdata->ahbix_clk));
> +
> + ret = clk_prepare_enable(drvdata->ahbix_clk);
> + if (ret) {
> + dev_err(&pdev->dev,
> + "error enabling ahbix_clk: %d\n", ret);
> + return ret;
> + }
> }
>
> ret = devm_snd_soc_register_component(&pdev->dev,
>
Powered by blists - more mailing lists