[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAMi1Hd0Fxj2Y_ZheFGveCpz1XWHhOOx3UYz7xW4-8RVAN1TPAg@mail.gmail.com>
Date: Tue, 4 May 2021 18:58:44 +0530
From: Amit Pundir <amit.pundir@...aro.org>
To: Srinivas Kandagatla <srinivas.kandagatla@...aro.org>
Cc: Vinod Koul <vkoul@...nel.org>, yung-chuan.liao@...ux.intel.com,
pierre-louis.bossart@...ux.intel.com, sanyog.r.kale@...el.com,
alsa-devel@...a-project.org, lkml <linux-kernel@...r.kernel.org>,
Bjorn Andersson <bjorn.andersson@...aro.org>,
John Stultz <john.stultz@...aro.org>
Subject: Re: [PATCH] soundwire: qcom: fix handling of qcom,ports-block-pack-mode
On Tue, 4 May 2021 at 18:29, Srinivas Kandagatla
<srinivas.kandagatla@...aro.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@...aro.org>
>
> Fixes: 5943e4fb14e3 ("soundwire: qcom: check of_property_read status")
> Reported-by: Amit Pundir <amit.pundir@...aro.org>
> Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@...aro.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
>
Powered by blists - more mailing lists