Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions drivers/soundwire/intel_auxdevice.c
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ int intel_link_process_wakeen_event(struct auxiliary_device *auxdev)
* PM calls
*/

static int intel_resume_child_device(struct device *dev, void *data)
int intel_resume_child_device(struct device *dev, void *data)
{
int ret;
struct sdw_slave *slave = dev_to_sdw_dev(dev);
Expand All @@ -454,9 +454,9 @@ static int intel_resume_child_device(struct device *dev, void *data)
return 0;
}

ret = pm_request_resume(dev);
ret = pm_runtime_resume(dev);
if (ret < 0) {
dev_err(dev, "%s: pm_request_resume failed: %d\n", __func__, ret);
dev_err(dev, "%s: pm_runtime_resume failed: %d\n", __func__, ret);
return ret;
}

Expand Down Expand Up @@ -499,9 +499,9 @@ static int __maybe_unused intel_pm_prepare(struct device *dev)
* first resume the device for this link. This will also by construction
* resume the PCI parent device.
*/
ret = pm_request_resume(dev);
ret = pm_runtime_resume(dev);
if (ret < 0) {
dev_err(dev, "%s: pm_request_resume failed: %d\n", __func__, ret);
dev_err(dev, "%s: pm_runtime_resume failed: %d\n", __func__, ret);
return 0;
}

Expand Down
1 change: 1 addition & 0 deletions drivers/soundwire/intel_auxdevice.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

int intel_link_startup(struct auxiliary_device *auxdev);
int intel_link_process_wakeen_event(struct auxiliary_device *auxdev);
int intel_resume_child_device(struct device *dev, void *data);

struct sdw_intel_link_dev {
struct auxiliary_device auxdev;
Expand Down
14 changes: 14 additions & 0 deletions drivers/soundwire/intel_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
#include <linux/pm_runtime.h>
#include <linux/soundwire/sdw_intel.h>
#include "cadence_master.h"
#include "bus.h"
#include "intel.h"
#include "intel_auxdevice.h"

Expand Down Expand Up @@ -356,6 +357,19 @@ EXPORT_SYMBOL_NS(sdw_intel_startup, SOUNDWIRE_INTEL_INIT);
*/
void sdw_intel_exit(struct sdw_intel_ctx *ctx)
{
struct sdw_intel_link_res *link;

/* we first resume links and devices and wait synchronously before the cleanup */
list_for_each_entry(link, &ctx->link_list, list) {
struct sdw_bus *bus = &link->cdns->bus;
int ret;

ret = device_for_each_child(bus->dev, NULL, intel_resume_child_device);
if (ret < 0)
dev_err(bus->dev, "%s: intel_resume_child_device failed: %d\n",
__func__, ret);
}

sdw_intel_cleanup(ctx);
kfree(ctx->ids);
kfree(ctx->ldev);
Expand Down
4 changes: 2 additions & 2 deletions sound/soc/sof/intel/hda.c
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,12 @@ static int hda_sdw_exit(struct snd_sof_dev *sdev)

hdev = sdev->pdata->hw_pdata;

hda_sdw_int_enable(sdev, false);

if (hdev->sdw)
sdw_intel_exit(hdev->sdw);
hdev->sdw = NULL;

hda_sdw_int_enable(sdev, false);

return 0;
}

Expand Down