Skip to contentSkip to conversation

ASoC: Add a new imx-ssi sound driver

PATCH In review Mark Brown 4 participants 14 messages Jan 8, 2010 – Jan 11, 2010

Subsystems (5)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

PATCH 1/4 ASoC: Add a new imx-ssi sound driver

From: Sascha Hauer <[email protected]>

The old driver has the number of SSI units in the system hardcoded, does not make use of the device model and works only on i.MX21/27.

This driver replaces it. It works in DMA mode on i.MX21/27 and using an FIQ handler on other systems. It also supports AC97 mode of the SSI units.

---
 arch/arm/plat-mxc/Makefile       |    6 +
 arch/arm/plat-mxc/ssi-fiq-ksym.c |   20 +
 arch/arm/plat-mxc/ssi-fiq.S      |  134 +++++++
 sound/soc/imx/Kconfig            |   20 +-
 sound/soc/imx/Makefile           |   12 +-
 sound/soc/imx/imx-pcm-dma-mx2.c  |  313 ++++++++++++++++
 sound/soc/imx/imx-pcm-fiq.c      |  277 ++++++++++++++
 sound/soc/imx/imx-ssi.c          |  762 ++++++++++++++++++++++++++++++++++++++
 sound/soc/imx/imx-ssi.h          |  238 ++++++++++++
 9 files changed, 1762 insertions(+), 20 deletions(-)
 create mode 100644 arch/arm/plat-mxc/ssi-fiq-ksym.c
 create mode 100644 arch/arm/plat-mxc/ssi-fiq.S
 create mode 100644 sound/soc/imx/imx-pcm-dma-mx2.c
 create mode 100644 sound/soc/imx/imx-pcm-fiq.c
 create mode 100644 sound/soc/imx/imx-ssi.c
 create mode 100644 sound/soc/imx/imx-ssi.h
arch/arm/plat-mxc/Makefile +6 -0
index e3212c8..b0b9fc3 100644
@@ -9,3 +9,9 @@ obj-$(CONFIG_ARCH_MX1) += iomux-mx1-mx2.o dma-mx1-mx2.o
 obj-$(CONFIG_ARCH_MX2) += iomux-mx1-mx2.o dma-mx1-mx2.o
 obj-$(CONFIG_ARCH_MXC_IOMUX_V3) += iomux-v3.o
 obj-$(CONFIG_MXC_PWM)  += pwm.o
+obj-$(CONFIG_ARCH_MXC_AUDMUX_V1) += audmux-v1.o
+obj-$(CONFIG_ARCH_MXC_AUDMUX_V2) += audmux-v2.o
+ifdef CONFIG_SND_IMX_SOC
+obj-y += ssi-fiq.o
+obj-y += ssi-fiq-ksym.o
+endif
arch/arm/plat-mxc/ssi-fiq-ksym.c new file +20 -0
new file mode 100644
index 0000000..b5fad45
@@ -0,0 +1,20 @@
+/*
+ * Exported ksyms for the SSI FIQ handler
+ *
+ * Copyright (C) 2009, Sascha Hauer <[email protected]>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#include <linux/module.h>
+
+#include <mach/ssi.h>
+
+EXPORT_SYMBOL(imx_ssi_fiq_tx_buffer);
+EXPORT_SYMBOL(imx_ssi_fiq_rx_buffer);
+EXPORT_SYMBOL(imx_ssi_fiq_start);
+EXPORT_SYMBOL(imx_ssi_fiq_end);
+EXPORT_SYMBOL(imx_ssi_fiq_base);
+
arch/arm/plat-mxc/ssi-fiq.S new file +134 -0

134 lines not on this page · raw message

sound/soc/imx/Kconfig +6 -14
index a700562..84a25e6 100644
@@ -1,21 +1,13 @@
-config SND_MX1_MX2_SOC
-	tristate "SoC Audio for Freecale i.MX1x i.MX2x CPUs"
-	depends on ARCH_MX2 || ARCH_MX1
+config SND_IMX_SOC
+	tristate "SoC Audio for Freecale i.MX CPUs"
+	depends on ARCH_MXC
 	select SND_PCM
+	select FIQ
+	select SND_SOC_AC97_BUS
 	help
 	  Say Y or M if you want to add support for codecs attached to
-	  the MX1 or MX2 SSI interface.
+	  the i.MX SSI interface.
 
 config SND_MXC_SOC_SSI
 	tristate
 
-config SND_SOC_MX27VIS_WM8974
-	tristate "SoC Audio support for MX27 - WM8974 Visstrim_sm10 board"
-	depends on SND_MX1_MX2_SOC && MACH_MX27 && MACH_IMX27_VISSTRIM_M10
-	select SND_MXC_SOC_SSI
-	select SND_SOC_WM8974
-	help
-	  Say Y if you want to add support for SoC audio on Visstrim SM10
-	  board with WM8974.
-
-
sound/soc/imx/Makefile +6 -6
index c2ffd2c..4bde34a 100644
@@ -1,10 +1,10 @@
 # i.MX Platform Support
-snd-soc-mx1_mx2-objs := mx1_mx2-pcm.o
-snd-soc-mxc-ssi-objs := mxc-ssi.o
+snd-soc-imx-objs := imx-ssi.o imx-pcm-fiq.o imx-pcm-dma-mx2.o
 
-obj-$(CONFIG_SND_MX1_MX2_SOC) += snd-soc-mx1_mx2.o
-obj-$(CONFIG_SND_MXC_SOC_SSI) += snd-soc-mxc-ssi.o
+ifdef CONFIG_MACH_MX27
+snd-soc-imx-objs += imx-pcm-dma-mx2.o
+endif
+
+obj-$(CONFIG_SND_IMX_SOC) += snd-soc-imx.o
 
 # i.MX Machine Support
-snd-soc-mx27vis-wm8974-objs := mx27vis_wm8974.o
-obj-$(CONFIG_SND_SOC_MX27VIS_WM8974) += snd-soc-mx27vis-wm8974.o
sound/soc/imx/imx-pcm-dma-mx2.c new file +313 -0

313 lines not on this page · raw message

sound/soc/imx/imx-pcm-fiq.c new file +277 -0

277 lines not on this page · raw message

sound/soc/imx/imx-ssi.c new file +762 -0

762 lines not on this page · raw message

sound/soc/imx/imx-ssi.h new file +238 -0

238 lines not on this page · raw message

Signature · 1 line
1.6.6
author
#1 lore raw

PATCH 2/4 ASoC: Fix i.MX audio build for i.MX3x

Don't unconditionally include the i.MX2x DMA driver, the arch/arm functions it uses aren't available for i.MX3x.

---
 sound/soc/imx/Makefile |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
sound/soc/imx/Makefile +1 -1
index 4bde34a..d05cc95 100644
@@ -1,5 +1,5 @@
 # i.MX Platform Support
-snd-soc-imx-objs := imx-ssi.o imx-pcm-fiq.o imx-pcm-dma-mx2.o
+snd-soc-imx-objs := imx-ssi.o imx-pcm-fiq.o
 
 ifdef CONFIG_MACH_MX27
 snd-soc-imx-objs += imx-pcm-dma-mx2.o
Signature · 1 line
1.6.6
author
#2 lore raw

PATCH 3/4 ASoC: Convert new i.MX SSI driver to use static DAI array

In reply to Mark Brown

While dynamically allocated DAIs are the way forward the core doesn't yet support anything except matching with a pointer to the actual DAI so convert to doing that so that machine drivers don't have to jump through hoops to register themselves.

---
 sound/soc/imx/imx-ssi.c |   40 ++++++++++++++++++++--------------------
 sound/soc/imx/imx-ssi.h |    3 +--
 2 files changed, 21 insertions(+), 22 deletions(-)
sound/soc/imx/imx-ssi.c +20 -20
index c57a11f..ccb7ec9 100644
@@ -60,7 +60,7 @@
 static int imx_ssi_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai,
 	unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width)
 {
-	struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
+	struct imx_ssi *ssi = cpu_dai->private_data;
 	u32 sccr;
 
 	sccr = readl(ssi->base + SSI_STCCR);
@@ -87,7 +87,7 @@ static int imx_ssi_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai,
  */
 static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 {
-	struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
+	struct imx_ssi *ssi = cpu_dai->private_data;
 	u32 strcr = 0, scr;
 
 	scr = readl(ssi->base + SSI_SCR) & ~(SSI_SCR_SYN | SSI_SCR_NET);
@@ -160,7 +160,7 @@ static int imx_ssi_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
 static int imx_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
 				  int clk_id, unsigned int freq, int dir)
 {
-	struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
+	struct imx_ssi *ssi = cpu_dai->private_data;
 	u32 scr;
 
 	scr = readl(ssi->base + SSI_SCR);
@@ -188,7 +188,7 @@ static int imx_ssi_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
 static int imx_ssi_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
 				  int div_id, int div)
 {
-	struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
+	struct imx_ssi *ssi = cpu_dai->private_data;
 	u32 stccr, srccr;
 
 	stccr = readl(ssi->base + SSI_STCCR);
@@ -237,7 +237,7 @@ static int imx_ssi_hw_params(struct snd_pcm_substream *substream,
 			     struct snd_pcm_hw_params *params,
 			     struct snd_soc_dai *cpu_dai)
 {
-	struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
+	struct imx_ssi *ssi = cpu_dai->private_data;
 	u32 reg, sccr;
 
 	/* Tx/Rx config */
@@ -274,7 +274,7 @@ static int imx_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
 {
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
-	struct imx_ssi *ssi = container_of(cpu_dai, struct imx_ssi, dai);
+	struct imx_ssi *ssi = cpu_dai->private_data;
 	unsigned int sier_bits, sier;
 	unsigned int scr;
 
@@ -570,7 +570,7 @@ struct snd_ac97_bus_ops soc_ac97_ops = {
 };
 EXPORT_SYMBOL_GPL(soc_ac97_ops);
 
-struct snd_soc_dai *imx_ssi_pcm_dai[2];
+struct snd_soc_dai imx_ssi_pcm_dai[2];
 EXPORT_SYMBOL_GPL(imx_ssi_pcm_dai);
 
 static int imx_ssi_probe(struct platform_device *pdev)
@@ -581,6 +581,10 @@ static int imx_ssi_probe(struct platform_device *pdev)
 	struct snd_soc_platform *platform;
 	int ret = 0;
 	unsigned int val;
+	struct snd_soc_dai *dai = &imx_ssi_pcm_dai[pdev->id];
+
+	if (dai->id >= ARRAY_SIZE(imx_ssi_pcm_dai))
+		return -EINVAL;
 
 	ssi = kzalloc(sizeof(*ssi), GFP_KERNEL);
 	if (!ssi)
@@ -592,8 +596,6 @@ static int imx_ssi_probe(struct platform_device *pdev)
 		ssi->flags = pdata->flags;
 	}
 
-	imx_ssi_pcm_dai[pdev->id] = &ssi->dai;
-
 	ssi->irq = platform_get_irq(pdev, 0);
 
 	ssi->clk = clk_get(&pdev->dev, NULL);
@@ -631,13 +633,9 @@ static int imx_ssi_probe(struct platform_device *pdev)
 		}
 		ac97_ssi = ssi;
 		setup_channel_to_ac97(ssi);
-		memcpy(&ssi->dai, &imx_ac97_dai, sizeof(imx_ac97_dai));
+		memcpy(dai, &imx_ac97_dai, sizeof(imx_ac97_dai));
 	} else
-		memcpy(&ssi->dai, &imx_ssi_dai, sizeof(imx_ssi_dai));
-
-	ssi->dai.id = pdev->id;
-	ssi->dai.dev = &pdev->dev;
-	ssi->dai.name = kasprintf(GFP_KERNEL, "imx-ssi.%d", pdev->id);
+		memcpy(dai, &imx_ssi_dai, sizeof(imx_ssi_dai));
 
 	writel(0x0, ssi->base + SSI_SIER);
 
@@ -652,9 +650,10 @@ static int imx_ssi_probe(struct platform_device *pdev)
 	if (res)
 		ssi->dma_params_rx.dma = res->start;
 
-	ssi->dai.id = pdev->id;
-	ssi->dai.dev = &pdev->dev;
-	ssi->dai.name = kasprintf(GFP_KERNEL, "imx-ssi.%d", pdev->id);
+	dai->id = pdev->id;
+	dai->dev = &pdev->dev;
+	dai->name = kasprintf(GFP_KERNEL, "imx-ssi.%d", pdev->id);
+	dai->private_data = ssi;
 
 	if ((cpu_is_mx27() || cpu_is_mx21()) &&
 			!(ssi->flags & IMX_SSI_USE_AC97)) {
@@ -671,7 +670,7 @@ static int imx_ssi_probe(struct platform_device *pdev)
 		SSI_SFCSR_RFWM0(ssi->dma_params_rx.burstsize);
 	writel(val, ssi->base + SSI_SFCSR);
 
-	ret = snd_soc_register_dai(&ssi->dai);
+	ret = snd_soc_register_dai(dai);
 	if (ret) {
 		dev_err(&pdev->dev, "register DAI failed\n");
 		goto failed_register;
@@ -699,8 +698,9 @@ static int __devexit imx_ssi_remove(struct platform_device *pdev)
 {
 	struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	struct imx_ssi *ssi = platform_get_drvdata(pdev);
+	struct snd_soc_dai *dai = &imx_ssi_pcm_dai[pdev->id];
 
-	snd_soc_unregister_dai(&ssi->dai);
+	snd_soc_unregister_dai(dai);
 
 	if (ssi->flags & IMX_SSI_USE_AC97)
 		ac97_ssi = NULL;
sound/soc/imx/imx-ssi.h +1 -2
index cb2c81f..55f26eb 100644
@@ -183,7 +183,7 @@
 #define IMX_SSI_RX_DIV_PSR	4
 #define IMX_SSI_RX_DIV_PM	5
 
-extern struct snd_soc_dai *imx_ssi_pcm_dai[2];
+extern struct snd_soc_dai imx_ssi_pcm_dai[2];
 extern struct snd_soc_platform imx_soc_platform;
 
 #define DRV_NAME "imx-ssi"
@@ -195,7 +195,6 @@ struct imx_pcm_dma_params {
 };
 
 struct imx_ssi {
-	struct snd_soc_dai dai;
 	struct platform_device *ac97_dev;
 
 	struct snd_soc_device imx_ac97;
Signature · 1 line
1.6.6
author
#3 lore raw

PATCH 4/4 ASoC: Flag the i.MX SSI driver as using symmetric rates

In reply to Mark Brown

While the hardware is fully asymmetric the driver currently forces a symmetric configuration so flag that up in the capabilities to avoid breakage - when the driver is able to do symmetry the flag can be dropped.

---
 sound/soc/imx/imx-ssi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/imx/imx-ssi.c +2 -0
index ccb7ec9..cfaf715 100644
@@ -357,6 +357,8 @@ static struct snd_soc_dai imx_ssi_dai = {
 		.formats = SNDRV_PCM_FMTBIT_S16_LE,
 	},
 	.ops = &imx_ssi_pcm_dai_ops,
+	/* Hardware is asymmetric but the driver isn't yet */
+	.symmetric_rates = 1,
 };
 
 int snd_imx_pcm_mmap(struct snd_pcm_substream *substream,
Signature · 1 line
1.6.6
maintainer
#4 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

Hi Mark,

Quoted 15 lines · Mark Brown

While the hardware is fully asymmetric the driver currently forces a symmetric configuration so flag that up in the capabilities to avoid breakage - when the driver is able to do symmetry the flag can be dropped.

---
 sound/soc/imx/imx-ssi.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/imx/imx-ssi.c +0 -0
index ccb7ec9..cfaf715 100644

sound/soc/imx/imx-ssi.c static struct snd_soc_dai imx_ssi_dai = { · line 361

Quoted 5 lines
sound/soc/imx/imx-ssi.c +2 -0
@@ -357,6 +357,8 @@ static struct snd_soc_dai imx_ssi_dai = {
 		.formats = SNDRV_PCM_FMTBIT_S16_LE,
 	},
 	.ops = &imx_ssi_pcm_dai_ops,
+	/* Hardware is asymmetric but the driver isn't yet */
+	.symmetric_rates = 1,

Why this limitation? I can successfully record with 16000Hz while playing at 48000Hz on my PCM037 board. What is missing in the driver to 'officially' support asymmetric rates?

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author
#5 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

Quoted 3 lines · Sascha Hauer

Why this limitation? I can successfully record with 16000Hz while playing at 48000Hz on my PCM037 board. What is missing in the driver to 'officially' support asymmetric rates?

At least some of the driver was unconditionally setting both TX and RX configuration simultaneously, though looking again hw_params() is OK. I'll drop the patch. Like I say, I've never actually seen the driver working - even when configured as the master it doesn't seem to do any DMA (well, FIQs).

#6 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

2010/1/11 Mark Brown <[email protected]>

Quoted 6 lines · Sascha Hauer
Quoted 4 lines

Why this limitation? I can successfully record with 16000Hz while playing at 48000Hz on my PCM037 board. What is missing in the driver to 'officially' support asymmetric rates?

Quoted 6 lines

At least some of the driver was unconditionally setting both TX and RX configuration simultaneously, though looking again hw_params() is OK. I'll drop the patch. Like I say, I've never actually seen the driver working - even when configured as the master it doesn't seem to do any DMA (well, FIQs).

However,
I think it would be a good idea to add an optional flag to activate symmetric rate.
Understanding it as TX and RX SSI sections sharing the same CLKs. This is necessary for some codecs like wm8974 to work because they can only provide
one BCLK and FCLK for both directions.

Moreover I don't want to make this requirement blocking.

Signature · 7 lines
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
author
#7 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

Quoted 7 lines · javier Martin

However,
I think it would be a good idea to add an optional flag to activate symmetric rate.
Understanding it as TX and RX SSI sections sharing the same CLKs. This is necessary for some codecs like wm8974 to work because they can only provide
one BCLK and FCLK for both directions.

That's not what the patch does - it only sets the symmetric_rates flag, which can also be flagged from the machine driver, which adds some constraints for applications so you can't configure asymmetric rates. It doesn't affect the hardware configuration at all.

#8 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

In reply to javier Martin
Quoted 2 lines · javier Martin

I think it would be a good idea to add an optional flag to activate symmetric rate.

FYI, we already have this on the PowerPC version of the SSI driver. Asynchronous mode is only supported if the "fsl,ssi-asynchronous" property exists in the device tree.

I think the default should be synchronous unless asynchronous support is specified.

Signature · 2 lines
Timur Tabi
Linux kernel developer at Freescale
author
#9 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

Quoted 2 lines · Timur Tabi

I think the default should be synchronous unless asynchronous support is specified.

I tend to agree for the i.MX hardware - for the ones I've looked at each external SSI port is four wire so you need to hook up two to achieve a six wire configuration that can do asymmetry so a direct hookup between the external port and the SSI controller seems fairly natural. It's also the situation for all the default hookups the silicon provides.

maintainer
#10 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

Quoted 10 lines · Mark Brown
Quoted 2 lines · Timur Tabi

I think the default should be synchronous unless asynchronous support is specified.

I tend to agree for the i.MX hardware - for the ones I've looked at each external SSI port is four wire so you need to hook up two to achieve a six wire configuration that can do asymmetry so a direct hookup between the external port and the SSI controller seems fairly natural. It's also the situation for all the default hookups the silicon provides.

As long as I can overwrite this flag in the board support I'm fine with it. On our MC13783 based boards we have two external SSI channels (one for record and one for playback). I merge them together to one six wire SSI port using the AUDMUX since the imx-ssi driver currently can handle only one SSI unit in FIQ mode.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
maintainer
#11 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

In reply to Mark Brown
Quoted 8 lines · Mark Brown
Quoted 3 lines · Sascha Hauer

Why this limitation? I can successfully record with 16000Hz while playing at 48000Hz on my PCM037 board. What is missing in the driver to 'officially' support asymmetric rates?

At least some of the driver was unconditionally setting both TX and RX configuration simultaneously, though looking again hw_params() is OK.

You probably mean imx_ssi_set_dai_fmt(), imx_ssi_set_dai_tdm_slot() and imx_ssi_set_dai_sysclk(). We do not have the playback/record information available in these functions. Should we pass a struct snd_pcm_substream * to the functions?

Quoted 3 lines

I'll drop the patch. Like I say, I've never actually seen the driver working - even when configured as the master it doesn't seem to do any DMA (well, FIQs).

Unfortunately I do not have a mx31ads available, so I can't provide a driver for this board. I never used master mode, but if I understand the datasheet correctly the SSI unit has two clock inputs, one for the register accesses which gets enabled by clk_enable and one for the baud rate which doesn't get touched by the driver atm. Have you checked that the baud clock is configured correctly?
If you have by chance a mx27ads or a mx35 3stack board I could see that I make the driver work on one of these boards.

Sascha

Signature · 4 lines
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
author
#12 lore raw

Re: [PATCH 4/4] ASoC: Flag the i.MX SSI driver as using symmetric rates

Quoted 9 lines · Sascha Hauer
Quoted 2 lines · Mark Brown

At least some of the driver was unconditionally setting both TX and RX configuration simultaneously, though looking again hw_params() is OK.

You probably mean imx_ssi_set_dai_fmt(), imx_ssi_set_dai_tdm_slot() and imx_ssi_set_dai_sysclk(). We do not have the playback/record information available in these functions. Should we pass a struct snd_pcm_substream * to the functions?

Hrm, I think it was tdm_slot() - you get separate RX and TX masks so it should be able to work asymmetrically.

Quoted 10 lines
Quoted 3 lines

I'll drop the patch. Like I say, I've never actually seen the driver working - even when configured as the master it doesn't seem to do any DMA (well, FIQs).

Unfortunately I do not have a mx31ads available, so I can't provide a driver for this board. I never used master mode, but if I understand the datasheet correctly the SSI unit has two clock inputs, one for the register accesses which gets enabled by clk_enable and one for the baud rate which doesn't get touched by the driver atm. Have you checked that the baud clock is configured correctly?

Oh, then the master mode support should just be removed from the driver until it actually does all the required work. That'd have saved me some time...

Quoted 2 lines

If you have by chance a mx27ads or a mx35 3stack board I could see that I make the driver work on one of these boards.

I have neither of those boards.

Acked-by on v1 1/4
#13 lore raw
In reply to Mark Brown

2010/1/8 Mark Brown <[email protected]>

Quoted 21 lines

From: Sascha Hauer <[email protected]>

The old driver has the number of SSI units in the system hardcoded, does not make use of the device model and works only on i.MX21/27.

This driver replaces it. It works in DMA mode on i.MX21/27 and using an FIQ handler on other systems. It also supports AC97 mode of the SSI units.

---
 arch/arm/plat-mxc/Makefile       |    6 +
 arch/arm/plat-mxc/ssi-fiq-ksym.c |   20 +
 arch/arm/plat-mxc/ssi-fiq.S      |  134 +++++++
 sound/soc/imx/Kconfig            |   20 +-
 sound/soc/imx/Makefile           |   12 +-
 sound/soc/imx/imx-pcm-dma-mx2.c  |  313 ++++++++++++++++
 sound/soc/imx/imx-pcm-fiq.c      |  277 ++++++++++++++
 sound/soc/imx/imx-ssi.c          |  762

++++++++++++++++++++++++++++++++++++++

Quoted 10 lines
 sound/soc/imx/imx-ssi.h          |  238 ++++++++++++
 9 files changed, 1762 insertions(+), 20 deletions(-)
 create mode 100644 arch/arm/plat-mxc/ssi-fiq-ksym.c
 create mode 100644 arch/arm/plat-mxc/ssi-fiq.S
 create mode 100644 sound/soc/imx/imx-pcm-dma-mx2.c
 create mode 100644 sound/soc/imx/imx-pcm-fiq.c
 create mode 100644 sound/soc/imx/imx-ssi.c
 create mode 100644 sound/soc/imx/imx-ssi.h
Quoted 1 line
Signature · 7 lines
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com