Skip to content

Commit a7ae05e

Browse files
Srinivas-Kandagatlavinodkoul
authored andcommitted
soundwire: qcom: set controller id to hw master id
Qualcomm Soundwire Controllers IP version after 1.3 have a dedicated master id register which will provide a unique id value for each controller instance. Use this value instead of artificially generated value from idr. Versions 1.3 and below only have one instance of soundwire controller which does no have this register, so let them use value from idr. Signed-off-by: Srinivas Kandagatla <[email protected]> Reviewed-by: Krzysztof Kozlowski <[email protected]> Tested-by: Krzysztof Kozlowski <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 8a8a9ac commit a7ae05e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

drivers/soundwire/qcom.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1620,9 +1620,13 @@ static int qcom_swrm_probe(struct platform_device *pdev)
16201620
}
16211621
}
16221622

1623-
/* FIXME: is there a DT-defined value to use ? */
16241623
ctrl->bus.controller_id = -1;
16251624

1625+
if (ctrl->version > SWRM_VERSION_1_3_0) {
1626+
ctrl->reg_read(ctrl, SWRM_COMP_MASTER_ID, &val);
1627+
ctrl->bus.controller_id = val;
1628+
}
1629+
16261630
ret = sdw_bus_master_add(&ctrl->bus, dev, dev->fwnode);
16271631
if (ret) {
16281632
dev_err(dev, "Failed to register Soundwire controller (%d)\n",

0 commit comments

Comments
 (0)