Skip to content

Commit 01af2d1

Browse files
committed
soundwire: intel: skip suspend/resume/wake when link was not started
On some HDaudio platforms, SoundWire devices are described in the DSDT but never used. This patch adds a boolean status flag to skip all suspend/resume/wake sequences for this configuration. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
1 parent 0c5a1f9 commit 01af2d1

2 files changed

Lines changed: 13 additions & 10 deletions

File tree

drivers/soundwire/intel.c

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1456,6 +1456,7 @@ int intel_link_startup(struct auxiliary_device *auxdev)
14561456
if (!(link_flags & SDW_INTEL_MASTER_DISABLE_PM_RUNTIME_IDLE))
14571457
pm_runtime_idle(dev);
14581458

1459+
sdw->startup_done = true;
14591460
return 0;
14601461

14611462
err_interrupt:
@@ -1495,8 +1496,9 @@ int intel_link_process_wakeen_event(struct auxiliary_device *auxdev)
14951496
sdw = dev_get_drvdata(dev);
14961497
bus = &sdw->cdns.bus;
14971498

1498-
if (bus->prop.hw_disabled) {
1499-
dev_dbg(dev, "SoundWire master %d is disabled, ignoring\n", bus->link_id);
1499+
if (bus->prop.hw_disabled || !sdw->startup_done) {
1500+
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
1501+
bus->link_id);
15001502
return 0;
15011503
}
15021504

@@ -1533,8 +1535,8 @@ static int __maybe_unused intel_suspend(struct device *dev)
15331535
u32 clock_stop_quirks;
15341536
int ret;
15351537

1536-
if (bus->prop.hw_disabled) {
1537-
dev_dbg(dev, "SoundWire master %d is disabled, ignoring\n",
1538+
if (bus->prop.hw_disabled || !sdw->startup_done) {
1539+
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
15381540
bus->link_id);
15391541
return 0;
15401542
}
@@ -1587,8 +1589,8 @@ static int __maybe_unused intel_suspend_runtime(struct device *dev)
15871589
u32 clock_stop_quirks;
15881590
int ret;
15891591

1590-
if (bus->prop.hw_disabled) {
1591-
dev_dbg(dev, "SoundWire master %d is disabled, ignoring\n",
1592+
if (bus->prop.hw_disabled || !sdw->startup_done) {
1593+
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
15921594
bus->link_id);
15931595
return 0;
15941596
}
@@ -1652,8 +1654,8 @@ static int __maybe_unused intel_resume(struct device *dev)
16521654
bool multi_link;
16531655
int ret;
16541656

1655-
if (bus->prop.hw_disabled) {
1656-
dev_dbg(dev, "SoundWire master %d is disabled, ignoring\n",
1657+
if (bus->prop.hw_disabled || !sdw->startup_done) {
1658+
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
16571659
bus->link_id);
16581660
return 0;
16591661
}
@@ -1750,8 +1752,8 @@ static int __maybe_unused intel_resume_runtime(struct device *dev)
17501752
int status;
17511753
int ret;
17521754

1753-
if (bus->prop.hw_disabled) {
1754-
dev_dbg(dev, "SoundWire master %d is disabled, ignoring\n",
1755+
if (bus->prop.hw_disabled || !sdw->startup_done) {
1756+
dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n",
17551757
bus->link_id);
17561758
return 0;
17571759
}

drivers/soundwire/intel.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ struct sdw_intel {
4141
struct sdw_cdns cdns;
4242
int instance;
4343
struct sdw_intel_link_res *link_res;
44+
bool startup_done;
4445
#ifdef CONFIG_DEBUG_FS
4546
struct dentry *debugfs;
4647
#endif

0 commit comments

Comments
 (0)