aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSrinivas Kandagatla <srinivas.kandagatla@linaro.org>2023-02-09 13:13:33 +0000
committerKrzysztof Kozlowski <krzysztof.kozlowski@linaro.org>2023-04-20 12:30:13 +0200
commit780aaa9cd1231d83b129756efbc279834cf92114 (patch)
treeca3b2edc3aff53f927ffc9f3db54d52d0b489506
parent613f630b0c394449535589259bc309de3ccf70f5 (diff)
soundwire: qcom: enable runtime pm before controller is registered
Registering controller even before pm runtime is enabled will result in pm runtime underflow warnings. Fix this by properly moving the runtime pm enable before registering controller. Fixes: 74e79da9fd46 ("soundwire: qcom: add runtime pm support") Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org> Link: https://lore.kernel.org/r/20230209131336.18252-3-srinivas.kandagatla@linaro.org Signed-off-by: Johan Hovold <johan+linaro@kernel.org> (cherry picked from commit 7578d5a6e7e7f0e2457f330c5c10c5c0b09c900d) Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
-rw-r--r--drivers/soundwire/qcom.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/soundwire/qcom.c b/drivers/soundwire/qcom.c
index aad5942e5980..fae8640b142b 100644
--- a/drivers/soundwire/qcom.c
+++ b/drivers/soundwire/qcom.c
@@ -1539,6 +1539,12 @@ static int qcom_swrm_probe(struct platform_device *pdev)
}
}
+ pm_runtime_set_autosuspend_delay(dev, 3000);
+ pm_runtime_use_autosuspend(dev);
+ pm_runtime_mark_last_busy(dev);
+ pm_runtime_set_active(dev);
+ pm_runtime_enable(dev);
+
ret = sdw_bus_master_add(&ctrl->bus, dev, dev->fwnode);
if (ret) {
dev_err(dev, "Failed to register Soundwire controller (%d)\n",
@@ -1557,12 +1563,6 @@ static int qcom_swrm_probe(struct platform_device *pdev)
(ctrl->version >> 24) & 0xff, (ctrl->version >> 16) & 0xff,
ctrl->version & 0xffff);
- pm_runtime_set_autosuspend_delay(dev, 3000);
- pm_runtime_use_autosuspend(dev);
- pm_runtime_mark_last_busy(dev);
- pm_runtime_set_active(dev);
- pm_runtime_enable(dev);
-
/* Clk stop is not supported on WSA Soundwire masters */
if (ctrl->version <= SWRM_VERSION_1_3_0) {
ctrl->clock_stop_not_supported = true;