mbox series

[00/44] ASoC: don't use snd_pcm_ops

Message ID 87v9t7af54.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
Headers show
Series ASoC: don't use snd_pcm_ops | expand

Message

Kuninori Morimoto Oct. 2, 2019, 5:29 a.m. UTC
Hi Mark

Current snd_soc_component_driver is using snd_pcm_ops.
But, it is mainly for ALSA, thus, it not good much to ALSA SoC.

For example .open case (1)(2),
each callback can't know it is called for which component.
Thus, it need to use using snd_soc_rtdcom_lookup() (3).

	--- ALSA SoC  ---
	...
	if (component->driver->ops &&
	    component->driver->ops->open)
(1)		return component->driver->ops->open(substream);
	...

	--- driver ---
(2)	static int xxx_open(struct snd_pcm_substream *substream)
	{
		struct snd_soc_pcm_runtime *rtd = substream->private_data;
(3)		struct snd_soc_component *component = snd_soc_rtdcom_lookup(..);
		...
	}

It works today, but, will not work in the future if we support multi
CPU/Codec/Platform, because 1 rtd might have multiple components which
have same driver name.
In other words snd_soc_rtdcom_lookup() doesn't work correctly in the future.

To solve this issue, each callback needs to be called with component.
This patch copies each snd_pcm_ops member under component driver,
and having "component" as parameter.

	--- ALSA SoC  ---
	...
	if (component->driver->open)
=>		return component->driver->open(component, substream);
	...

	--- driver ---
=>	static int xxx_open(struct snd_soc_component *component,
			    struct snd_pcm_substream *substream)
	{
		...
	}


Kuninori Morimoto (44):
  ASoC: soc-core: merge snd_pcm_ops member to component driver
  ASoC: soc-core: add new pcm_construct/pcm_destruct
  ASoC: soc-core: add snd_soc_pcm_lib_ioctl()
  ASoC: intel: sst-haswell-pcm: remove snd_pcm_ops
  ASoC: intel: skl-pcm: remove snd_pcm_ops
  ASoC: intel: sst-mfld-platform-pcm: remove snd_pcm_ops
  ASoC: intel: sst-baytrail-pcm: remove snd_pcm_ops
  ASoC: amd: acp3x-pcm-dma: remove snd_pcm_ops
  ASoC: amd: acp-pcm-dma: remove snd_pcm_ops
  ASoC: atmel: atmel-pcm-pdc: remove snd_pcm_ops
  ASoC: au1x: dbdma2: remove snd_pcm_ops
  ASoC: au1x: dma: remove snd_pcm_ops
  ASoC: xtensa: xtfpga-i2s: remove snd_pcm_ops
  ASoC: xilinx: xlnx_formatter_pcm: remove snd_pcm_ops
  ASoC: uniphier: aio-dma: remove snd_pcm_ops
  ASoC: txx9: txx9aclc: remove snd_pcm_ops
  ASoC: stm: stm32_adfsdm: remove snd_pcm_ops
  ASoC: sprd: sprd-pcm-dma: remove snd_pcm_ops
  ASoC: sof: pcm: remove snd_pcm_ops
  ASoC: sh: rsnd: remove snd_pcm_ops
  ASoC: sh: fsi: remove snd_pcm_ops
  ASoC: sh: dma-sh7760: remove snd_pcm_ops
  ASoC: sh: siu_pcm: remove snd_pcm_ops
  ASoC: samsung: idma: remove snd_pcm_ops
  ASoC: qcom: lpass-platform: remove snd_pcm_ops
  ASoC: qcom: q6routing: remove snd_pcm_ops
  ASoC: qcom: q6asm-dai: remove snd_pcm_ops
  ASoC: pxa: mmp-pcm: remove snd_pcm_ops
  ASoC: pxa: remove snd_pcm_ops
  ASoC: meson: remove snd_pcm_ops
  ASoC: mediatek: mtk-btcvsd: remove snd_pcm_ops
  ASoC: mediatek: remove snd_pcm_ops
  ASoC: kirkwood: kirkwood-dma: remove snd_pcm_ops
  ASoC: dwc: dwc-pcm: remove snd_pcm_ops
  ASoC: rt5514-spi: remove snd_pcm_ops
  ASoC: bcm: cygnus-pcm: remove snd_pcm_ops
  ASoC: fsl: imx-pcm-fiq: remove snd_pcm_ops
  ASoC: fsl: fsl_dma: remove snd_pcm_ops
  ASoC: fsl: mpc5200_dma: remove snd_pcm_ops
  ASoC: fsl: fsl_asrc_dma: remove snd_pcm_ops
  ASoC: fsl: fsl_dma: don't use snd_soc_rtdcom_lookup()
  ASoC: soc-generic-dmaengine-pcm: remove snd_pcm_ops
  ASoC: soc-utils: remove snd_pcm_ops
  ASoC: soc-component: remove snd_pcm_ops from component driver

 include/sound/pxa2xx-lib.h                         |  26 +++++-
 include/sound/soc-component.h                      |  41 ++++++++-
 include/sound/soc.h                                |   5 +
 sound/arm/pxa2xx-pcm-lib.c                         |  80 +++++++++++++---
 sound/soc/amd/acp-pcm-dma.c                        |  63 ++++++-------
 sound/soc/amd/raven/acp3x-pcm-dma.c                |  54 +++++------
 sound/soc/atmel/atmel-pcm-pdc.c                    |  48 +++++-----
 sound/soc/au1x/dbdma2.c                            |  64 +++++++------
 sound/soc/au1x/dma.c                               |  63 +++++++------
 sound/soc/bcm/cygnus-pcm.c                         |  56 +++++------
 sound/soc/codecs/rt5514-spi.c                      |  41 +++++----
 sound/soc/dwc/dwc-pcm.c                            |  48 +++++-----
 sound/soc/fsl/fsl_asrc_dma.c                       |  56 +++++------
 sound/soc/fsl/fsl_dma.c                            |  53 +++++------
 sound/soc/fsl/imx-pcm-fiq.c                        |  56 ++++++-----
 sound/soc/fsl/mpc5200_dma.c                        |  51 ++++++-----
 sound/soc/intel/atom/sst-mfld-platform-pcm.c       |  30 +++---
 sound/soc/intel/baytrail/sst-baytrail-pcm.c        |  52 +++++------
 sound/soc/intel/haswell/sst-haswell-pcm.c          |  62 +++++++------
 sound/soc/intel/skylake/skl-pcm.c                  |  67 +++++++++-----
 sound/soc/kirkwood/kirkwood-dma.c                  |  50 +++++-----
 .../soc/mediatek/common/mtk-afe-platform-driver.c  |  28 +++---
 .../soc/mediatek/common/mtk-afe-platform-driver.h  |  10 +-
 sound/soc/mediatek/common/mtk-btcvsd.c             |  76 ++++++---------
 sound/soc/mediatek/mt6797/mt6797-afe-pcm.c         |  11 ++-
 sound/soc/mediatek/mt8183/mt8183-afe-pcm.c         |  11 ++-
 sound/soc/meson/axg-fifo.c                         |  56 +++++------
 sound/soc/meson/axg-fifo.h                         |  20 +++-
 sound/soc/meson/axg-frddr.c                        |  24 ++++-
 sound/soc/meson/axg-toddr.c                        |  24 ++++-
 sound/soc/pxa/mmp-pcm.c                            |  62 ++++++++-----
 sound/soc/pxa/pxa-ssp.c                            |  14 ++-
 sound/soc/pxa/pxa2xx-ac97.c                        |  14 ++-
 sound/soc/pxa/pxa2xx-i2s.c                         |  14 ++-
 sound/soc/pxa/pxa2xx-pcm.c                         |  14 ++-
 sound/soc/qcom/lpass-platform.c                    |  70 +++++++-------
 sound/soc/qcom/qdsp6/q6asm-dai.c                   |  71 +++++++-------
 sound/soc/qcom/qdsp6/q6routing.c                   |  14 +--
 sound/soc/samsung/idma.c                           |  58 ++++++------
 sound/soc/sh/dma-sh7760.c                          |  46 +++++-----
 sound/soc/sh/fsi.c                                 |  31 ++++---
 sound/soc/sh/rcar/core.c                           |  23 +++--
 sound/soc/sh/siu_pcm.c                             |  44 +++++----
 sound/soc/soc-component.c                          |  76 +++++++--------
 sound/soc/soc-core.c                               |  12 +++
 sound/soc/soc-generic-dmaengine-pcm.c              | 102 ++++++++++-----------
 sound/soc/soc-pcm.c                                |  11 +--
 sound/soc/soc-utils.c                              |  11 +--
 sound/soc/sof/pcm.c                                |  88 +++++++++---------
 sound/soc/sprd/sprd-pcm-dma.c                      |  74 +++++++--------
 sound/soc/stm/stm32_adfsdm.c                       |  42 +++++----
 sound/soc/txx9/txx9aclc.c                          |  48 +++++-----
 sound/soc/uniphier/aio-dma.c                       |  51 ++++++-----
 sound/soc/xilinx/xlnx_formatter_pcm.c              |  54 +++++------
 sound/soc/xtensa/xtfpga-i2s.c                      |  30 +++---
 55 files changed, 1311 insertions(+), 1089 deletions(-)