2020-09-04 08:44:44

by Bard Liao

[permalink] [raw]
Subject: [PATCH v2 0/4] soundwire: Remove sdw stream operations from Intel

Sdw stream operation APIs can be called once per stream. Move these
operations to dailink ops. The linked series is "ASoC: Add sdw stream
operations to dailink ops".

Pierre-Louis Bossart (4):
soundwire: stream: fix NULL/IS_ERR confusion
soundwire: intel: fix NULL/ERR_PTR confusion
soundwire: intel: remove .trigger operation
soundwire: intel: remove stream handling from .prepare and .hw_free

drivers/soundwire/intel.c | 60 +++++---------------------------------
drivers/soundwire/stream.c | 2 +-
2 files changed, 9 insertions(+), 53 deletions(-)

--
2.17.1


2020-09-04 08:45:35

by Bard Liao

[permalink] [raw]
Subject: [PATCH v2 4/4] soundwire: intel: remove stream handling from .prepare and .hw_free

From: Pierre-Louis Bossart <[email protected]>

Now that the stream is handled at the dai-link level (in the machine
driver), we can remove the stream handling at the dai level. We still
need these callbacks to perform dai-level resource handling
(i.e. addition/removal of a master).

Signed-off-by: Pierre-Louis Bossart <[email protected]>
Signed-off-by: Bard Liao <[email protected]>
---
drivers/soundwire/intel.c | 19 +++++++------------
1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/drivers/soundwire/intel.c b/drivers/soundwire/intel.c
index d208c49b157a..a254f271acf2 100644
--- a/drivers/soundwire/intel.c
+++ b/drivers/soundwire/intel.c
@@ -967,7 +967,7 @@ static int intel_prepare(struct snd_pcm_substream *substream,
struct sdw_intel *sdw = cdns_to_intel(cdns);
struct sdw_cdns_dma_data *dma;
int ch, dir;
- int ret;
+ int ret = 0;

dma = snd_soc_dai_get_dma_data(dai, substream);
if (!dma) {
@@ -1003,13 +1003,8 @@ static int intel_prepare(struct snd_pcm_substream *substream,
dma->hw_params,
sdw->instance,
dma->pdi->intel_alh_id);
- if (ret)
- goto err;
}

- ret = sdw_prepare_stream(dma->stream);
-
-err:
return ret;
}

@@ -1025,12 +1020,12 @@ intel_hw_free(struct snd_pcm_substream *substream, struct snd_soc_dai *dai)
if (!dma)
return -EIO;

- ret = sdw_deprepare_stream(dma->stream);
- if (ret) {
- dev_err(dai->dev, "sdw_deprepare_stream: failed %d", ret);
- return ret;
- }
-
+ /*
+ * The sdw stream state will transition to RELEASED when stream->
+ * master_list is empty. So the stream state will transition to
+ * DEPREPARED for the first cpu-dai and to RELEASED for the last
+ * cpu-dai.
+ */
ret = sdw_stream_remove_master(&cdns->bus, dma->stream);
if (ret < 0) {
dev_err(dai->dev, "remove master from stream %s failed: %d\n",
--
2.17.1

2020-09-04 09:25:17

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] soundwire: Remove sdw stream operations from Intel

On 04-09-20, 04:47, Bard Liao wrote:
> Sdw stream operation APIs can be called once per stream. Move these
> operations to dailink ops. The linked series is "ASoC: Add sdw stream
> operations to dailink ops".

Applied all, thanks

--
~Vinod

2020-09-08 17:37:05

by Jaroslav Kysela

[permalink] [raw]
Subject: Re: [PATCH v2 0/4] soundwire: Remove sdw stream operations from Intel

Dne 03. 09. 20 v 22:47 Bard Liao napsal(a):
> Sdw stream operation APIs can be called once per stream. Move these
> operations to dailink ops. The linked series is "ASoC: Add sdw stream
> operations to dailink ops".
>
> Pierre-Louis Bossart (4):
> soundwire: stream: fix NULL/IS_ERR confusion
> soundwire: intel: fix NULL/ERR_PTR confusion
> soundwire: intel: remove .trigger operation
> soundwire: intel: remove stream handling from .prepare and .hw_free
>
> drivers/soundwire/intel.c | 60 +++++---------------------------------
> drivers/soundwire/stream.c | 2 +-
> 2 files changed, 9 insertions(+), 53 deletions(-)
>

Straight patches. I tested them. For all:

Acked-by: Jaroslav Kysela <[email protected]>

Note: The ASoC part must be merged in sync -
"[PATCH v3 0/3] ASoC: Add sdw stream operations to dailink ops."

Jaroslav
--
Jaroslav Kysela <[email protected]>
Linux Sound Maintainer; ALSA Project; Red Hat, Inc.