From: Stefan Binding <sbinding@opensource.cirrus.com>
To: Mark Brown <broonie@kernel.org>,
Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Cc: <alsa-devel@alsa-project.org>, <linux-kernel@vger.kernel.org>,
<patches@opensource.cirrus.com>,
Stefan Binding <sbinding@opensource.cirrus.com>
Subject: [PATCH v2 1/8] soundwire: stream: Add specific prep/deprep commands to port_prep callback
Date: Wed, 18 Jan 2023 16:04:45 +0000 [thread overview]
Message-ID: <20230118160452.2385494-2-sbinding@opensource.cirrus.com> (raw)
In-Reply-To: <20230118160452.2385494-1-sbinding@opensource.cirrus.com>
Currently, port_prep callback only has commands for PRE_PREP, PREP,
and POST_PREP, which doesn't directly say whether this is for a
prepare or deprepare call. Extend the command list enum to say
whether the call is for prepare or deprepare aswell.
Also remove SDW_OPS_PORT_PREP from sdw_port_prep_ops as this is unused,
and update this enum to be simpler and more consistent with enum
sdw_clk_stop_type.
Note: Currently, the only users of SDW_OPS_PORT_POST_PREP are codec
drivers sound/soc/codecs/wsa881x.c and sound/soc/codecs/wsa883x.c, both
of which seem to assume that POST_PREP only occurs after a prepare,
even though it would also have occurred after a deprepare. Since it
doesn't make sense to mark the port prepared after a deprepare, changing
the enum to separate PORT_DEPREP from PORT_PREP should make the check
for PORT_PREP in those drivers be more logical.
Signed-off-by: Stefan Binding <sbinding@opensource.cirrus.com>
---
drivers/soundwire/stream.c | 4 ++--
include/linux/soundwire/sdw.h | 8 +++++---
2 files changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/soundwire/stream.c b/drivers/soundwire/stream.c
index df3b36670df4c..1652fb5737d9d 100644
--- a/drivers/soundwire/stream.c
+++ b/drivers/soundwire/stream.c
@@ -469,7 +469,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
}
/* Inform slave about the impending port prepare */
- sdw_do_port_prep(s_rt, prep_ch, SDW_OPS_PORT_PRE_PREP);
+ sdw_do_port_prep(s_rt, prep_ch, prep ? SDW_OPS_PORT_PRE_PREP : SDW_OPS_PORT_PRE_DEPREP);
/* Prepare Slave port implementing CP_SM */
if (!dpn_prop->simple_ch_prep_sm) {
@@ -501,7 +501,7 @@ static int sdw_prep_deprep_slave_ports(struct sdw_bus *bus,
}
/* Inform slaves about ports prepared */
- sdw_do_port_prep(s_rt, prep_ch, SDW_OPS_PORT_POST_PREP);
+ sdw_do_port_prep(s_rt, prep_ch, prep ? SDW_OPS_PORT_POST_PREP : SDW_OPS_PORT_POST_DEPREP);
/* Disable interrupt after Port de-prepare */
if (!prep && intr)
diff --git a/include/linux/soundwire/sdw.h b/include/linux/soundwire/sdw.h
index 3cd2a761911ff..547fc1b30a51a 100644
--- a/include/linux/soundwire/sdw.h
+++ b/include/linux/soundwire/sdw.h
@@ -569,13 +569,15 @@ struct sdw_prepare_ch {
* enum sdw_port_prep_ops: Prepare operations for Data Port
*
* @SDW_OPS_PORT_PRE_PREP: Pre prepare operation for the Port
- * @SDW_OPS_PORT_PREP: Prepare operation for the Port
+ * @SDW_OPS_PORT_PRE_DEPREP: Pre deprepare operation for the Port
* @SDW_OPS_PORT_POST_PREP: Post prepare operation for the Port
+ * @SDW_OPS_PORT_POST_DEPREP: Post deprepare operation for the Port
*/
enum sdw_port_prep_ops {
SDW_OPS_PORT_PRE_PREP = 0,
- SDW_OPS_PORT_PREP = 1,
- SDW_OPS_PORT_POST_PREP = 2,
+ SDW_OPS_PORT_PRE_DEPREP,
+ SDW_OPS_PORT_POST_PREP,
+ SDW_OPS_PORT_POST_DEPREP,
};
/**
--
2.34.1
next prev parent reply other threads:[~2023-01-18 16:11 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-18 16:04 [PATCH v2 0/8] ASoC: cs42l42: Add Soundwire support Stefan Binding
2023-01-18 16:04 ` Stefan Binding [this message]
2023-01-18 16:37 ` [PATCH v2 1/8] soundwire: stream: Add specific prep/deprep commands to port_prep callback Pierre-Louis Bossart
2023-01-18 16:04 ` [PATCH v2 2/8] ASoC: cs42l42: Add SOFT_RESET_REBOOT register Stefan Binding
2023-01-18 16:41 ` Pierre-Louis Bossart
2023-01-19 13:33 ` Richard Fitzgerald
2023-01-18 16:04 ` [PATCH v2 3/8] ASoC: cs42l42: Ensure MCLKint is a multiple of the sample rate Stefan Binding
2023-01-18 16:46 ` Pierre-Louis Bossart
2023-01-18 16:04 ` [PATCH v2 4/8] ASoC: cs42l42: Separate ASP config from PLL config Stefan Binding
2023-01-18 16:04 ` [PATCH v2 5/8] ASoC: cs42l42: Export some functions for Soundwire Stefan Binding
2023-01-18 16:04 ` [PATCH v2 6/8] ASoC: cs42l42: Add Soundwire support Stefan Binding
2023-01-18 17:41 ` Pierre-Louis Bossart
2023-01-19 13:58 ` Richard Fitzgerald
2023-01-19 14:48 ` Pierre-Louis Bossart
2023-01-19 15:35 ` Richard Fitzgerald
2023-01-19 16:27 ` Pierre-Louis Bossart
2023-01-20 12:31 ` Richard Fitzgerald
2023-01-20 19:55 ` Pierre-Louis Bossart
2023-01-23 15:51 ` Richard Fitzgerald
2023-01-23 16:05 ` Pierre-Louis Bossart
2023-01-23 16:14 ` Richard Fitzgerald
2023-01-23 16:25 ` Pierre-Louis Bossart
2023-01-18 16:04 ` [PATCH v2 7/8] ASoC: cs42l42: Don't set idle_bias_on Stefan Binding
2023-01-18 16:04 ` [PATCH v2 8/8] ASoC: cs42l42: Wait for debounce interval after resume Stefan Binding
2023-01-18 17:43 ` [PATCH v2 0/8] ASoC: cs42l42: Add Soundwire support Pierre-Louis Bossart
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=20230118160452.2385494-2-sbinding@opensource.cirrus.com \
--to=sbinding@opensource.cirrus.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@opensource.cirrus.com \
--cc=pierre-louis.bossart@linux.intel.com \
/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