Skip to content

Commit

Permalink
soundwire: intel: disable shim wake on suspend
Browse files Browse the repository at this point in the history
If we enabled the clock stop mode and suspend, we need to disable the
shim wake. We do so only if the parent is pm_runtime active due to
power rail dependencies.

GitHub issue: #1678
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
  • Loading branch information
plbossart committed Aug 31, 2020
1 parent 163ec70 commit 5be77e1
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions drivers/soundwire/intel.c
Original file line number Diff line number Diff line change
Expand Up @@ -1532,6 +1532,7 @@ static int intel_suspend(struct device *dev)
struct sdw_cdns *cdns = dev_get_drvdata(dev);
struct sdw_intel *sdw = cdns_to_intel(cdns);
struct sdw_bus *bus = &cdns->bus;
u32 clock_stop_quirks;
int ret;

if (bus->prop.hw_disabled) {
Expand All @@ -1543,6 +1544,23 @@ static int intel_suspend(struct device *dev)
if (pm_runtime_suspended(dev)) {
dev_dbg(dev, "%s: pm_runtime status: suspended\n", __func__);

clock_stop_quirks = sdw->link_res->clock_stop_quirks;

if ((clock_stop_quirks & SDW_INTEL_CLK_STOP_BUS_RESET ||
!clock_stop_quirks) &&
!pm_runtime_suspended(dev->parent)) {

/*
* if we've enabled clock stop, and the parent
* is still active, disable shim wake. The
* SHIM registers are not accessible if the
* parent is already pm_runtime suspended so
* it's too late to change that configuration
*/

intel_shim_wake(sdw, false);
}

return 0;
}

Expand Down

0 comments on commit 5be77e1

Please sign in to comment.