Commit 06dd9673 authored by Srinivas Kandagatla's avatar Srinivas Kandagatla Committed by Vinod Koul
parent a6e65819
...@@ -123,6 +123,7 @@ struct qcom_swrm_ctrl { ...@@ -123,6 +123,7 @@ struct qcom_swrm_ctrl {
struct regmap *regmap; struct regmap *regmap;
void __iomem *mmio; void __iomem *mmio;
struct completion broadcast; struct completion broadcast;
struct completion enumeration;
struct work_struct slave_work; struct work_struct slave_work;
/* Port alloc/free lock */ /* Port alloc/free lock */
struct mutex port_lock; struct mutex port_lock;
...@@ -418,6 +419,7 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus) ...@@ -418,6 +419,7 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus)
} }
} }
complete(&ctrl->enumeration);
return 0; return 0;
} }
...@@ -1139,6 +1141,7 @@ static int qcom_swrm_probe(struct platform_device *pdev) ...@@ -1139,6 +1141,7 @@ static int qcom_swrm_probe(struct platform_device *pdev)
dev_set_drvdata(&pdev->dev, ctrl); dev_set_drvdata(&pdev->dev, ctrl);
mutex_init(&ctrl->port_lock); mutex_init(&ctrl->port_lock);
init_completion(&ctrl->broadcast); init_completion(&ctrl->broadcast);
init_completion(&ctrl->enumeration);
ctrl->bus.ops = &qcom_swrm_ops; ctrl->bus.ops = &qcom_swrm_ops;
ctrl->bus.port_ops = &qcom_swrm_port_ops; ctrl->bus.port_ops = &qcom_swrm_port_ops;
...@@ -1185,6 +1188,8 @@ static int qcom_swrm_probe(struct platform_device *pdev) ...@@ -1185,6 +1188,8 @@ static int qcom_swrm_probe(struct platform_device *pdev)
} }
qcom_swrm_init(ctrl); qcom_swrm_init(ctrl);
wait_for_completion_timeout(&ctrl->enumeration,
msecs_to_jiffies(TIMEOUT_MS));
ret = qcom_swrm_register_dais(ctrl); ret = qcom_swrm_register_dais(ctrl);
if (ret) if (ret)
goto err_master_add; goto err_master_add;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment