alsa-devel.alsa-project.org archive mirror
 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: [alsa-devel] [PATCH 14/44] ASoC: xilinx: xlnx_formatter_pcm: remove snd_pcm_ops
Date: 02 Oct 2019 14:32:29 +0900	[thread overview]
Message-ID: <87bluzaf0y.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87v9t7af54.wl-kuninori.morimoto.gx@renesas.com>


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

snd_pcm_ops is no longer needed.
Let's use component driver callback.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 sound/soc/xilinx/xlnx_formatter_pcm.c | 54 +++++++++++++++--------------------
 1 file changed, 23 insertions(+), 31 deletions(-)

diff --git a/sound/soc/xilinx/xlnx_formatter_pcm.c b/sound/soc/xilinx/xlnx_formatter_pcm.c
index fb652e7..296c4ca 100644
--- a/sound/soc/xilinx/xlnx_formatter_pcm.c
+++ b/sound/soc/xilinx/xlnx_formatter_pcm.c
@@ -313,16 +313,14 @@ static irqreturn_t xlnx_s2mm_irq_handler(int irq, void *arg)
 	return IRQ_NONE;
 }
 
-static int xlnx_formatter_pcm_open(struct snd_pcm_substream *substream)
+static int xlnx_formatter_pcm_open(struct snd_soc_component *component,
+				   struct snd_pcm_substream *substream)
 {
 	int err;
 	u32 val, data_format_mode;
 	u32 ch_count_mask, ch_count_shift, data_xfer_mode, data_xfer_shift;
 	struct xlnx_pcm_stream_param *stream_data;
 	struct snd_pcm_runtime *runtime = substream->runtime;
-	struct snd_soc_pcm_runtime *prtd = substream->private_data;
-	struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd,
-								    DRV_NAME);
 	struct xlnx_pcm_drv_data *adata = dev_get_drvdata(component->dev);
 
 	if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
@@ -387,14 +385,12 @@ static int xlnx_formatter_pcm_open(struct snd_pcm_substream *substream)
 	return 0;
 }
 
-static int xlnx_formatter_pcm_close(struct snd_pcm_substream *substream)
+static int xlnx_formatter_pcm_close(struct snd_soc_component *component,
+				    struct snd_pcm_substream *substream)
 {
 	int ret;
 	struct xlnx_pcm_stream_param *stream_data =
 			substream->runtime->private_data;
-	struct snd_soc_pcm_runtime *prtd = substream->private_data;
-	struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd,
-								    DRV_NAME);
 
 	ret = xlnx_formatter_pcm_reset(stream_data->mmio);
 	if (ret) {
@@ -409,7 +405,8 @@ static int xlnx_formatter_pcm_close(struct snd_pcm_substream *substream)
 }
 
 static snd_pcm_uframes_t
-xlnx_formatter_pcm_pointer(struct snd_pcm_substream *substream)
+xlnx_formatter_pcm_pointer(struct snd_soc_component *component,
+			   struct snd_pcm_substream *substream)
 {
 	u32 pos;
 	struct snd_pcm_runtime *runtime = substream->runtime;
@@ -423,16 +420,14 @@ xlnx_formatter_pcm_pointer(struct snd_pcm_substream *substream)
 	return bytes_to_frames(runtime, pos);
 }
 
-static int xlnx_formatter_pcm_hw_params(struct snd_pcm_substream *substream,
+static int xlnx_formatter_pcm_hw_params(struct snd_soc_component *component,
+					struct snd_pcm_substream *substream,
 					struct snd_pcm_hw_params *params)
 {
 	u32 low, high, active_ch, val, bytes_per_ch, bits_per_sample;
 	u32 aes_reg1_val, aes_reg2_val;
 	int status;
 	u64 size;
-	struct snd_soc_pcm_runtime *prtd = substream->private_data;
-	struct snd_soc_component *component = snd_soc_rtdcom_lookup(prtd,
-								    DRV_NAME);
 	struct snd_pcm_runtime *runtime = substream->runtime;
 	struct xlnx_pcm_stream_param *stream_data = runtime->private_data;
 
@@ -500,12 +495,14 @@ static int xlnx_formatter_pcm_hw_params(struct snd_pcm_substream *substream,
 	return 0;
 }
 
-static int xlnx_formatter_pcm_hw_free(struct snd_pcm_substream *substream)
+static int xlnx_formatter_pcm_hw_free(struct snd_soc_component *component,
+				      struct snd_pcm_substream *substream)
 {
 	return snd_pcm_lib_free_pages(substream);
 }
 
-static int xlnx_formatter_pcm_trigger(struct snd_pcm_substream *substream,
+static int xlnx_formatter_pcm_trigger(struct snd_soc_component *component,
+				      struct snd_pcm_substream *substream,
 				      int cmd)
 {
 	u32 val;
@@ -532,10 +529,9 @@ static int xlnx_formatter_pcm_trigger(struct snd_pcm_substream *substream,
 	return 0;
 }
 
-static int xlnx_formatter_pcm_new(struct snd_soc_pcm_runtime *rtd)
+static int xlnx_formatter_pcm_new(struct snd_soc_component *component,
+				  struct snd_soc_pcm_runtime *rtd)
 {
-	struct snd_soc_component *component = snd_soc_rtdcom_lookup(rtd,
-								    DRV_NAME);
 	snd_pcm_lib_preallocate_pages_for_all(rtd->pcm,
 			SNDRV_DMA_TYPE_DEV, component->dev,
 			xlnx_pcm_hardware.buffer_bytes_max,
@@ -543,20 +539,16 @@ static int xlnx_formatter_pcm_new(struct snd_soc_pcm_runtime *rtd)
 	return 0;
 }
 
-static const struct snd_pcm_ops xlnx_formatter_pcm_ops = {
-	.open = xlnx_formatter_pcm_open,
-	.close = xlnx_formatter_pcm_close,
-	.ioctl = snd_pcm_lib_ioctl,
-	.hw_params = xlnx_formatter_pcm_hw_params,
-	.hw_free = xlnx_formatter_pcm_hw_free,
-	.trigger = xlnx_formatter_pcm_trigger,
-	.pointer = xlnx_formatter_pcm_pointer,
-};
-
 static const struct snd_soc_component_driver xlnx_asoc_component = {
-	.name = DRV_NAME,
-	.ops = &xlnx_formatter_pcm_ops,
-	.pcm_new = xlnx_formatter_pcm_new,
+	.name		= DRV_NAME,
+	.open		= xlnx_formatter_pcm_open,
+	.close		= xlnx_formatter_pcm_close,
+	.ioctl		= snd_soc_pcm_lib_ioctl,
+	.hw_params	= xlnx_formatter_pcm_hw_params,
+	.hw_free	= xlnx_formatter_pcm_hw_free,
+	.trigger	= xlnx_formatter_pcm_trigger,
+	.pointer	= xlnx_formatter_pcm_pointer,
+	.pcm_construct	= xlnx_formatter_pcm_new,
 };
 
 static int xlnx_formatter_pcm_probe(struct platform_device *pdev)
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2019-10-02  6:17 UTC|newest]

Thread overview: 90+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-02  5:29 [alsa-devel] [PATCH 00/44] ASoC: don't use snd_pcm_ops Kuninori Morimoto
2019-10-02  5:30 ` [alsa-devel] [PATCH 01/44] ASoC: soc-core: merge snd_pcm_ops member to component driver Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-core: merge snd_pcm_ops member to component driver" to the asoc tree Mark Brown
2019-10-02  5:30 ` [alsa-devel] [PATCH 02/44] ASoC: soc-core: add new pcm_construct/pcm_destruct Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-core: add new pcm_construct/pcm_destruct" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 03/44] ASoC: soc-core: add snd_soc_pcm_lib_ioctl() Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-core: add snd_soc_pcm_lib_ioctl()" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 04/44] ASoC: intel: sst-haswell-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: intel: sst-haswell-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 05/44] ASoC: intel: skl-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: intel: skl-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 06/44] ASoC: intel: sst-mfld-platform-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: intel: sst-mfld-platform-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 07/44] ASoC: intel: sst-baytrail-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: intel: sst-baytrail-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 08/44] ASoC: amd: acp3x-pcm-dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: amd: acp3x-pcm-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:31 ` [alsa-devel] [PATCH 09/44] ASoC: amd: acp-pcm-dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: amd: acp-pcm-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 10/44] ASoC: atmel: atmel-pcm-pdc: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: atmel: atmel-pcm-pdc: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 11/44] ASoC: au1x: dbdma2: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: au1x: dbdma2: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 12/44] ASoC: au1x: dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: au1x: dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 13/44] ASoC: xtensa: xtfpga-i2s: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: xtensa: xtfpga-i2s: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` Kuninori Morimoto [this message]
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: xilinx: xlnx_formatter_pcm: " Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 14/44] ASoC: xilinx: xlnx_formatter_pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-02  5:32 ` [alsa-devel] [PATCH 15/44] ASoC: uniphier: aio-dma: " Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: uniphier: aio-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 16/44] ASoC: txx9: txx9aclc: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: txx9: txx9aclc: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 17/44] ASoC: stm: stm32_adfsdm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: stm: stm32_adfsdm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 18/44] ASoC: sprd: sprd-pcm-dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sprd: sprd-pcm-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:32 ` [alsa-devel] [PATCH 19/44] ASoC: sof: pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sof: pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 20/44] ASoC: sh: rsnd: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sh: rsnd: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 21/44] ASoC: sh: fsi: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sh: fsi: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 22/44] ASoC: sh: dma-sh7760: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sh: dma-sh7760: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 23/44] ASoC: sh: siu_pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: sh: siu_pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 24/44] ASoC: samsung: idma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: samsung: idma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 25/44] ASoC: qcom: lpass-platform: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: qcom: lpass-platform: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 26/44] ASoC: qcom: q6routing: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: qcom: q6routing: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 27/44] ASoC: qcom: q6asm-dai: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: qcom: q6asm-dai: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 28/44] ASoC: pxa: mmp-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: pxa: mmp-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 29/44] ASoC: pxa: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: pxa: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:33 ` [alsa-devel] [PATCH 30/44] ASoC: meson: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: meson: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 31/44] ASoC: mediatek: mtk-btcvsd: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: mediatek: mtk-btcvsd: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 32/44] ASoC: mediatek: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: mediatek: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 33/44] ASoC: kirkwood: kirkwood-dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: kirkwood: kirkwood-dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 34/44] ASoC: dwc: dwc-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: dwc: dwc-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 35/44] ASoC: rt5514-spi: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: rt5514-spi: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 36/44] ASoC: bcm: cygnus-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: bcm: cygnus-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 37/44] ASoC: fsl: imx-pcm-fiq: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: imx-pcm-fiq: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 38/44] ASoC: fsl: fsl_dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: fsl_dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 39/44] ASoC: fsl: mpc5200_dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: mpc5200_dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 40/44] ASoC: fsl: fsl_asrc_dma: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: fsl_asrc_dma: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:34 ` [alsa-devel] [PATCH 41/44] ASoC: fsl: fsl_dma: don't use snd_soc_rtdcom_lookup() Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: fsl: fsl_dma: don't use snd_soc_rtdcom_lookup()" to the asoc tree Mark Brown
2019-10-02  5:35 ` [alsa-devel] [PATCH 42/44] ASoC: soc-generic-dmaengine-pcm: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-generic-dmaengine-pcm: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:35 ` [alsa-devel] [PATCH 43/44] ASoC: soc-utils: remove snd_pcm_ops Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-utils: remove snd_pcm_ops" to the asoc tree Mark Brown
2019-10-02  5:35 ` [alsa-devel] [PATCH 44/44] ASoC: soc-component: remove snd_pcm_ops from component driver Kuninori Morimoto
2019-10-08 12:53   ` [alsa-devel] Applied "ASoC: soc-component: remove snd_pcm_ops from component driver" to the asoc tree 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=87bluzaf0y.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).