[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <97757ee1-2525-4e97-855e-da6fb66f01ae@linux.intel.com>
Date: Thu, 9 Jun 2022 10:22:35 -0500
From: Pierre-Louis Bossart <pierre-louis.bossart@...ux.intel.com>
To: Srinivasa Rao Mandadapu <quic_srivasam@...cinc.com>,
agross@...nel.org, bjorn.andersson@...aro.org, lgirdwood@...il.com,
broonie@...nel.org, robh+dt@...nel.org, quic_plai@...cinc.com,
bgoswami@...cinc.com, perex@...ex.cz, tiwai@...e.com,
srinivas.kandagatla@...aro.org, quic_rohkumar@...cinc.com,
linux-arm-msm@...r.kernel.org, alsa-devel@...a-project.org,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
swboyd@...omium.org, judyhsiao@...omium.org, vkoul@...nel.org
Subject: Re: [PATCH v4 1/2] soundwire: qcom: Add flag for software clock
gating check
On 6/9/22 09:30, Srinivasa Rao Mandadapu wrote:
> Validate software clock gating required or not and do software
> clock gating on hclk if soundwire is operational and keep it
> running by adding flag in private data structure.
> This is to avoid conflict between older architectures,
> where software clock gating is not required and on latest
> architectues, where software clock gating is mandatory.
architectures.
>
> Signed-off-by: Srinivasa Rao Mandadapu <quic_srivasam@...cinc.com>
> Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
> ---
> drivers/soundwire/qcom.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index a3fccf0..8e163da 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -181,6 +181,7 @@ struct qcom_swrm_ctrl {
> struct qcom_swrm_data {
> u32 default_cols;
> u32 default_rows;
> + bool sw_clk_gate_required;
> };
>
> static const struct qcom_swrm_data swrm_v1_3_data = {
> @@ -1311,6 +1312,15 @@ static int qcom_swrm_probe(struct platform_device *pdev)
> return PTR_ERR(ctrl->mmio);
> }
>
> + if (data->sw_clk_gate_required) {
> + ctrl->audio_cgcr = devm_reset_control_get_exclusive(dev, "swr_audio_cgcr");
> + if (IS_ERR(ctrl->audio_cgcr)) {
You need to handle the NULL case, devm_reset_control_get_exclusive() can
return ERR_OR_NULL
https://elixir.bootlin.com/linux/latest/source/drivers/reset/core.c#L1045
> + dev_err(dev, "Failed to get cgcr reset ctrl required for SW gating\n");
> + ret = PTR_ERR(ctrl->audio_cgcr);
> + goto err_init;
> + }
> + }
> +
> ctrl->irq = of_irq_get(dev->of_node, 0);
> if (ctrl->irq < 0) {
> ret = ctrl->irq;
> @@ -1336,10 +1346,6 @@ static int qcom_swrm_probe(struct platform_device *pdev)
> ctrl->bus.compute_params = &qcom_swrm_compute_params;
> ctrl->bus.clk_stop_timeout = 300;
>
> - ctrl->audio_cgcr = devm_reset_control_get_exclusive(dev, "swr_audio_cgcr");
> - if (IS_ERR(ctrl->audio_cgcr))
> - dev_err(dev, "Failed to get audio_cgcr reset required for soundwire-v1.6.0\n");
> -
> ret = qcom_swrm_get_port_config(ctrl);
> if (ret)
> goto err_clk;
Powered by blists - more mailing lists