From: Bard Liao <yung-chuan.liao@linux.intel.com>
To: linux-sound@vger.kernel.org, vkoul@kernel.org
Cc: vinod.koul@linaro.org, linux-kernel@vger.kernel.org,
pierre-louis.bossart@linux.dev, peter.ujfalusi@linux.intel.com,
bard.liao@intel.com
Subject: [PATCH v2 2/3] soundwire: Intel: add wake_enable parameter to stop_bus ops
Date: Tue, 1 Sep 2026 11:03:10 +0800 [thread overview]
Message-ID: <20260901030311.232823-3-yung-chuan.liao@linux.intel.com> (raw)
In-Reply-To: <20260901030311.232823-1-yung-chuan.liao@linux.intel.com>
Currently, we assume the bus is wakeable when the bus clock stops. But
in some case like system suspend, we want to stop the bus but keep the
bus unwakeable.
No function change in this commit.
Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com>
---
drivers/soundwire/intel.h | 6 +++---
drivers/soundwire/intel_auxdevice.c | 6 +++---
drivers/soundwire/intel_bus_common.c | 8 ++++----
include/linux/soundwire/sdw_intel.h | 2 +-
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/drivers/soundwire/intel.h b/drivers/soundwire/intel.h
index 86abc465260f..7a2e7e73ad63 100644
--- a/drivers/soundwire/intel.h
+++ b/drivers/soundwire/intel.h
@@ -188,10 +188,10 @@ static inline int sdw_intel_start_bus_after_clock_stop(struct sdw_intel *sdw)
return -ENOTSUPP;
}
-static inline int sdw_intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
+static inline int sdw_intel_stop_bus(struct sdw_intel *sdw, bool clock_stop, bool wake_enable)
{
if (SDW_INTEL_CHECK_OPS(sdw, stop_bus))
- return SDW_INTEL_OPS(sdw, stop_bus)(sdw, clock_stop);
+ return SDW_INTEL_OPS(sdw, stop_bus)(sdw, clock_stop, wake_enable);
return -ENOTSUPP;
}
@@ -261,7 +261,7 @@ int intel_start_bus(struct sdw_intel *sdw);
int intel_start_bus_after_reset(struct sdw_intel *sdw);
void intel_check_clock_stop(struct sdw_intel *sdw);
int intel_start_bus_after_clock_stop(struct sdw_intel *sdw);
-int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop);
+int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop, bool wake_enable);
/* common bank switch routines */
int intel_pre_bank_switch(struct sdw_intel *sdw);
diff --git a/drivers/soundwire/intel_auxdevice.c b/drivers/soundwire/intel_auxdevice.c
index a8407560bf4f..77e09e0e9953 100644
--- a/drivers/soundwire/intel_auxdevice.c
+++ b/drivers/soundwire/intel_auxdevice.c
@@ -670,7 +670,7 @@ static int __maybe_unused intel_suspend(struct device *dev)
return 0;
}
- ret = sdw_intel_stop_bus(sdw, false);
+ ret = sdw_intel_stop_bus(sdw, false, false);
if (ret < 0) {
dev_err(dev, "%s: cannot stop bus: %d\n", __func__, ret);
return ret;
@@ -696,14 +696,14 @@ static int __maybe_unused intel_suspend_runtime(struct device *dev)
clock_stop_quirks = sdw->link_res->clock_stop_quirks;
if (clock_stop_quirks & SDW_INTEL_CLK_STOP_TEARDOWN) {
- ret = sdw_intel_stop_bus(sdw, false);
+ ret = sdw_intel_stop_bus(sdw, false, false);
if (ret < 0) {
dev_err(dev, "%s: cannot stop bus during teardown: %d\n",
__func__, ret);
return ret;
}
} else if (clock_stop_quirks & SDW_INTEL_CLK_STOP_BUS_RESET || !clock_stop_quirks) {
- ret = sdw_intel_stop_bus(sdw, true);
+ ret = sdw_intel_stop_bus(sdw, true, true);
if (ret < 0) {
dev_err(dev, "%s: cannot stop bus during clock_stop: %d\n",
__func__, ret);
diff --git a/drivers/soundwire/intel_bus_common.c b/drivers/soundwire/intel_bus_common.c
index ad1f8ebdbfc9..fa35eb2fc763 100644
--- a/drivers/soundwire/intel_bus_common.c
+++ b/drivers/soundwire/intel_bus_common.c
@@ -202,11 +202,11 @@ int intel_start_bus_after_clock_stop(struct sdw_intel *sdw)
return 0;
}
-int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
+int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop, bool wake_enable)
{
struct device *dev = sdw->cdns.dev;
struct sdw_cdns *cdns = &sdw->cdns;
- bool wake_enable = false;
+ bool en = false;
int ret;
cancel_delayed_work_sync(&cdns->attach_dwork);
@@ -216,7 +216,7 @@ int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
if (ret < 0)
dev_err(dev, "%s: cannot stop clock: %d\n", __func__, ret);
else
- wake_enable = true;
+ en = wake_enable;
}
ret = sdw_cdns_enable_interrupt(cdns, false);
@@ -231,7 +231,7 @@ int intel_stop_bus(struct sdw_intel *sdw, bool clock_stop)
return ret;
}
- sdw_intel_shim_wake(sdw, wake_enable);
+ sdw_intel_shim_wake(sdw, en);
return 0;
}
diff --git a/include/linux/soundwire/sdw_intel.h b/include/linux/soundwire/sdw_intel.h
index 9c9435009537..9710f2dc04e2 100644
--- a/include/linux/soundwire/sdw_intel.h
+++ b/include/linux/soundwire/sdw_intel.h
@@ -424,7 +424,7 @@ struct sdw_intel_hw_ops {
int (*start_bus)(struct sdw_intel *sdw);
int (*start_bus_after_reset)(struct sdw_intel *sdw);
int (*start_bus_after_clock_stop)(struct sdw_intel *sdw);
- int (*stop_bus)(struct sdw_intel *sdw, bool clock_stop);
+ int (*stop_bus)(struct sdw_intel *sdw, bool clock_stop, bool wake_enable);
int (*link_power_up)(struct sdw_intel *sdw);
int (*link_power_down)(struct sdw_intel *sdw);
--
2.43.0
next prev parent reply other threads:[~2026-09-01 3:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-01 3:03 [PATCH v2 0/3] soundwire: bus: re-enable CLOCK_STOP_MODE1 support Bard Liao
2026-09-01 3:03 ` [PATCH v2 1/3] soundwire: bus: add CLOCK_STOP_MODE1 support back Bard Liao
2026-09-01 3:03 ` Bard Liao [this message]
2026-09-01 3:03 ` [PATCH v2 3/3] soundwire: Intel: stop sdw clock in system suspend Bard Liao
2026-09-04 7:25 ` [PATCH v2 0/3] soundwire: bus: re-enable CLOCK_STOP_MODE1 support Pierre-Louis Bossart
2026-09-08 13:58 ` Vinod Koul
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260901030311.232823-3-yung-chuan.liao@linux.intel.com \
--to=yung-chuan.liao@linux.intel.com \
--cc=bard.liao@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=peter.ujfalusi@linux.intel.com \
--cc=pierre-louis.bossart@linux.dev \
--cc=vinod.koul@linaro.org \
--cc=vkoul@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®