Skip to contentSkip to conversation

ASoC updats for 2.6.30

PATCH New Mark Brown 2 participants 11 messages Jan 23, 2009

Subsystems (5)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

The following changes since commit 56692396447ca3fee061c26f22590a1046fd2d6b:
Mark Brown (1):

        Merge branch 'for-2.6.29' into for-2.6.30

are available in the git repository at:

ssh://master.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.30

(the usual git URI should work eventually as well but the mirroring appears to be stuck right now and it's past 5pm on a Friday.)

Mark Brown (7):
ASoC: Fix merge with PXA tree
ASoC: Remove unneeded e7x0 inclusion of pxa-regs.h and hardware.h
ASoC: Configure SSP port PLL for Zylonite
ASoC: Fix spurious codec driver dependencies
Merge branch 'for-2.6.29' into for-2.6.30
ASoC: Include header file in cs4270 and wm9705
ASoC: Fix L3 bus handling in Kconfig

Peter Ujfalusi (1):
ASoC: Add missing comma to SND_SOC_DAPM_SWITCH_E in soc-dapm.h

Steve Sakoman (1):
ASoC: Complete Beagleboard support

Timur Tabi (1):
ASoC: remove stand-alone mode support from CS4270 codec driver

 include/sound/soc-dapm.h    |    2 +-
 sound/soc/codecs/Kconfig    |    5 +--
 sound/soc/codecs/cs4270.c   |   90 +++++++++++++------------------------------
 sound/soc/codecs/wm9705.c   |    2 +
 sound/soc/fsl/Kconfig       |    3 +-
 sound/soc/omap/Kconfig      |   14 ++++++-
 sound/soc/omap/Makefile     |    2 +
 sound/soc/pxa/e740_wm9705.c |    2 -
 sound/soc/pxa/e750_wm9705.c |    2 -
 sound/soc/pxa/e800_wm9712.c |    5 +--
 sound/soc/pxa/zylonite.c    |    8 ++++
 sound/soc/s3c24xx/Kconfig   |    1 +
 12 files changed, 57 insertions(+), 79 deletions(-)
author
#1 lore raw

PATCH 1/9 ASoC: Complete Beagleboard support

From: Steve Sakoman <[email protected]>

Commit dc06102a0c8b5aa0dd7f9a40ce241e793c252a87 in the asoc tree did not include the necessary Kconfig and Makefile changes. This patch completes the support for Beagleboard

---
 sound/soc/omap/Kconfig  |   10 ++++++++++
 sound/soc/omap/Makefile |    2 ++
 2 files changed, 12 insertions(+), 0 deletions(-)
sound/soc/omap/Kconfig +10 -0
index 4f7f040..ccd8973 100644
@@ -55,3 +55,13 @@ config SND_OMAP_SOC_OMAP3_PANDORA
 	select SND_SOC_TWL4030
 	help
 	  Say Y if you want to add support for SoC audio on the OMAP3 Pandora.
+
+config SND_OMAP_SOC_OMAP3_BEAGLE
+	tristate "SoC Audio support for OMAP3 Beagle"
+	depends on TWL4030_CORE && SND_OMAP_SOC && MACH_OMAP3_BEAGLE
+	select SND_OMAP_SOC_MCBSP
+	select SND_SOC_TWL4030
+	help
+	  Say Y if you want to add support for SoC audio on the Beagleboard.
+
+
sound/soc/omap/Makefile +2 -0
index 76fedd9..0c9e4ac 100644
@@ -12,6 +12,7 @@ snd-soc-overo-objs := overo.o
 snd-soc-omap2evm-objs := omap2evm.o
 snd-soc-sdp3430-objs := sdp3430.o
 snd-soc-omap3pandora-objs := omap3pandora.o
+snd-soc-omap3beagle-objs := omap3beagle.o
 
 obj-$(CONFIG_SND_OMAP_SOC_N810) += snd-soc-n810.o
 obj-$(CONFIG_SND_OMAP_SOC_OSK5912) += snd-soc-osk5912.o
@@ -19,3 +20,4 @@ obj-$(CONFIG_SND_OMAP_SOC_OVERO) += snd-soc-overo.o
 obj-$(CONFIG_MACH_OMAP2EVM) += snd-soc-omap2evm.o
 obj-$(CONFIG_SND_OMAP_SOC_SDP3430) += snd-soc-sdp3430.o
 obj-$(CONFIG_SND_OMAP_SOC_OMAP3_PANDORA) += snd-soc-omap3pandora.o
+obj-$(CONFIG_SND_OMAP_SOC_OMAP3_BEAGLE) += snd-soc-omap3beagle.o
Signature · 1 line
1.5.6.5
author
#2 lore raw

PATCH 2/9 ASoC: remove stand-alone mode support from CS4270 codec driver

From: Timur Tabi <[email protected]>

The CS4270 supports stand-alone mode, where the codec is not connect to the I2C or SPI buses. Instead, input voltages configure the codec at power-on. The CS4270 ASoC device driver has partial support for this mode, but the code was never tested, and partial support doesn't help anyone. It also made the rest of the code more complicated than necessary.

[Removed redundant CS4270 dependency on I2C -- broonie]

---
 sound/soc/codecs/cs4270.c |   92 +++++++++++++-------------------------------
 sound/soc/fsl/Kconfig     |    3 +-
 2 files changed, 29 insertions(+), 66 deletions(-)
sound/soc/codecs/cs4270.c +27 -65
index f1aa0c3..2e4ce04 100644
@@ -12,11 +12,7 @@
  *
  * Current features/limitations:
  *
- * 1) Software mode is supported.  Stand-alone mode is automatically
- *    selected if I2C is disabled or if a CS4270 is not found on the I2C
- *    bus.  However, stand-alone mode is only partially implemented because
- *    there is no mechanism yet for this driver and the machine driver to
- *    communicate the values of the M0, M1, MCLK1, and MCLK2 pins.
+ * 1) Software mode is supported.  Stand-alone mode is not supported.
  * 2) Only I2C is supported, not SPI
  * 3) Only Master mode is supported, not Slave.
  * 4) The machine driver's 'startup' function must call
@@ -33,14 +29,6 @@
 #include <sound/initval.h>
 #include <linux/i2c.h>
 
-#include "cs4270.h"
-
-/* If I2C is defined, then we support software mode.  However, if we're
-   not compiled as module but I2C is, then we can't use I2C calls. */
-#if defined(CONFIG_I2C) || (defined(CONFIG_I2C_MODULE) && defined(MODULE))
-#define USE_I2C
-#endif
-
 /* Private data for the CS4270 */
 struct cs4270_private {
 	unsigned int mclk; /* Input frequency of the MCLK pin */
@@ -60,8 +48,6 @@ struct cs4270_private {
 			SNDRV_PCM_FMTBIT_S24_3LE | SNDRV_PCM_FMTBIT_S24_3BE | \
 			SNDRV_PCM_FMTBIT_S24_LE  | SNDRV_PCM_FMTBIT_S24_BE)
 
-#ifdef USE_I2C
-
 /* CS4270 registers addresses */
 #define CS4270_CHIPID	0x01	/* Chip ID */
 #define CS4270_PWRCTL	0x02	/* Power Control */
@@ -272,17 +258,6 @@ static int cs4270_set_dai_fmt(struct snd_soc_dai *codec_dai,
 }
 
 /*
- * A list of addresses on which this CS4270 could use.  I2C addresses are
- * 7 bits.  For the CS4270, the upper four bits are always 1001, and the
- * lower three bits are determined via the AD2, AD1, and AD0 pins
- * (respectively).
- */
-static const unsigned short normal_i2c[] = {
-	0x48, 0x49, 0x4A, 0x4B, 0x4C, 0x4D, 0x4E, 0x4F, I2C_CLIENT_END
-};
-I2C_CLIENT_INSMOD;
-
-/*
  * Pre-fill the CS4270 register cache.
  *
  * We use the auto-increment feature of the CS4270 to read all registers in
@@ -476,7 +451,6 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream,
 }
 
 #ifdef CONFIG_SND_SOC_CS4270_HWMUTE
-
 /*
  * Set the CS4270 external mute
  *
@@ -501,32 +475,16 @@ static int cs4270_mute(struct snd_soc_dai *dai, int mute)
 
 	return snd_soc_write(codec, CS4270_MUTE, reg6);
 }
-
+#else
+#define cs4270_mute NULL
 #endif
 
-static int cs4270_i2c_probe(struct i2c_client *, const struct i2c_device_id *);
-
 /* A list of non-DAPM controls that the CS4270 supports */
 static const struct snd_kcontrol_new cs4270_snd_controls[] = {
 	SOC_DOUBLE_R("Master Playback Volume",
 		CS4270_VOLA, CS4270_VOLB, 0, 0xFF, 1)
 };
 
-static const struct i2c_device_id cs4270_id[] = {
-	{"cs4270", 0},
-	{}
-};
-MODULE_DEVICE_TABLE(i2c, cs4270_id);
-
-static struct i2c_driver cs4270_i2c_driver = {
-	.driver = {
-		.name = "CS4270 I2C",
-		.owner = THIS_MODULE,
-	},
-	.id_table = cs4270_id,
-	.probe = cs4270_i2c_probe,
-};
-
 /*
  * Global variable to store socdev for i2c probe function.
  *
@@ -633,7 +591,20 @@ error:
 	return ret;
 }
 
-#endif /* USE_I2C*/
+static const struct i2c_device_id cs4270_id[] = {
+	{"cs4270", 0},
+	{}
+};
+MODULE_DEVICE_TABLE(i2c, cs4270_id);
+
+static struct i2c_driver cs4270_i2c_driver = {
+	.driver = {
+		.name = "cs4270",
+		.owner = THIS_MODULE,
+	},
+	.id_table = cs4270_id,
+	.probe = cs4270_i2c_probe,
+};
 
 struct snd_soc_dai cs4270_dai = {
 	.name = "CS4270",
@@ -698,7 +669,6 @@ static int cs4270_probe(struct platform_device *pdev)
 		goto error_free_codec;
 	}
 
-#ifdef USE_I2C
 	cs4270_socdev = socdev;
 
 	ret = i2c_add_driver(&cs4270_i2c_driver);
@@ -708,20 +678,16 @@ static int cs4270_probe(struct platform_device *pdev)
 	}
 
 	/* Did we find a CS4270 on the I2C bus? */
-	if (codec->control_data) {
-		/* Initialize codec ops */
-		cs4270_dai.ops.hw_params = cs4270_hw_params;
-		cs4270_dai.ops.set_sysclk = cs4270_set_dai_sysclk;
-		cs4270_dai.ops.set_fmt = cs4270_set_dai_fmt;
-#ifdef CONFIG_SND_SOC_CS4270_HWMUTE
-		cs4270_dai.ops.digital_mute = cs4270_mute;
-#endif
-	} else
-		printk(KERN_INFO "cs4270: no I2C device found, "
-			"using stand-alone mode\n");
-#else
-	printk(KERN_INFO "cs4270: I2C disabled, using stand-alone mode\n");
-#endif
+	if (!codec->control_data) {
+		printk(KERN_ERR "cs4270: failed to attach driver");
+		goto error_del_driver;
+	}
+
+	/* Initialize codec ops */
+	cs4270_dai.ops.hw_params = cs4270_hw_params;
+	cs4270_dai.ops.set_sysclk = cs4270_set_dai_sysclk;
+	cs4270_dai.ops.set_fmt = cs4270_set_dai_fmt;
+	cs4270_dai.ops.digital_mute = cs4270_mute;
 
 	ret = snd_soc_init_card(socdev);
 	if (ret < 0) {
@@ -732,11 +698,9 @@ static int cs4270_probe(struct platform_device *pdev)
 	return 0;
 
 error_del_driver:
-#ifdef USE_I2C
 	i2c_del_driver(&cs4270_i2c_driver);
 
 error_free_pcms:
-#endif
 	snd_soc_free_pcms(socdev);
 
 error_free_codec:
@@ -752,9 +716,7 @@ static int cs4270_remove(struct platform_device *pdev)
 
 	snd_soc_free_pcms(socdev);
 
-#ifdef USE_I2C
 	i2c_del_driver(&cs4270_i2c_driver);
-#endif
 
 	kfree(socdev->codec);
 	socdev->codec = NULL;
sound/soc/fsl/Kconfig +2 -1
index c7c78c3..9fc9082 100644
@@ -10,7 +10,8 @@ config SND_SOC_MPC8610
 
 config SND_SOC_MPC8610_HPCD
 	tristate "ALSA SoC support for the Freescale MPC8610 HPCD board"
-	depends on MPC8610_HPCD
+	# I2C is necessary for the CS4270 driver
+	depends on MPC8610_HPCD && I2C
 	select SND_SOC_MPC8610
 	select SND_SOC_CS4270
 	select SND_SOC_CS4270_VD33_ERRATA
Signature · 1 line
1.5.6.5
author
#3 lore raw

PATCH 3/9 ASoC: Fix merge with PXA tree

Fix a merge issue caused by context overlap.

---
 sound/soc/pxa/e800_wm9712.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)
sound/soc/pxa/e800_wm9712.c +1 -4
index 78a1770..bc019cd 100644
@@ -18,13 +18,10 @@
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
 
-#include <mach/pxa-regs.h>
-#include <mach/hardware.h>
+#include <asm/mach-types.h>
 #include <mach/audio.h>
 #include <mach/eseries-gpio.h>
 
-#include <asm/mach-types.h>
-
 #include "../codecs/wm9712.h"
 #include "pxa2xx-pcm.h"
 #include "pxa2xx-ac97.h"
Signature · 1 line
1.5.6.5
author
#4 lore raw

PATCH 4/9 ASoC: Remove unneeded e7x0 inclusion of pxa-regs.h and hardware.h

pxa-regs.h and hardware.h are not intended for use directly in driver code and references to them have been removed in other code - remove them from the newly added e740 and e750 machine drivers.

---
 sound/soc/pxa/e740_wm9705.c |    2 --
 sound/soc/pxa/e750_wm9705.c |    2 --
 2 files changed, 0 insertions(+), 4 deletions(-)
sound/soc/pxa/e740_wm9705.c +0 -2
index ac36176..7cd2f89 100644
@@ -18,8 +18,6 @@
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
 
-#include <mach/pxa-regs.h>
-#include <mach/hardware.h>
 #include <mach/audio.h>
 #include <mach/eseries-gpio.h>
 
sound/soc/pxa/e750_wm9705.c +0 -2
index 20fbdcf..8dceccc 100644
@@ -18,8 +18,6 @@
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
 
-#include <mach/pxa-regs.h>
-#include <mach/hardware.h>
 #include <mach/audio.h>
 #include <mach/eseries-gpio.h>
 
Signature · 1 line
1.5.6.5
author
#5 lore raw

PATCH 5/9 ASoC: Configure SSP port PLL for Zylonite

---
 sound/soc/pxa/zylonite.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
sound/soc/pxa/zylonite.c +8 -0
index 8541b67..ec2fb76 100644
@@ -95,6 +95,7 @@ static int zylonite_voice_hw_params(struct snd_pcm_substream *substream,
 	struct snd_soc_pcm_runtime *rtd = substream->private_data;
 	struct snd_soc_dai *codec_dai = rtd->dai->codec_dai;
 	struct snd_soc_dai *cpu_dai = rtd->dai->cpu_dai;
+	unsigned int pll_out = 0;
 	unsigned int acds = 0;
 	unsigned int wm9713_div = 0;
 	int ret = 0;
@@ -102,13 +103,16 @@ static int zylonite_voice_hw_params(struct snd_pcm_substream *substream,
 	switch (params_rate(params)) {
 	case 8000:
 		wm9713_div = 12;
+		pll_out = 2048000;
 		break;
 	case 16000:
 		wm9713_div = 6;
+		pll_out = 4096000;
 		break;
 	case 48000:
 	default:
 		wm9713_div = 2;
+		pll_out = 12288000;
 		acds = 1;
 		break;
 	}
@@ -129,6 +133,10 @@ static int zylonite_voice_hw_params(struct snd_pcm_substream *substream,
 	if (ret < 0)
 		return ret;
 
+	ret = snd_soc_dai_set_pll(cpu_dai, 0, 0, pll_out);
+	if (ret < 0)
+		return ret;
+
 	ret = snd_soc_dai_set_clkdiv(cpu_dai, PXA_SSP_AUDIO_DIV_ACDS, acds);
 	if (ret < 0)
 		return ret;
Signature · 1 line
1.5.6.5
author
#6 lore raw

PATCH 6/9 ASoC: Fix spurious codec driver dependencies

Kbuild ignores dependency from things that are themselves selected so ASoC machine drivers need to ensure that the control bus is being built. This also avoids issues where multiple buses are supported by a given codec.

---
 sound/soc/codecs/Kconfig |    4 ----
 sound/soc/omap/Kconfig   |    4 ++--
 2 files changed, 2 insertions(+), 6 deletions(-)
sound/soc/codecs/Kconfig +0 -4
index cb5fcd6..656f180 100644
@@ -91,7 +91,6 @@ config SND_SOC_SSM2602
 
 config SND_SOC_TLV320AIC23
 	tristate
-	depends on I2C
 
 config SND_SOC_TLV320AIC26
 	tristate "TI TLV320AIC26 Codec support" if SND_SOC_OF_SIMPLE
@@ -99,15 +98,12 @@ config SND_SOC_TLV320AIC26
 
 config SND_SOC_TLV320AIC3X
 	tristate
-	depends on I2C
 
 config SND_SOC_TWL4030
 	tristate
-	depends on TWL4030_CORE
 
 config SND_SOC_UDA134X
        tristate
-       select SND_SOC_L3
 
 config SND_SOC_UDA1380
         tristate
sound/soc/omap/Kconfig +2 -2
index ccd8973..675732e 100644
@@ -8,7 +8,7 @@ config SND_OMAP_SOC_MCBSP
 
 config SND_OMAP_SOC_N810
 	tristate "SoC Audio support for Nokia N810"
-	depends on SND_OMAP_SOC && MACH_NOKIA_N810
+	depends on SND_OMAP_SOC && MACH_NOKIA_N810 && I2C
 	select SND_OMAP_SOC_MCBSP
 	select OMAP_MUX
 	select SND_SOC_TLV320AIC3X
@@ -17,7 +17,7 @@ config SND_OMAP_SOC_N810
 
 config SND_OMAP_SOC_OSK5912
 	tristate "SoC Audio support for omap osk5912"
-	depends on SND_OMAP_SOC && MACH_OMAP_OSK
+	depends on SND_OMAP_SOC && MACH_OMAP_OSK && I2C
 	select SND_OMAP_SOC_MCBSP
 	select SND_SOC_TLV320AIC23
 	help
Signature · 1 line
1.5.6.5
author
#7 lore raw

PATCH 7/9 ASoC: Add missing comma to SND_SOC_DAPM_SWITCH_E in soc-dapm.h

From: Peter Ujfalusi <[email protected]>

Typo fix.

---
 include/sound/soc-dapm.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
include/sound/soc-dapm.h +1 -1
index 93a4edb..dfa8049 100644
@@ -108,7 +108,7 @@
 #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \
 	wevent, wflags) \
 {	.id = snd_soc_dapm_switch, .name = wname, .reg = wreg, .shift = wshift, \
-	.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1 \
+	.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = 1, \
 	.event = wevent, .event_flags = wflags}
 #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \
 	wevent, wflags) \
Signature · 1 line
1.5.6.5
author
#8 lore raw

PATCH 8/9 ASoC: Include header file in cs4270 and wm9705

Ensures that the DAI and socdev exported by the codec match up with their exported prototype.

---
 sound/soc/codecs/cs4270.c |    2 ++
 sound/soc/codecs/wm9705.c |    2 ++
 2 files changed, 4 insertions(+), 0 deletions(-)
sound/soc/codecs/cs4270.c +2 -0
index 2e4ce04..e2130d7 100644
@@ -29,6 +29,8 @@
 #include <sound/initval.h>
 #include <linux/i2c.h>
 
+#include "cs4270.h"
+
 /* Private data for the CS4270 */
 struct cs4270_private {
 	unsigned int mclk; /* Input frequency of the MCLK pin */
sound/soc/codecs/wm9705.c +2 -0
index 5e1937a..d5c81bb 100644
@@ -20,6 +20,8 @@
 #include <sound/soc.h>
 #include <sound/soc-dapm.h>
 
+#include "wm9705.h"
+
 /*
  * WM9705 register cache
  */
Signature · 1 line
1.5.6.5
author
#9 lore raw

PATCH 9/9 ASoC: Fix L3 bus handling in Kconfig

It has no external dependencies but needs to be selected for L3 based codecs to work.

---
 sound/soc/codecs/Kconfig  |    1 +
 sound/soc/s3c24xx/Kconfig |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/codecs/Kconfig +1 -0
index 656f180..a195303 100644
@@ -10,6 +10,7 @@ config SND_SOC_I2C_AND_SPI
 
 config SND_SOC_ALL_CODECS
 	tristate "Build all ASoC CODEC drivers"
+	select SND_SOC_L3
 	select SND_SOC_AC97_CODEC if SND_SOC_AC97_BUS
 	select SND_SOC_AD1980 if SND_SOC_AC97_BUS
 	select SND_SOC_AD73311 if I2C
sound/soc/s3c24xx/Kconfig +1 -0
index fcd03ac..e05a710 100644
@@ -48,4 +48,5 @@ config SND_S3C24XX_SOC_S3C24XX_UDA134X
 	tristate "SoC I2S Audio support UDA134X wired to a S3C24XX"
        	depends on SND_S3C24XX_SOC
        	select SND_S3C24XX_SOC_I2S
+	select SND_SOC_L3
        	select SND_SOC_UDA134X
Signature · 1 line
1.5.6.5
#10 lore raw
In reply to Mark Brown

At Fri, 23 Jan 2009 17:16:19 +0000,

Quoted 11 lines · Mark Brown

The following changes since commit 56692396447ca3fee061c26f22590a1046fd2d6b:
Mark Brown (1):

        Merge branch 'for-2.6.29' into for-2.6.30

are available in the git repository at:

ssh://master.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.30

(the usual git URI should work eventually as well but the mirroring appears to be stuck right now and it's past 5pm on a Friday.)

Thanks, that works well.
Pulled in now.

Takashi