summaryrefslogtreecommitdiff
path: root/sound/soc/intel/catpt/device.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/intel/catpt/device.c')
-rw-r--r--sound/soc/intel/catpt/device.c26
1 files changed, 18 insertions, 8 deletions
diff --git a/sound/soc/intel/catpt/device.c b/sound/soc/intel/catpt/device.c
index faa916f40069..d13062c8e907 100644
--- a/sound/soc/intel/catpt/device.c
+++ b/sound/soc/intel/catpt/device.c
@@ -28,7 +28,7 @@
#define CREATE_TRACE_POINTS
#include "trace.h"
-static int catpt_suspend(struct device *dev)
+static int catpt_do_suspend(struct device *dev)
{
struct catpt_dev *cdev = dev_get_drvdata(dev);
struct dma_chan *chan;
@@ -72,6 +72,13 @@ release_dma_chan:
return catpt_dsp_power_down(cdev);
}
+/* Do not block the system from suspending, recover on resume() if needed. */
+static int catpt_suspend(struct device *dev)
+{
+ catpt_do_suspend(dev);
+ return 0;
+}
+
static int catpt_resume(struct device *dev)
{
struct catpt_dev *cdev = dev_get_drvdata(dev);
@@ -114,7 +121,7 @@ static int catpt_runtime_suspend(struct device *dev)
}
module_put(dev->driver->owner);
- return catpt_suspend(dev);
+ return catpt_do_suspend(dev);
}
static int catpt_runtime_resume(struct device *dev)
@@ -184,22 +191,25 @@ static int catpt_probe_components(struct catpt_dev *cdev)
goto err_boot_fw;
}
- ret = catpt_register_board(cdev);
- if (ret) {
- dev_err(cdev->dev, "register board failed: %d\n", ret);
- goto err_reg_board;
- }
-
/* reflect actual ADSP state in pm_runtime */
pm_runtime_set_active(cdev->dev);
pm_runtime_set_autosuspend_delay(cdev->dev, 2000);
pm_runtime_use_autosuspend(cdev->dev);
pm_runtime_mark_last_busy(cdev->dev);
+ /* Enable PM before spawning child device. See catpt_dai_pcm_new(). */
pm_runtime_enable(cdev->dev);
+
+ ret = catpt_register_board(cdev);
+ if (ret) {
+ dev_err(cdev->dev, "register board failed: %d\n", ret);
+ goto err_reg_board;
+ }
+
return 0;
err_reg_board:
+ pm_runtime_disable(cdev->dev);
snd_soc_unregister_component(cdev->dev);
err_boot_fw:
catpt_dmac_remove(cdev);