From eba9e06f0ceb2ea3342e72577b244d8b02645396 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Sun, 16 Mar 2014 08:21:34 +0400 Subject: [PATCH 01/12] ASoC: fsl: Separation of the main audio options and boards This patch provide separation of the main audio options and boards. Signed-off-by: Alexander Shiyan Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 338a91642471..0b4315d5af77 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -1,3 +1,5 @@ +menu "SoC Audio for Freescale CPUs" + config SND_SOC_FSL_SAI tristate select REGMAP_MMIO @@ -18,13 +20,27 @@ config SND_SOC_FSL_ESAI config SND_SOC_FSL_UTILS tristate -menuconfig SND_POWERPC_SOC +config SND_SOC_IMX_PCM_DMA + tristate + select SND_SOC_GENERIC_DMAENGINE_PCM + +config SND_SOC_IMX_AUDMUX + tristate + +config SND_POWERPC_SOC tristate "SoC Audio for Freescale PowerPC CPUs" depends on FSL_SOC || PPC_MPC52xx help Say Y or M if you want to add support for codecs attached to the PowerPC CPUs. +config SND_IMX_SOC + tristate "SoC Audio for Freescale i.MX CPUs" + depends on ARCH_MXC || COMPILE_TEST + help + Say Y or M if you want to add support for codecs attached to + the i.MX CPUs. + if SND_POWERPC_SOC config SND_MPC52xx_DMA @@ -33,6 +49,8 @@ config SND_MPC52xx_DMA config SND_SOC_POWERPC_DMA tristate +comment "SoC Audio support for Freescale PPC boards:" + config SND_SOC_MPC8610_HPCD tristate "ALSA SoC support for the Freescale MPC8610 HPCD board" # I2C is necessary for the CS4270 driver @@ -110,13 +128,6 @@ config SND_MPC52xx_SOC_EFIKA endif # SND_POWERPC_SOC -menuconfig SND_IMX_SOC - tristate "SoC Audio for Freescale i.MX CPUs" - depends on ARCH_MXC || COMPILE_TEST - help - Say Y or M if you want to add support for codecs attached to - the i.MX CPUs. - if SND_IMX_SOC config SND_SOC_IMX_SSI @@ -127,12 +138,7 @@ config SND_SOC_IMX_PCM_FIQ tristate select FIQ -config SND_SOC_IMX_PCM_DMA - tristate - select SND_SOC_GENERIC_DMAENGINE_PCM - -config SND_SOC_IMX_AUDMUX - tristate +comment "SoC Audio support for Freescale i.MX boards:" config SND_MXC_SOC_WM1133_EV1 tristate "Audio on the i.MX31ADS with WM1133-EV1 fitted" @@ -225,3 +231,5 @@ config SND_SOC_IMX_MC13783 select SND_SOC_IMX_PCM_DMA endif # SND_IMX_SOC + +endmenu From 204dec93eaaba3a7afdc09aa3c3f6d08c773a367 Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Sun, 16 Mar 2014 08:21:35 +0400 Subject: [PATCH 02/12] ASoC: fsl: Allow to select individual common options This patch allow to select individual common sound options and as a result allow using sound cards/codecs based on DT description. Signed-off-by: Alexander Shiyan Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 0b4315d5af77..7a7eaf32158f 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -1,16 +1,28 @@ menu "SoC Audio for Freescale CPUs" +comment "Common SoC Audio options for Freescale CPUs:" + config SND_SOC_FSL_SAI tristate select REGMAP_MMIO select SND_SOC_GENERIC_DMAENGINE_PCM config SND_SOC_FSL_SSI - tristate + tristate "Synchronous Serial Interface module support" + help + Say Y if you want to add Synchronous Serial Interface (SSI) + support for the Freescale CPUs. + This option is only useful for out-of-tree drivers since + in-tree drivers select it automatically. config SND_SOC_FSL_SPDIF - tristate + tristate "Sony/Philips Digital Interface module support" select REGMAP_MMIO + help + Say Y if you want to add Sony/Philips Digital Interface (SPDIF) + support for the Freescale CPUs. + This option is only useful for out-of-tree drivers since + in-tree drivers select it automatically. config SND_SOC_FSL_ESAI tristate @@ -25,7 +37,12 @@ config SND_SOC_IMX_PCM_DMA select SND_SOC_GENERIC_DMAENGINE_PCM config SND_SOC_IMX_AUDMUX - tristate + tristate "Digital Audio Mux module support" + help + Say Y if you want to add Digital Audio Mux (AUDMUX) support + for the ARM i.MX CPUs. + This option is only useful for out-of-tree drivers since + in-tree drivers select it automatically. config SND_POWERPC_SOC tristate "SoC Audio for Freescale PowerPC CPUs" From 3e185238a37d1f0a37a1d910344cdcff578bf333 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Fri, 4 Apr 2014 15:10:26 +0800 Subject: [PATCH 03/12] ASoC: esai: use the precise definition of 'ret'. Use the precise definition of 'ret', which will be used for the error check. Signed-off-by: Xiubo Li Acked-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_esai.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index c8e5db1414d7..67d5417e0933 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -209,8 +209,9 @@ static int fsl_esai_set_dai_sysclk(struct snd_soc_dai *dai, int clk_id, struct clk *clksrc = esai_priv->extalclk; bool tx = clk_id <= ESAI_HCKT_EXTAL; bool in = dir == SND_SOC_CLOCK_IN; - u32 ret, ratio, ecr = 0; + u32 ratio, ecr = 0; unsigned long clk_rate; + int ret; /* sck_div can be only bypassed if ETO/ERO=0 and SNC_SOC_CLOCK_OUT */ esai_priv->sck_div[tx] = true; @@ -432,8 +433,8 @@ static int fsl_esai_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt) static int fsl_esai_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { - int ret; struct fsl_esai *esai_priv = snd_soc_dai_get_drvdata(dai); + int ret; /* * Some platforms might use the same bit to gate all three or two of @@ -491,7 +492,8 @@ static int fsl_esai_hw_params(struct snd_pcm_substream *substream, bool tx = substream->stream == SNDRV_PCM_STREAM_PLAYBACK; u32 width = snd_pcm_format_width(params_format(params)); u32 channels = params_channels(params); - u32 bclk, mask, val, ret; + u32 bclk, mask, val; + int ret; bclk = params_rate(params) * esai_priv->slot_width * 2; From add180ed780e9031d65e7c94cad936e719401acf Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Fri, 4 Apr 2014 15:10:27 +0800 Subject: [PATCH 04/12] ASoC: spdif: Sort the header files alphabetically. Signed-off-by: Xiubo Li Acked-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_spdif.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 6452ca83d889..173553c6dc55 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -13,18 +13,18 @@ * kind, whether express or implied. */ -#include +#include #include #include -#include -#include +#include #include #include #include +#include #include -#include #include +#include #include "fsl_spdif.h" #include "imx-pcm.h" From b21cc2f5fdfe22429501cd7040db0b2b2a9b29de Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Fri, 4 Apr 2014 15:10:28 +0800 Subject: [PATCH 05/12] ASoC: esai: Add VF610+ compatibles support. Signed-off-by: Xiubo Li Acked-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_esai.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl_esai.c b/sound/soc/fsl/fsl_esai.c index 67d5417e0933..b49b78df2f5b 100644 --- a/sound/soc/fsl/fsl_esai.c +++ b/sound/soc/fsl/fsl_esai.c @@ -818,6 +818,7 @@ static int fsl_esai_probe(struct platform_device *pdev) static const struct of_device_id fsl_esai_dt_ids[] = { { .compatible = "fsl,imx35-esai", }, + { .compatible = "fsl,vf610-esai", }, {} }; MODULE_DEVICE_TABLE(of, fsl_esai_dt_ids); From 1014fad0fca91181acc68396d84573e4ae301380 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Fri, 4 Apr 2014 15:10:29 +0800 Subject: [PATCH 06/12] ASoC: spdif: Add VF610+ compatibles support. Signed-off-by: Xiubo Li Acked-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_spdif.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl_spdif.c b/sound/soc/fsl/fsl_spdif.c index 173553c6dc55..daa6198ae41f 100644 --- a/sound/soc/fsl/fsl_spdif.c +++ b/sound/soc/fsl/fsl_spdif.c @@ -1186,6 +1186,7 @@ static int fsl_spdif_probe(struct platform_device *pdev) static const struct of_device_id fsl_spdif_dt_ids[] = { { .compatible = "fsl,imx35-spdif", }, + { .compatible = "fsl,vf610-spdif", }, {} }; MODULE_DEVICE_TABLE(of, fsl_spdif_dt_ids); From 9c72a04ca78606bf10211efa93b3332c710afc65 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Tue, 15 Apr 2014 12:02:02 +0100 Subject: [PATCH 07/12] ASoC: fsl: Add explicit include of of.h Hopefully fixing a build failure reported by Stephen Rothwell - though quite why the other OF headers don't include this as well I'm not sure. Signed-off-by: Mark Brown --- sound/soc/fsl/fsl_ssi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c index 5428a1fda260..2fbbd8416c00 100644 --- a/sound/soc/fsl/fsl_ssi.c +++ b/sound/soc/fsl/fsl_ssi.c @@ -40,6 +40,7 @@ #include #include #include +#include #include #include #include From e9ffb5ba4de17f14ca592e06a397c85541a72c7d Mon Sep 17 00:00:00 2001 From: Nicolin Chen Date: Thu, 24 Apr 2014 19:33:07 +0800 Subject: [PATCH 08/12] ASoC: fsl: Drop formats limitation for imx-pcm-dma.c Now ASoC core is getting the intersection of supported formats not only from CPU and CODEC dai's but also from DMA's. However, there should be no specific width limitation from SDMA side. So drop it. Otherwise, we would only support S16_LE format for all i.MX platforms. Signed-off-by: Nicolin Chen Signed-off-by: Mark Brown --- sound/soc/fsl/imx-pcm-dma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/sound/soc/fsl/imx-pcm-dma.c b/sound/soc/fsl/imx-pcm-dma.c index 2585ae44e634..0849b7b83f0a 100644 --- a/sound/soc/fsl/imx-pcm-dma.c +++ b/sound/soc/fsl/imx-pcm-dma.c @@ -40,7 +40,6 @@ static const struct snd_pcm_hardware imx_pcm_hardware = { SNDRV_PCM_INFO_MMAP_VALID | SNDRV_PCM_INFO_PAUSE | SNDRV_PCM_INFO_RESUME, - .formats = SNDRV_PCM_FMTBIT_S16_LE, .buffer_bytes_max = IMX_SSI_DMABUF_SIZE, .period_bytes_min = 128, .period_bytes_max = 65535, /* Limited by SDMA engine */ From b71fc4e6c9eb1b5ce1c0861825835da273367104 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 30 Apr 2014 18:10:05 +0800 Subject: [PATCH 09/12] ASoC: fsl: Allow to select SAI device individually This will be useful for out-of-tree drivers since in-tree drivers could select it automatically. Signed-off-by: Xiubo Li Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 7a7eaf32158f..fb73e358b552 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -3,9 +3,14 @@ menu "SoC Audio for Freescale CPUs" comment "Common SoC Audio options for Freescale CPUs:" config SND_SOC_FSL_SAI - tristate + tristate "Synchronous Audio Interface (SAI) module support" select REGMAP_MMIO select SND_SOC_GENERIC_DMAENGINE_PCM + help + Say Y if you want to add Synchronous Audio Interface (SAI) + support for the Freescale CPUs. + This option is only useful for out-of-tree drivers since + in-tree drivers select it automatically. config SND_SOC_FSL_SSI tristate "Synchronous Serial Interface module support" From 40e3b934be0e0e04da3b56093958389d5c325c18 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 30 Apr 2014 18:10:06 +0800 Subject: [PATCH 10/12] ASoC: fsl: Allow to select ESAI device individually This will be useful for out-of-tree drivers since in-tree drivers could select it automatically. Signed-off-by: Xiubo Li Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index fb73e358b552..0a118265c31e 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -30,9 +30,14 @@ config SND_SOC_FSL_SPDIF in-tree drivers select it automatically. config SND_SOC_FSL_ESAI - tristate + tristate "Enhanced Serial Audio Interface (ESAI) module support" select REGMAP_MMIO select SND_SOC_FSL_UTILS + help + Say Y if you want to add Enhanced Synchronous Audio Interface + (ESAI) support for the Freescale CPUs. + This option is only useful for out-of-tree drivers since + in-tree drivers select it automatically. config SND_SOC_FSL_UTILS tristate From 31ee2bfd724ab1fa2fba6472a071bca5e9132139 Mon Sep 17 00:00:00 2001 From: Arnd Bergmann Date: Tue, 29 Apr 2014 21:36:22 +0200 Subject: [PATCH 11/12] ASoC: fsl: select SND_SOC_IMX_PCM_DMA where needed Since commit 204dec93eaa "ASoC: fsl: Allow to select individual common options", it is possible to enable SND_SOC_FSL_SSI and SND_SOC_FSL_SPDIF manually, either as loadable modules or built-in. This unfortunately leads to a link error if one or both of them are built-in, while the imx-pcm-dma framework is a loadable module: sound/built-in.o: In function `fsl_ssi_probe': :(.text+0x51fb8): undefined reference to `imx_pcm_dma_init' sound/built-in.o: In function `fsl_spdif_probe': :(.text+0x52e20): undefined reference to `imx_pcm_dma_init' This changes Kconfig to prevent this case by using 'select' to turn on the imx-pcm-dma code from both drivers. For consistency, we also turn on the imx-pcm-fiq code, which is an alternative to the dma implementation. Note that imx-pcm-fiq is platform dependent, so we must not enable that unless we are building a kernel for i.MX. Note also the "if SND_IMX_SOC != n" syntax as opposed to the normal "if SND_IMX_SOC". This is needed to avoid turning on the options as 'm' if 'SND_IMX_SOC' is a module. Signed-off-by: Arnd Bergmann Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 0a118265c31e..807448ceef96 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -14,6 +14,8 @@ config SND_SOC_FSL_SAI config SND_SOC_FSL_SSI tristate "Synchronous Serial Interface module support" + select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n + select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n && ARCH_MXC help Say Y if you want to add Synchronous Serial Interface (SSI) support for the Freescale CPUs. @@ -23,6 +25,8 @@ config SND_SOC_FSL_SSI config SND_SOC_FSL_SPDIF tristate "Sony/Philips Digital Interface module support" select REGMAP_MMIO + select SND_SOC_IMX_PCM_DMA if SND_IMX_SOC != n + select SND_SOC_IMX_PCM_FIQ if SND_IMX_SOC != n && ARCH_MXC help Say Y if you want to add Sony/Philips Digital Interface (SPDIF) support for the Freescale CPUs. From 7b8751abdd34a2f924c37c29ad61d598f5d29e7b Mon Sep 17 00:00:00 2001 From: Alexander Shiyan Date: Fri, 23 May 2014 15:11:01 +0400 Subject: [PATCH 12/12] ASoC: fsl: Remove dependencies of boards for SND_SOC_EUKREA_TLV320 Eukrea-i.MX51 board was converted to use DT, ie we no longer have a MACH_EUKREA_MBIMXSD51_BASEBOARD symbol. Transformation of other boards planned for the near future, so this patch removes all these dependencies and restricts build of this driver to ARCH_MXC. Signed-off-by: Alexander Shiyan Signed-off-by: Mark Brown --- sound/soc/fsl/Kconfig | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/sound/soc/fsl/Kconfig b/sound/soc/fsl/Kconfig index 807448ceef96..f26a2dd698b5 100644 --- a/sound/soc/fsl/Kconfig +++ b/sound/soc/fsl/Kconfig @@ -207,12 +207,7 @@ config SND_SOC_PHYCORE_AC97 config SND_SOC_EUKREA_TLV320 tristate "Eukrea TLV320" - depends on MACH_EUKREA_MBIMX27_BASEBOARD \ - || MACH_EUKREA_MBIMXSD25_BASEBOARD \ - || MACH_EUKREA_MBIMXSD35_BASEBOARD \ - || MACH_EUKREA_MBIMXSD51_BASEBOARD \ - || (OF && ARM) - depends on I2C + depends on ARCH_MXC && I2C select SND_SOC_TLV320AIC23_I2C select SND_SOC_IMX_AUDMUX select SND_SOC_IMX_SSI