Skip to contentSkip to conversation

ASoC: ARM Cirrus Logic CLPS711X DAI driver

PATCH Superseded Alexander Shiyan 2 participants 5 messages Feb 26, 2014 – Feb 28, 2014

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover ASoC: ARM Cirrus Logic CLPS711X DAI driver

This series adds sound support for the Cirrus Logic CLPS711X CPUs. Driver is designed (and tested) for using with generic sound card.

Alexander Shiyan (2):
ASoC: Add driver for CLPS711X DAI interface
ASoC: cirrus: clps711x: Add bindings documentation for the CLPS711X
DAI

 .../bindings/sound/cirrus,clps711x-dai.txt         |  20 +
 sound/soc/cirrus/Kconfig                           |   8 +
 sound/soc/cirrus/Makefile                          |   5 +
 sound/soc/cirrus/clps711x-dai.c                    | 522 +++++++++++++++++++++
 sound/soc/cirrus/clps711x-dai.h                    |  61 +++
 sound/soc/cirrus/clps711x-fiq.S                    |  56 +++
 6 files changed, 672 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/sound/cirrus,clps711x-dai.txt
 create mode 100644 sound/soc/cirrus/clps711x-dai.c
 create mode 100644 sound/soc/cirrus/clps711x-dai.h
 create mode 100644 sound/soc/cirrus/clps711x-fiq.S
Signature · 1 line
1.8.3.2
#1 lore raw

PATCH 1/2 ASoC: Add driver for CLPS711X DAI interface

This patch adds a driver for the DAI interface found on Cirrus Logic CLPS711X family CPUs.

---
 sound/soc/cirrus/Kconfig        |   8 +
 sound/soc/cirrus/Makefile       |   5 +
 sound/soc/cirrus/clps711x-dai.c | 522 ++++++++++++++++++++++++++++++++++++++++
 sound/soc/cirrus/clps711x-dai.h |  61 +++++
 sound/soc/cirrus/clps711x-fiq.S |  56 +++++
 5 files changed, 652 insertions(+)
 create mode 100644 sound/soc/cirrus/clps711x-dai.c
 create mode 100644 sound/soc/cirrus/clps711x-dai.h
 create mode 100644 sound/soc/cirrus/clps711x-fiq.S
sound/soc/cirrus/Kconfig +8 -0
index c872dac..bbd25cd 100644
@@ -1,3 +1,11 @@
+config SND_CLPS711X_SOC
+	tristate "SoC Audio support for the Cirrus Logic CLPS711X CPUs"
+	depends on ARCH_CLPS711X || (ARM && COMPILE_TEST)
+	select FIQ
+	help
+	  Say Y or M if you want to add support for codecs attached to
+	  the CLPS711X DAI interface.
+
 config SND_EP93XX_SOC
 	tristate "SoC Audio support for the Cirrus Logic EP93xx series"
 	depends on ARCH_EP93XX || COMPILE_TEST
sound/soc/cirrus/Makefile +5 -0
index 5514146..f5d72fc 100644
@@ -1,3 +1,8 @@
+# CLPS711X Platform Support
+snd-soc-clps711x-objs				:= clps711x-dai.o clps711x-fiq.o
+
+obj-$(CONFIG_SND_CLPS711X_SOC)			+= snd-soc-clps711x.o
+
 # EP93xx Platform Support
 snd-soc-ep93xx-objs				:= ep93xx-pcm.o
 snd-soc-ep93xx-i2s-objs	 			:= ep93xx-i2s.o
sound/soc/cirrus/clps711x-dai.c new file +522 -0

522 lines not on this page · raw message

sound/soc/cirrus/clps711x-dai.h new file +61 -0

61 lines not on this page · raw message

sound/soc/cirrus/clps711x-fiq.S new file +56 -0

56 lines not on this page · raw message

Signature · 1 line
1.8.3.2
maintainer
#2 lore raw

Re: [PATCH 1/2] ASoC: Add driver for CLPS711X DAI interface

sound/soc/cirrus/clps711x-dai.c line 90

Quoted 8 lines · Alexander Shiyan
sound/soc/cirrus/clps711x-dai.c new file +8 -0
+static int clps711x_dai_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div)
+{
+	struct clps711x_dai *s = dev_get_drvdata(dai->dev);
+
+	s->div2 = div;
+
+	return 0;
+}

What is this divider and why does the machine driver need to manually configure it?

sound/soc/cirrus/clps711x-dai.c line 207

Quoted 11 lines
sound/soc/cirrus/clps711x-dai.c new file +11 -0
+static int clps711x_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct clps711x_dai *dai = snd_soc_platform_get_drvdata(rtd->platform);
+
+	switch (cmd) {
+	case SNDRV_PCM_TRIGGER_START:
+		atomic_set(&dai->running, 1);
+		hrtimer_start(&dai->hrt, ns_to_ktime(dai->reload),
+			      HRTIMER_MODE_REL);
+		break;

I'm wondering if the FIQ code can be shared with the i.MX FIQ code? Not something that should block merging but it seems like it might be helpful for other platforms that need to use FIQ support.

sound/soc/cirrus/clps711x-dai.c line 250

Quoted 6 lines
sound/soc/cirrus/clps711x-dai.c new file +6 -0
+static int clps711x_pcm_silence(struct snd_pcm_substream *substream,
+				int channel, snd_pcm_uframes_t pos,
+				snd_pcm_uframes_t count)
+{
+	return 0;
+}

Omit empty functions.

sound/soc/cirrus/clps711x-dai.c line 353

Quoted 6 lines
sound/soc/cirrus/clps711x-dai.c new file +6 -0
+#if defined(CONFIG_SND_CLPS711X_SOC_MODULE)
+irqreturn_t no_action(int irq, void *dev_id)
+{
+	return IRQ_NONE;
+}
+#endif

Eh? Waht's this about?

sound/soc/cirrus/clps711x-dai.c line 386

Quoted 7 lines
sound/soc/cirrus/clps711x-dai.c new file +7 -0
+static void clps711x_pcm_free(struct snd_pcm *pcm)
+{
+	struct snd_soc_pcm_runtime *rtd = pcm->private_data;
+	struct clps711x_dai *dai = snd_soc_platform_get_drvdata(rtd->platform);
+
+	/* Manually free IRQ */
+	devm_free_irq(rtd->platform->dev, dai->irq, NULL);

Why is this using devm_?

#3 lore raw

Re: [PATCH 1/2] ASoC: Add driver for CLPS711X DAI interface

Четверг, 27 февраля 2014, 12:44 +09:00 от Mark Brown <[email protected]>:

Quoted 13 lines · Alexander Shiyan

sound/soc/cirrus/clps711x-dai.c line 90

Quoted 9 lines
sound/soc/cirrus/clps711x-dai.c new file +8 -0
+static int clps711x_dai_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div)
+{
+	struct clps711x_dai *s = dev_get_drvdata(dai->dev);
+
+	s->div2 = div;
+
+	return 0;
+}

What is this divider and why does the machine driver need to manually configure it?

I'll think about it ...

Quoted 7 lines
Quoted 7 lines
sound/soc/cirrus/clps711x-dai.c new file +7 -0
+static int clps711x_pcm_trigger(struct snd_pcm_substream *substream, int cmd)
+{
+	struct snd_soc_pcm_runtime *rtd = substream->private_data;
+	struct clps711x_dai *dai = snd_soc_platform_get_drvdata(rtd->platform);
+
+	switch (cmd) {
+	case SNDRV_PCM_TRIGGER_START:
Quoted 8 lines

sound/soc/cirrus/clps711x-dai.c line 207

Quoted 4 lines
sound/soc/cirrus/clps711x-dai.c new file +4 -0
+		atomic_set(&dai->running, 1);
+		hrtimer_start(&dai->hrt, ns_to_ktime(dai->reload),
+			      HRTIMER_MODE_REL);
+		break;

I'm wondering if the FIQ code can be shared with the i.MX FIQ code? Not something that should block merging but it seems like it might be helpful for other platforms that need to use FIQ support.

This FIQ implementation and i.MX FIQ is totally different. I am fully confident that we can not use any common features/calls.

Quoted 8 lines

sound/soc/cirrus/clps711x-dai.c line 250

Quoted 6 lines
sound/soc/cirrus/clps711x-dai.c new file +6 -0
+static int clps711x_pcm_silence(struct snd_pcm_substream *substream,
+				int channel, snd_pcm_uframes_t pos,
+				snd_pcm_uframes_t count)
+{
+	return 0;
+}

Omit empty functions.

So designed. I'll add a comment in the next version.

Quoted 8 lines

sound/soc/cirrus/clps711x-dai.c line 353

Quoted 6 lines
sound/soc/cirrus/clps711x-dai.c new file +6 -0
+#if defined(CONFIG_SND_CLPS711X_SOC_MODULE)
+irqreturn_t no_action(int irq, void *dev_id)
+{
+	return IRQ_NONE;
+}
+#endif

Eh? Waht's this about?

In case using this driver as non-module, "no_action" handler is used from kernel/irq/handle.c, but since it is not exported it cannot be used in module case.
I'll remade this to use own empty handler always.

---
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

maintainer
#4 lore raw

Re: [PATCH 1/2] ASoC: Add driver for CLPS711X DAI interface

Quoted 8 lines · Alexander Shiyan

Четверг, 27 февраля 2014, 12:44 +09:00 от Mark Brown <[email protected]>:

Quoted 3 lines

I'm wondering if the FIQ code can be shared with the i.MX FIQ code? Not something that should block merging but it seems like it might be helpful for other platforms that need to use FIQ support.

This FIQ implementation and i.MX FIQ is totally different. I am fully confident that we can not use any common features/calls.

The timer stuff looked a bit familiar...

Quoted 9 lines
Quoted 8 lines

sound/soc/cirrus/clps711x-dai.c line 353

Quoted 6 lines
sound/soc/cirrus/clps711x-dai.c new file +6 -0
+#if defined(CONFIG_SND_CLPS711X_SOC_MODULE)
+irqreturn_t no_action(int irq, void *dev_id)
+{
+	return IRQ_NONE;
+}
+#endif

Eh? Waht's this about?

Quoted 4 lines

In case using this driver as non-module, "no_action" handler is used from kernel/irq/handle.c, but since it is not exported it cannot be used in module case.
I'll remade this to use own empty handler always.

Please don't do this, fix the problem properly (for example by exporting it if that's the sensible thing to do).