Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

soundwire: qcom: fix handling of qcom,ports-block-pack-mode

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.

Fixes: a5943e4fb14e ("soundwire: qcom: check of_property_read status")
Reported-by: Amit Pundir <amit.pundir@linaro.org>
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Tested-by: Amit Pundir <amit.pundir@linaro.org>
Link: https://lore.kernel.org/r/20210504125909.16108-1-srinivas.kandagatla@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Srinivas Kandagatla and committed by
Vinod Koul
da096fbc 6efb943b

+10 -2
+10 -2
drivers/soundwire/qcom.c
··· 1150 1150 1151 1151 ret = of_property_read_u8_array(np, "qcom,ports-block-pack-mode", 1152 1152 bp_mode, nports); 1153 - if (ret) 1154 - return ret; 1153 + if (ret) { 1154 + u32 version; 1155 + 1156 + ctrl->reg_read(ctrl, SWRM_COMP_HW_VERSION, &version); 1157 + 1158 + if (version <= 0x01030000) 1159 + memset(bp_mode, SWR_INVALID_PARAM, QCOM_SDW_MAX_PORTS); 1160 + else 1161 + return ret; 1162 + } 1155 1163 1156 1164 memset(hstart, SWR_INVALID_PARAM, QCOM_SDW_MAX_PORTS); 1157 1165 of_property_read_u8_array(np, "qcom,ports-hstart", hstart, nports);