Skip to contentSkip to conversation

kirkwood openrd client audio support - v4

PATCH Applied [email protected] 4 participants 19 messages May 27, 2010 – May 31, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover kirkwood openrd client audio support - v4

Hi,

This patchset is an other try to get merged openrd audio support mainline. The main change is going back to using kirkwood instead of orion, as the only orion having i2s is not merged mainline (if I got it right). I've also fixed the lastests comments on the cs42l51 codec patch.

Arnaud

Changes :
- changed back from orion to kirkwood
- removed cs42l51 adc input register initialisation
- moved the DAPM event macro to soc-dapm
- fixed cs42l51_set_dai_fmt() master/slave check
- removed cs42l51 startup message
- use snd_soc_update_bits() in cs42l51_pdn_event()

Acked-by on v1 1/6
#2 lore raw

Re: [patch 1/6] orion/kirkwood: add audio functions.

Quoted 4 lines · On Thu, 27 May 2010, [email protected] wrote:

This patch add audio related definitions and functions

Quoted 115 lines

Index: sound-2.6/arch/arm/mach-kirkwood/common.c
===================================================================

arch/arm/mach-kirkwood/common.c +38 -0
@@ -25,6 +25,7 @@
 #include <asm/mach/time.h>
 #include <mach/kirkwood.h>
 #include <mach/bridge-regs.h>
+#include <plat/audio.h>
 #include <plat/cache-feroceon-l2.h>
 #include <plat/ehci-orion.h>
 #include <plat/mvsdio.h>
@@ -855,6 +856,42 @@ struct sys_timer kirkwood_timer = {
 	.init = kirkwood_timer_init,
 };
 
+/*****************************************************************************
+ * Audio
+ ****************************************************************************/
+static struct resource kirkwood_i2s_resources[] = {
+	[0] = {
+		.start  = AUDIO_PHYS_BASE,
+		.end    = AUDIO_PHYS_BASE + SZ_16K - 1,
+		.flags  = IORESOURCE_MEM,
+	},
+	[1] = {
+		.start  = IRQ_KIRKWOOD_I2S,
+		.end    = IRQ_KIRKWOOD_I2S,
+		.flags  = IORESOURCE_IRQ,
+	},
+};
+
+static struct kirkwood_asoc_platform_data kirkwood_i2s_data = {
+	.dram        = &kirkwood_mbus_dram_info,
+	.burst       = 128,
+};
+
+static struct platform_device kirkwood_i2s_device = {
+	.name		= "kirkwood-i2s",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(kirkwood_i2s_resources),
+	.resource	= kirkwood_i2s_resources,
+	.dev		= {
+		.platform_data	= &kirkwood_i2s_data,
+	},
+};
+
+void __init kirkwood_audio_init(void)
+{
+	kirkwood_clk_ctrl |= CGC_AUDIO;
+	platform_device_register(&kirkwood_i2s_device);
+}
 
 /*****************************************************************************
  * General
@@ -914,6 +951,7 @@ void __init kirkwood_init(void)
 	kirkwood_spi_plat_data.tclk = kirkwood_tclk;
 	kirkwood_uart0_data[0].uartclk = kirkwood_tclk;
 	kirkwood_uart1_data[0].uartclk = kirkwood_tclk;
+	kirkwood_i2s_data.tclk = kirkwood_tclk;
 
 	/*
 	 * Disable propagation of mbus errors to the CPU local bus,

Index: sound-2.6/arch/arm/mach-kirkwood/common.h
===================================================================

arch/arm/mach-kirkwood/common.h +2 -0
@@ -16,6 +16,7 @@ struct mv643xx_eth_platform_data;
 struct mv_sata_platform_data;
 struct mvsdio_platform_data;
 struct mtd_partition;
+struct kirkwood_asoc_platform_data;
 
 /*
  * Basic Kirkwood init functions used early by machine-setup.
@@ -41,6 +42,7 @@ void kirkwood_i2c_init(void);
 void kirkwood_uart0_init(void);
 void kirkwood_uart1_init(void);
 void kirkwood_nand_init(struct mtd_partition *parts, int nr_parts, int delay);
+void kirkwood_audio_init(void);
 
 extern int kirkwood_tclk;
 extern struct sys_timer kirkwood_timer;

Index: sound-2.6/arch/arm/mach-kirkwood/include/mach/kirkwood.h
===================================================================

arch/arm/mach-kirkwood/include/mach/kirkwood.h +3 -0
@@ -96,6 +96,9 @@
 
 #define SDIO_PHYS_BASE		(KIRKWOOD_REGS_PHYS_BASE | 0x90000)
 
+#define AUDIO_PHYS_BASE		(KIRKWOOD_REGS_PHYS_BASE | 0xA0000)
+#define AUDIO_VIRT_BASE		(KIRKWOOD_REGS_VIRT_BASE | 0xA0000)
+
 /*
  * Supported devices and revisions.
  */

Index: sound-2.6/arch/arm/plat-orion/include/plat/audio.h
===================================================================

arch/arm/plat-orion/include/plat/audio.h new file +11 -0
@@ -0,0 +1,11 @@
+#ifndef __PLAT_AUDIO_H
+#define __PLAT_AUDIO_H
+
+#include <linux/mbus.h>
+
+struct kirkwood_asoc_platform_data {
+	u32 tclk;
+	struct mbus_dram_target_info *dram;
+	int burst;
+};
+#endif
#3 lore raw

Re: [patch 1/6] orion/kirkwood: add audio functions.

In reply to [email protected]
Quoted 4 lines · apatard at mandriva.com

This patch add audio related definitions and functions

I'm not sure which tree this patch was generated against but it won't apply to either 2.6.35-rc1 or my old for-2.6.35 branch. Please regenerate against my for-2.6.36 branch. The patches look fine but I'm not able to apply them.

#4 lore raw

[patch 0/4] Re: [patch 1/6] orion/kirkwood: add audio functions.

Quoted 6 lines

I'm not sure which tree this patch was generated against but it won't apply to either 2.6.35-rc1 or my old for-2.6.35 branch. Please regenerate against my for-2.6.36 branch. The patches look fine but I'm not able to apply them.

oh, ok. Sorry. It was based on a previous for-2.6.36 branch and the newer one conflicts due to the mtd RnB patch.

This new serie is based on your for-2.6.36 branch with HEAD 72ed5a8c9b057aeb779d161ac6fab1e98f091697

Arnaud

Applied
#6 lore raw

Re: [patch 1/4] orion/kirkwood: add audio functions.

Quoted 1 line · apatard at mandriva.com

This patch add audio related definitions and functions

Applied, thanks.

#12 lore raw

Re: [patch 3/6] soc-dapm.h: add SND_SOC_DAPM_PRE_POST_PMD event

Quoted 4 lines · apatard at mandriva.com

Some systems codecs need to configure some registers before and after powering down some of their part. As a convenience, I'm adding a macro for that.

Applied with modified changelog, thanks.

Please put an appropriate prefix on patches you submit ("ASoC: " for ASoC) - this makes it easier to apply.

Applied
#14 lore raw

Re: [patch 4/6] cs42l51: add asoc driver

Quoted 4 lines · apatard at mandriva.com

This patch is adding a ASoC driver for the cs42l51 from Cirrus Logic. Master mode and spi mode are not supported.

Applied, thanks.

#15 lore raw

PATCH 5/6 kirkwood: Add i2s support

In reply to [email protected]

This patch enables support for the i2s controller available on kirkwood platforms

sound/soc/kirkwood/Kconfig new file +11 -0
Index: sound-2.6/sound/soc/kirkwood/Kconfig
===================================================================
@@ -0,0 +1,11 @@
+config SND_KIRKWOOD_SOC
+	tristate "SoC Audio for the Marvell Kirkwood chip"
+	depends on ARCH_KIRKWOOD
+	help
+	  Say Y or M if you want to add support for codecs attached to
+	  the Kirkwood I2S interface. You will also need to select the
+	  audio interfaces to support below.
+
+config SND_KIRKWOOD_SOC_I2S
+	tristate
+
sound/soc/kirkwood/kirkwood-dma.c new file +383 -0

383 lines not on this page · raw message

sound/soc/kirkwood/kirkwood.h new file +126 -0

126 lines not on this page · raw message

sound/soc/kirkwood/kirkwood-i2s.c new file +485 -0

485 lines not on this page · raw message

sound/soc/kirkwood/Makefile new file +6 -0
Index: sound-2.6/sound/soc/kirkwood/Makefile
===================================================================
@@ -0,0 +1,6 @@
+snd-soc-kirkwood-objs := kirkwood-dma.o
+snd-soc-kirkwood-i2s-objs := kirkwood-i2s.o
+
+obj-$(CONFIG_SND_KIRKWOOD_SOC) += snd-soc-kirkwood.o
+obj-$(CONFIG_SND_KIRKWOOD_SOC_I2S) += snd-soc-kirkwood-i2s.o
+
sound/soc/Makefile +1 -0
Index: sound-2.6/sound/soc/Makefile
===================================================================
@@ -10,6 +10,7 @@ obj-$(CONFIG_SND_SOC)	+= fsl/
 obj-$(CONFIG_SND_SOC)   += imx/
 obj-$(CONFIG_SND_SOC)	+= nuc900/
 obj-$(CONFIG_SND_SOC)	+= omap/
+obj-$(CONFIG_SND_SOC)	+= kirkwood/
 obj-$(CONFIG_SND_SOC)	+= pxa/
 obj-$(CONFIG_SND_SOC)	+= s3c24xx/
 obj-$(CONFIG_SND_SOC)	+= s6000/
sound/soc/kirkwood/kirkwood-dma.h new file +17 -0
Index: sound-2.6/sound/soc/kirkwood/kirkwood-dma.h
===================================================================
@@ -0,0 +1,17 @@
+/*
+ * kirkwood-dma.h
+ *
+ * (c) 2010 Arnaud Patard <[email protected]>
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#ifndef _KIRKWOOD_DMA_H
+#define _KIRKWOOD_DMA_H
+
+extern struct snd_soc_platform kirkwood_soc_platform;
+
+#endif
sound/soc/kirkwood/kirkwood-i2s.h new file +17 -0
Index: sound-2.6/sound/soc/kirkwood/kirkwood-i2s.h
===================================================================
@@ -0,0 +1,17 @@
+/*
+ * kirkwood-i2s.h
+ *
+ * (c) 2010 Arnaud Patard <[email protected]>
+ *
+ *  This program is free software; you can redistribute  it and/or modify it
+ *  under  the terms of  the GNU General  Public License as published by the
+ *  Free Software Foundation;  either version 2 of the  License, or (at your
+ *  option) any later version.
+ */
+
+#ifndef _KIRKWOOD_I2S_H
+#define _KIRKWOOD_I2S_H
+
+extern struct snd_soc_dai kirkwood_i2s_dai;
+
+#endif
sound/soc/Kconfig +1 -0
Index: sound-2.6/sound/soc/Kconfig
===================================================================
@@ -32,6 +32,7 @@ source "sound/soc/fsl/Kconfig"
 source "sound/soc/imx/Kconfig"
 source "sound/soc/nuc900/Kconfig"
 source "sound/soc/omap/Kconfig"
+source "sound/soc/kirkwood/Kconfig"
 source "sound/soc/pxa/Kconfig"
 source "sound/soc/s3c24xx/Kconfig"
 source "sound/soc/s6000/Kconfig"
#16 lore raw

PATCH 6/6 kirkwood: Add audio support to openrd client platforms

In reply to [email protected]

This patch is adding support for openrd client platforms. It's using the cs42l51 codec and has one mic and one speaker plugs.

sound/soc/kirkwood/Kconfig +9 -0
Index: sound-2.6/sound/soc/kirkwood/Kconfig
===================================================================
@@ -9,3 +9,12 @@ config SND_KIRKWOOD_SOC
 config SND_KIRKWOOD_SOC_I2S
 	tristate
 
+config SND_KIRKWOOD_SOC_OPENRD
+	tristate "SoC Audio support for Kirkwood Openrd Client"
+	depends on SND_KIRKWOOD_SOC && MACH_OPENRD_CLIENT
+	select SND_KIRKWOOD_SOC_I2S
+	select SND_SOC_CS42L51
+	help
+	  Say Y if you want to add support for SoC audio on
+	  Openrd Client.
+
sound/soc/kirkwood/Makefile +3 -0
Index: sound-2.6/sound/soc/kirkwood/Makefile
===================================================================
@@ -4,3 +4,6 @@ snd-soc-kirkwood-i2s-objs := kirkwood-i2
 obj-$(CONFIG_SND_KIRKWOOD_SOC) += snd-soc-kirkwood.o
 obj-$(CONFIG_SND_KIRKWOOD_SOC_I2S) += snd-soc-kirkwood-i2s.o
 
+snd-soc-openrd-objs := kirkwood-openrd.o
+
+obj-$(CONFIG_SND_KIRKWOOD_SOC_OPENRD) += snd-soc-openrd.o
sound/soc/kirkwood/kirkwood-openrd.c new file +126 -0

126 lines not on this page · raw message

#17 lore raw
In reply to [email protected]
Quoted 6 lines · On Thu, 27 May 2010, [email protected] wrote:

Hi,

This patchset is an other try to get merged openrd audio support mainline. The main change is going back to using kirkwood instead of orion, as the only orion having i2s is not merged mainline (if I got it right).

Right.

Quoted 11 lines

I've also fixed the lastests comments on the cs42l51 codec patch.

Arnaud

Changes :
- changed back from orion to kirkwood
- removed cs42l51 adc input register initialisation
- moved the DAPM event macro to soc-dapm
- fixed cs42l51_set_dai_fmt() master/slave check
- removed cs42l51 startup message
- use snd_soc_update_bits() in cs42l51_pdn_event()

I acked the first patch which touches directly the directory I normally handle patches for. Given the series is mostly about ASOC stuff, I think it is best if the whole series, including the first patch, is pushed through the ASOC tree (if Mark agrees with the rest that is of course).

Nicolas

Acked-by on the v1 series
#18 lore raw
In reply to [email protected]
Quoted 9 lines · apatard at mandriva.com

Hi,

This patchset is an other try to get merged openrd audio support mainline. The main change is going back to using kirkwood instead of orion, as the only orion having i2s is not merged mainline (if I got it right). I've also fixed the lastests comments on the cs42l51 codec patch.

Arnaud

Quoted 7 lines

Changes :
- changed back from orion to kirkwood
- removed cs42l51 adc input register initialisation
- moved the DAPM event macro to soc-dapm
- fixed cs42l51_set_dai_fmt() master/slave check
- removed cs42l51 startup message
- use snd_soc_update_bits() in cs42l51_pdn_event()

Signature · 3 lines
Freelance Developer, SlimLogic Ltd
ASoC and Voltage Regulator Maintainer.
http://www.slimlogic.co.uk