All of lore.kernel.org
 help / color / mirror / Atom feed
From: Amit Pundir <amit.pundir@linaro.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: Vinod Koul <vkoul@kernel.org>,
	yung-chuan.liao@linux.intel.com,
	pierre-louis.bossart@linux.intel.com, sanyog.r.kale@intel.com,
	alsa-devel@alsa-project.org, lkml <linux-kernel@vger.kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	John Stultz <john.stultz@linaro.org>
Subject: Re: [PATCH] soundwire: qcom: fix handling of qcom,ports-block-pack-mode
Date: Tue, 4 May 2021 18:58:44 +0530	[thread overview]
Message-ID: <CAMi1Hd0Fxj2Y_ZheFGveCpz1XWHhOOx3UYz7xW4-8RVAN1TPAg@mail.gmail.com> (raw)
In-Reply-To: <20210504125909.16108-1-srinivas.kandagatla@linaro.org>

On Tue, 4 May 2021 at 18:29, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> Support to "qcom,ports-block-pack-mode" was added at later stages
> to support a variant of Qualcomm SoundWire controllers available
> on Apps processor. However the older versions of the SoundWire
> controller which are embedded in WCD Codecs do not need this property.
>
> So returning on error for those cases will break boards like DragonBoard
> DB845c and Lenovo Yoga C630.
>
> This patch fixes error handling on this property considering older usecases.

Tested on Xiaomi Pocophone F1 (sdm845).

Tested-by: Amit Pundir <amit.pundir@linaro.org>

>
> Fixes: 5943e4fb14e3 ("soundwire: qcom: check of_property_read status")
> Reported-by: Amit Pundir <amit.pundir@linaro.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/soundwire/qcom.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index 2827085a323b..0ef79d60e88e 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -1150,8 +1150,16 @@ static int qcom_swrm_get_port_config(struct qcom_swrm_ctrl *ctrl)
>
>         ret = of_property_read_u8_array(np, "qcom,ports-block-pack-mode",
>                                         bp_mode, nports);
> -       if (ret)
> -               return ret;
> +       if (ret) {
> +               u32 version;
> +
> +               ctrl->reg_read(ctrl, SWRM_COMP_HW_VERSION, &version);
> +
> +               if (version <= 0x01030000)
> +                       memset(bp_mode, SWR_INVALID_PARAM, QCOM_SDW_MAX_PORTS);
> +               else
> +                       return ret;
> +       }
>
>         memset(hstart, SWR_INVALID_PARAM, QCOM_SDW_MAX_PORTS);
>         of_property_read_u8_array(np, "qcom,ports-hstart", hstart, nports);
> --
> 2.21.0
>

WARNING: multiple messages have this Message-ID
From: Amit Pundir <amit.pundir@linaro.org>
To: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Cc: alsa-devel@alsa-project.org,
	pierre-louis.bossart@linux.intel.com,
	lkml <linux-kernel@vger.kernel.org>,
	Vinod Koul <vkoul@kernel.org>,
	John Stultz <john.stultz@linaro.org>,
	sanyog.r.kale@intel.com,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	yung-chuan.liao@linux.intel.com
Subject: Re: [PATCH] soundwire: qcom: fix handling of qcom, ports-block-pack-mode
Date: Tue, 4 May 2021 18:58:44 +0530	[thread overview]
Message-ID: <CAMi1Hd0Fxj2Y_ZheFGveCpz1XWHhOOx3UYz7xW4-8RVAN1TPAg@mail.gmail.com> (raw)
In-Reply-To: <20210504125909.16108-1-srinivas.kandagatla@linaro.org>

On Tue, 4 May 2021 at 18:29, Srinivas Kandagatla
<srinivas.kandagatla@linaro.org> wrote:
>
> Support to "qcom,ports-block-pack-mode" was added at later stages
> to support a variant of Qualcomm SoundWire controllers available
> on Apps processor. However the older versions of the SoundWire
> controller which are embedded in WCD Codecs do not need this property.
>
> So returning on error for those cases will break boards like DragonBoard
> DB845c and Lenovo Yoga C630.
>
> This patch fixes error handling on this property considering older usecases.

Tested on Xiaomi Pocophone F1 (sdm845).

Tested-by: Amit Pundir <amit.pundir@linaro.org>

>
> Fixes: 5943e4fb14e3 ("soundwire: qcom: check of_property_read status")
> Reported-by: Amit Pundir <amit.pundir@linaro.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
> ---
>  drivers/soundwire/qcom.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
> index 2827085a323b..0ef79d60e88e 100644
> --- a/drivers/soundwire/qcom.c
> +++ b/drivers/soundwire/qcom.c
> @@ -1150,8 +1150,16 @@ static int qcom_swrm_get_port_config(struct qcom_swrm_ctrl *ctrl)
>
>         ret = of_property_read_u8_array(np, "qcom,ports-block-pack-mode",
>                                         bp_mode, nports);
> -       if (ret)
> -               return ret;
> +       if (ret) {
> +               u32 version;
> +
> +               ctrl->reg_read(ctrl, SWRM_COMP_HW_VERSION, &version);
> +
> +               if (version <= 0x01030000)
> +                       memset(bp_mode, SWR_INVALID_PARAM, QCOM_SDW_MAX_PORTS);
> +               else
> +                       return ret;
> +       }
>
>         memset(hstart, SWR_INVALID_PARAM, QCOM_SDW_MAX_PORTS);
>         of_property_read_u8_array(np, "qcom,ports-hstart", hstart, nports);
> --
> 2.21.0
>

  reply	other threads:[~2021-05-04 13:29 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 12:59 Srinivas Kandagatla
2021-05-04 12:59 ` Srinivas Kandagatla
2021-05-04 13:28 ` Amit Pundir [this message]
2021-05-04 13:28   ` [PATCH] soundwire: qcom: fix handling of qcom, ports-block-pack-mode Amit Pundir
2021-05-11 11:18 ` [PATCH] soundwire: qcom: fix handling of qcom,ports-block-pack-mode Vinod Koul
2021-05-11 11:18   ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMi1Hd0Fxj2Y_ZheFGveCpz1XWHhOOx3UYz7xW4-8RVAN1TPAg@mail.gmail.com \
    --to=amit.pundir@linaro.org \
    --cc=alsa-devel@alsa-project.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=sanyog.r.kale@intel.com \
    --cc=srinivas.kandagatla@linaro.org \
    --cc=vkoul@kernel.org \
    --cc=yung-chuan.liao@linux.intel.com \
    --subject='Re: [PATCH] soundwire: qcom: fix handling of qcom,ports-block-pack-mode' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.