All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [PATCH 22/29] ASoC: bcm: use asoc_substream_to_rtd()
Date: 20 Jul 2020 10:19:23 +0900	[thread overview]
Message-ID: <87365n0ysi.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87y2nf0yw2.wl-kuninori.morimoto.gx@renesas.com>


From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

Now we can use asoc_substream_to_rtd() macro,
let's use it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/bcm/bcm63xx-pcm-whistler.c | 12 ++++++------
 sound/soc/bcm/cygnus-pcm.c           | 16 ++++++++--------
 2 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/sound/soc/bcm/bcm63xx-pcm-whistler.c b/sound/soc/bcm/bcm63xx-pcm-whistler.c
index b7a1efc7406e..7ec8559d53a2 100644
--- a/sound/soc/bcm/bcm63xx-pcm-whistler.c
+++ b/sound/soc/bcm/bcm63xx-pcm-whistler.c
@@ -45,7 +45,7 @@ static int bcm63xx_pcm_hw_params(struct snd_soc_component *component,
 				 struct snd_pcm_hw_params *params)
 {
 	struct i2s_dma_desc *dma_desc;
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_pcm_runtime *runtime = substream->runtime;
 
 	snd_pcm_set_runtime_buffer(substream, &substream->dma_buffer);
@@ -64,7 +64,7 @@ static int bcm63xx_pcm_hw_free(struct snd_soc_component *component,
 			struct snd_pcm_substream *substream)
 {
 	struct i2s_dma_desc	*dma_desc;
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 
 	dma_desc = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
 	kfree(dma_desc);
@@ -81,7 +81,7 @@ static int bcm63xx_pcm_trigger(struct snd_soc_component *component,
 	struct bcm_i2s_priv *i2s_priv;
 	struct regmap   *regmap_i2s;
 
-	rtd = substream->private_data;
+	rtd = asoc_substream_to_rtd(substream);
 	i2s_priv = dev_get_drvdata(asoc_rtd_to_cpu(rtd, 0)->dev);
 	regmap_i2s = i2s_priv->regmap_i2s;
 
@@ -148,7 +148,7 @@ static int bcm63xx_pcm_prepare(struct snd_soc_component *component,
 	struct i2s_dma_desc	*dma_desc;
 	struct regmap		*regmap_i2s;
 	struct bcm_i2s_priv	*i2s_priv;
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	uint32_t regaddr_desclen, regaddr_descaddr;
 
@@ -267,7 +267,7 @@ static irqreturn_t i2s_dma_isr(int irq, void *bcm_i2s_priv)
 	if (int_status & I2S_RX_DESC_OFF_INTR_EN_MSK) {
 		substream = i2s_priv->capture_substream;
 		runtime = substream->runtime;
-		rtd = substream->private_data;
+		rtd = asoc_substream_to_rtd(substream);
 		prtd = runtime->private_data;
 		dma_desc = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
 
@@ -315,7 +315,7 @@ static irqreturn_t i2s_dma_isr(int irq, void *bcm_i2s_priv)
 	if (int_status & I2S_TX_DESC_OFF_INTR_EN_MSK) {
 		substream = i2s_priv->play_substream;
 		runtime = substream->runtime;
-		rtd = substream->private_data;
+		rtd = asoc_substream_to_rtd(substream);
 		prtd = runtime->private_data;
 		dma_desc = snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(rtd, 0), substream);
 
diff --git a/sound/soc/bcm/cygnus-pcm.c b/sound/soc/bcm/cygnus-pcm.c
index f96d27c8b301..7ad07239f99c 100644
--- a/sound/soc/bcm/cygnus-pcm.c
+++ b/sound/soc/bcm/cygnus-pcm.c
@@ -207,7 +207,7 @@ static u64 cygnus_dma_dmamask = DMA_BIT_MASK(32);
 static struct cygnus_aio_port *cygnus_dai_get_dma_data(
 				struct snd_pcm_substream *substream)
 {
-	struct snd_soc_pcm_runtime *soc_runtime = substream->private_data;
+	struct snd_soc_pcm_runtime *soc_runtime = asoc_substream_to_rtd(substream);
 
 	return snd_soc_dai_get_dma_data(asoc_rtd_to_cpu(soc_runtime, 0), substream);
 }
@@ -353,7 +353,7 @@ static void enable_intr(struct snd_pcm_substream *substream)
 
 static void disable_intr(struct snd_pcm_substream *substream)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct cygnus_aio_port *aio;
 	u32 set_mask;
 
@@ -581,7 +581,7 @@ static irqreturn_t cygnus_dma_irq(int irq, void *data)
 static int cygnus_pcm_open(struct snd_soc_component *component,
 			   struct snd_pcm_substream *substream)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct cygnus_aio_port *aio;
 	int ret;
@@ -618,7 +618,7 @@ static int cygnus_pcm_open(struct snd_soc_component *component,
 static int cygnus_pcm_close(struct snd_soc_component *component,
 			    struct snd_pcm_substream *substream)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct cygnus_aio_port *aio;
 
 	aio = cygnus_dai_get_dma_data(substream);
@@ -640,7 +640,7 @@ static int cygnus_pcm_hw_params(struct snd_soc_component *component,
 				struct snd_pcm_substream *substream,
 				struct snd_pcm_hw_params *params)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct cygnus_aio_port *aio;
 
@@ -656,7 +656,7 @@ static int cygnus_pcm_hw_params(struct snd_soc_component *component,
 static int cygnus_pcm_hw_free(struct snd_soc_component *component,
 			      struct snd_pcm_substream *substream)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct cygnus_aio_port *aio;
 
 	aio = cygnus_dai_get_dma_data(substream);
@@ -669,7 +669,7 @@ static int cygnus_pcm_hw_free(struct snd_soc_component *component,
 static int cygnus_pcm_prepare(struct snd_soc_component *component,
 			      struct snd_pcm_substream *substream)
 {
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct cygnus_aio_port *aio;
 	unsigned long bufsize, periodsize;
@@ -733,7 +733,7 @@ static snd_pcm_uframes_t cygnus_pcm_pointer(struct snd_soc_component *component,
 static int cygnus_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 {
 	struct snd_pcm_substream *substream = pcm->streams[stream].substream;
-	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
 	struct snd_dma_buffer *buf = &substream->dma_buffer;
 	size_t size;
 
-- 
2.25.1


  parent reply	other threads:[~2020-07-20  1:31 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-20  1:17 [PATCH 00/29] ASoC: add asoc_substream_to_rtd() macro Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 01/29] ASoC: soc-xxx: add asoc_substream_to_rtd() Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 02/29] ASoC: ux500: use asoc_substream_to_rtd() Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 03/29] ASoC: ti: " Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 04/29] ASoC: tegra: " Kuninori Morimoto
2020-07-20  1:17 ` [PATCH 05/29] ASoC: sunxi: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 06/29] ASoC: stm: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 07/29] ASoC: sof: " Kuninori Morimoto
2020-07-20 15:12   ` Pierre-Louis Bossart
2020-07-20  1:18 ` [PATCH 08/29] ASoC: sh: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 09/29] ASoC: samsung: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 10/29] ASoC: pxa: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 11/29] ASoC: cirrus: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 12/29] ASoC: rockchip: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 13/29] ASoC: amd: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 14/29] ASoC: fsl: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 15/29] ASoC: mediatek: " Kuninori Morimoto
2020-07-20  1:18 ` [PATCH 16/29] ASoC: atmel: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 17/29] ASoC: qcom: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 18/29] ASoC: dwc: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 19/29] ASoC: intel: " Kuninori Morimoto
2020-07-20 15:17   ` Pierre-Louis Bossart
2020-07-21  1:26     ` Kuninori Morimoto
2020-07-21 22:45       ` Mark Brown
2020-07-20  1:19 ` [PATCH 20/29] ASoC: meson: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 21/29] ASoC: au1x: " Kuninori Morimoto
2020-07-20  1:19 ` Kuninori Morimoto [this message]
2020-07-20  1:19 ` [PATCH 23/29] ASoC: codecs: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 24/29] ASoC: generic: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 25/29] ASoC: sprd: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 26/29] ASoC: kirkwood: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 27/29] ASoC: xtensa: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 28/29] ASoC: mxs: " Kuninori Morimoto
2020-07-20  1:19 ` [PATCH 29/29] ASoC: uniphier: " Kuninori Morimoto
2020-07-23 20:19 ` [PATCH 00/29] ASoC: add asoc_substream_to_rtd() macro Mark Brown

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=87365n0ysi.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.