diff options
author | Srinivas Kandagatla <srinivas.kandagatla@linaro.org> | 2021-03-30 15:47:19 +0100 |
---|---|---|
committer | Vinod Koul <vkoul@kernel.org> | 2021-03-30 22:55:07 +0530 |
commit | 06dd96738d618391ae58e1b28f1ba49fef214c95 (patch) | |
tree | 2889853cf4cb3f627f7e2dc2972e05bbe4bec2b8 /drivers/soundwire/qcom.c | |
parent | a6e6581942caa0fab059634459c4c349fd7e4cc2 (diff) |
soundwire: qcom: wait for enumeration to be complete in probe
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Link: https://lore.kernel.org/r/20210330144719.13284-10-srinivas.kandagatla@linaro.org
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Diffstat (limited to 'drivers/soundwire/qcom.c')
-rw-r--r-- | drivers/soundwire/qcom.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c index b1dbaf8263e5..b08ecb9b418c 100644 --- a/drivers/soundwire/qcom.c +++ b/drivers/soundwire/qcom.c @@ -123,6 +123,7 @@ struct qcom_swrm_ctrl { struct regmap *regmap; void __iomem *mmio; struct completion broadcast; + struct completion enumeration; struct work_struct slave_work; /* Port alloc/free lock */ struct mutex port_lock; @@ -418,6 +419,7 @@ static int qcom_swrm_enumerate(struct sdw_bus *bus) } } + complete(&ctrl->enumeration); return 0; } @@ -1139,6 +1141,7 @@ static int qcom_swrm_probe(struct platform_device *pdev) dev_set_drvdata(&pdev->dev, ctrl); mutex_init(&ctrl->port_lock); init_completion(&ctrl->broadcast); + init_completion(&ctrl->enumeration); ctrl->bus.ops = &qcom_swrm_ops; ctrl->bus.port_ops = &qcom_swrm_port_ops; @@ -1185,6 +1188,8 @@ static int qcom_swrm_probe(struct platform_device *pdev) } qcom_swrm_init(ctrl); + wait_for_completion_timeout(&ctrl->enumeration, + msecs_to_jiffies(TIMEOUT_MS)); ret = qcom_swrm_register_dais(ctrl); if (ret) goto err_master_add; |