Skip to content

Commit aa8cb23

Browse files
committed
ASoC: SOF: move PM callbacks to the SOF platform device
Set the PM callbacks for the SOF device instead of the acpi/pci/spi device. pm_runtime_enable() is called in the pcm_probe() method and it is enabled for the platform device. Signed-off-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com>
1 parent a1e21c6 commit aa8cb23

File tree

4 files changed

+8
-25
lines changed

4 files changed

+8
-25
lines changed

sound/soc/sof/core.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,17 @@ void snd_sof_shutdown(struct device *dev)
371371
}
372372
EXPORT_SYMBOL(snd_sof_shutdown);
373373

374+
static const struct dev_pm_ops sof_platform_pm = {
375+
SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
376+
SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
377+
NULL)
378+
.suspend_late = snd_sof_suspend_late,
379+
};
380+
374381
static struct platform_driver sof_driver = {
375382
.driver = {
376383
.name = "sof-audio",
384+
.pm = &sof_platform_pm,
377385
},
378386

379387
.probe = sof_probe,

sound/soc/sof/sof-acpi-dev.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,6 @@ static void sof_acpi_fw_cb(const struct firmware *fw, void *context)
158158
}
159159
}
160160

161-
static const struct dev_pm_ops sof_acpi_pm = {
162-
SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
163-
SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
164-
NULL)
165-
.suspend_late = snd_sof_suspend_late,
166-
};
167-
168161
static const struct sof_ops_table mach_ops[] = {
169162
#if IS_ENABLED(CONFIG_SND_SOC_SOF_HASWELL)
170163
{&sof_acpi_haswell_desc, &sof_hsw_ops},
@@ -344,7 +337,6 @@ static struct platform_driver snd_sof_acpi_driver = {
344337
.shutdown = sof_acpi_shutdown,
345338
.driver = {
346339
.name = "sof-audio-acpi",
347-
.pm = &sof_acpi_pm,
348340
.acpi_match_table = ACPI_PTR(sof_acpi_match),
349341
},
350342
};

sound/soc/sof/sof-pci-dev.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -151,13 +151,6 @@ static void sof_pci_fw_cb(const struct firmware *fw, void *context)
151151
}
152152
}
153153

154-
static const struct dev_pm_ops sof_pci_pm = {
155-
SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
156-
SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
157-
NULL)
158-
.suspend_late = snd_sof_suspend_late,
159-
};
160-
161154
static const struct sof_ops_table mach_ops[] = {
162155
#if IS_ENABLED(CONFIG_SND_SOC_SOF_APOLLOLAKE)
163156
{&bxt_desc, &sof_apl_ops},
@@ -368,9 +361,6 @@ static struct pci_driver snd_sof_pci_driver = {
368361
.probe = sof_pci_probe,
369362
.remove = sof_pci_remove,
370363
.shutdown = sof_pci_shutdown,
371-
.driver = {
372-
.pm = &sof_pci_pm,
373-
},
374364
};
375365
module_pci_driver(snd_sof_pci_driver);
376366

sound/soc/sof/sof-spi-dev.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,13 +43,6 @@ static void sof_spi_fw_cb(const struct firmware *fw, void *context)
4343
}
4444
}
4545

46-
static const struct dev_pm_ops sof_spi_pm = {
47-
SET_SYSTEM_SLEEP_PM_OPS(snd_sof_suspend, snd_sof_resume)
48-
SET_RUNTIME_PM_OPS(snd_sof_runtime_suspend, snd_sof_runtime_resume,
49-
NULL)
50-
.suspend_late = snd_sof_suspend_late,
51-
};
52-
5346
static int sof_spi_probe(struct spi_device *spi)
5447
{
5548
struct device *dev = &spi->dev;

0 commit comments

Comments
 (0)