]> Git Repo - J-linux.git/commitdiff
soundwire: qcom: Check device status before reading devid
authorSrinivas Kandagatla <[email protected]>
Wed, 6 Jul 2022 09:56:44 +0000 (10:56 +0100)
committerVinod Koul <[email protected]>
Wed, 6 Jul 2022 16:44:51 +0000 (22:14 +0530)
As per hardware datasheet its recommended that we check the device
status before reading devid assigned by auto-enumeration.

Without this patch we see SoundWire devices with invalid enumeration
addresses on the bus.

Cc: [email protected]
Fixes: a6e6581942ca ("soundwire: qcom: add auto enumeration support")
Signed-off-by: Srinivas Kandagatla <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Vinod Koul <[email protected]>
drivers/soundwire/qcom.c

index fbc4c42f3cf39653467ecba861e517e7a11da704..b48815d77f8d53b1c8f5f49fd18b081aca52ba12 100644 (file)
@@ -474,6 +474,10 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus)
        char *buf1 = (char *)&val1, *buf2 = (char *)&val2;
 
        for (i = 1; i <= SDW_MAX_DEVICES; i++) {
+               /* do not continue if the status is Not Present  */
+               if (!ctrl->status[i])
+                       continue;
+
                /*SCP_Devid5 - Devid 4*/
                ctrl->reg_read(ctrl, SWRM_ENUMERATOR_SLAVE_DEV_ID_1(i), &val1);
 
This page took 0.053046 seconds and 4 git commands to generate.