soundwire: qcom: set controller id to hw master id
[linux-2.6-microblaze.git] / drivers / soundwire / qcom.c
index 7f8549a..d869e22 100644 (file)
@@ -1620,9 +1620,13 @@ static int qcom_swrm_probe(struct platform_device *pdev)
                }
        }
 
-       /* FIXME: is there a DT-defined value to use ? */
        ctrl->bus.controller_id = -1;
 
+       if (ctrl->version > SWRM_VERSION_1_3_0) {
+               ctrl->reg_read(ctrl, SWRM_COMP_MASTER_ID, &val);
+               ctrl->bus.controller_id = val;
+       }
+
        ret = sdw_bus_master_add(&ctrl->bus, dev, dev->fwnode);
        if (ret) {
                dev_err(dev, "Failed to register Soundwire controller (%d)\n",