Skip to contentSkip to conversation

ASoC updates

PATCH In review Mark Brown 3 participants 7 messages Dec 18, 2008 – Dec 19, 2008

Subsystems (4)
lore
Share & tools
lore

Mark Brown

author
#0 lore raw

cover ASoC updates

The following changes since commit 49d92c7d5bbd158734bc34ed578a68b214a48583:
Stanley.Miao (1):
ASoC: TWL4030: hands-free start-up sequence.

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-tiwai

Alexander Beregalov (1):
ASoC: switch davinci DPRINTK to pr_debug()

Mark Brown (3):
ASoC: Ease merge difficulties from new architectures
ASoC: Complain if we fail to create DAPM controls
ASoC: Add WM8350 AudioPlus codec driver

 include/linux/mfd/wm8350/audio.h |   38 +-
 sound/soc/Kconfig                |   10 +-
 sound/soc/Makefile               |   12 +-
 sound/soc/codecs/Kconfig         |    4 +
 sound/soc/codecs/Makefile        |    2 +
 sound/soc/codecs/wm8350.c        | 1583 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/wm8350.h        |   20 +
 sound/soc/davinci/davinci-pcm.c  |   18 +-
 sound/soc/soc-dapm.c             |    6 +-
 9 files changed, 1669 insertions(+), 24 deletions(-)
 create mode 100644 sound/soc/codecs/wm8350.c
 create mode 100644 sound/soc/codecs/wm8350.h
author
#1 lore raw

PATCH 1/4 ASoC: switch davinci DPRINTK to pr_debug()

From: Alexander Beregalov <[email protected]>

---
 sound/soc/davinci/davinci-pcm.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)
sound/soc/davinci/davinci-pcm.c +6 -12
index bc83e1c..74abc9b 100644
@@ -14,6 +14,7 @@
 #include <linux/platform_device.h>
 #include <linux/slab.h>
 #include <linux/dma-mapping.h>
+#include <linux/kernel.h>
 
 #include <sound/core.h>
 #include <sound/pcm.h>
@@ -24,13 +25,6 @@
 
 #include "davinci-pcm.h"
 
-#define DAVINCI_PCM_DEBUG 0
-#if DAVINCI_PCM_DEBUG
-#define DPRINTK(x...) printk(KERN_DEBUG x)
-#else
-#define DPRINTK(x...)
-#endif
-
 static struct snd_pcm_hardware davinci_pcm_hardware = {
 	.info = (SNDRV_PCM_INFO_INTERLEAVED | SNDRV_PCM_INFO_BLOCK_TRANSFER |
 		 SNDRV_PCM_INFO_MMAP | SNDRV_PCM_INFO_MMAP_VALID |
@@ -78,8 +72,8 @@ static void davinci_pcm_enqueue_dma(struct snd_pcm_substream *substream)
 	dma_offset = prtd->period * period_size;
 	dma_pos = runtime->dma_addr + dma_offset;
 
-	DPRINTK("audio_set_dma_params_play channel = %d dma_ptr = %x "
-		"period_size=%x\n", lch, dma_pos, period_size);
+	pr_debug("davinci_pcm: audio_set_dma_params_play channel = %d "
+		"dma_ptr = %x period_size=%x\n", lch, dma_pos, period_size);
 
 	data_type = prtd->params->data_type;
 	count = period_size / data_type;
@@ -112,7 +106,7 @@ static void davinci_pcm_dma_irq(int lch, u16 ch_status, void *data)
 	struct snd_pcm_substream *substream = data;
 	struct davinci_runtime_data *prtd = substream->runtime->private_data;
 
-	DPRINTK("lch=%d, status=0x%x\n", lch, ch_status);
+	pr_debug("davinci_pcm: lch=%d, status=0x%x\n", lch, ch_status);
 
 	if (unlikely(ch_status != DMA_COMPLETE))
 		return;
@@ -316,8 +310,8 @@ static int davinci_pcm_preallocate_dma_buffer(struct snd_pcm *pcm, int stream)
 	buf->area = dma_alloc_writecombine(pcm->card->dev, size,
 					   &buf->addr, GFP_KERNEL);
 
-	DPRINTK("preallocate_dma_buffer: area=%p, addr=%p, size=%d\n",
-		(void *) buf->area, (void *) buf->addr, size);
+	pr_debug("davinci_pcm: preallocate_dma_buffer: area=%p, addr=%p, "
+		"size=%d\n", (void *) buf->area, (void *) buf->addr, size);
 
 	if (!buf->area)
 		return -ENOMEM;
Signature · 1 line
1.5.6.5
author
#2 lore raw

PATCH 2/4 ASoC: Ease merge difficulties from new architectures

Rather than listing lots of architectures per line in Kconfig and Makefile, causing merge conflicts all the time, have one per line in alphabetical order.

---
 sound/soc/Kconfig  |   10 +++++-----
 sound/soc/Makefile |   12 ++++++++++--
 2 files changed, 15 insertions(+), 7 deletions(-)
sound/soc/Kconfig +5 -5
index 615ebf0..ef025c6 100644
@@ -22,16 +22,16 @@ if SND_SOC
 config SND_SOC_AC97_BUS
 	bool
 
-# All the supported Soc's
+# All the supported SoCs
 source "sound/soc/atmel/Kconfig"
 source "sound/soc/au1x/Kconfig"
+source "sound/soc/blackfin/Kconfig"
+source "sound/soc/davinci/Kconfig"
+source "sound/soc/fsl/Kconfig"
+source "sound/soc/omap/Kconfig"
 source "sound/soc/pxa/Kconfig"
 source "sound/soc/s3c24xx/Kconfig"
 source "sound/soc/sh/Kconfig"
-source "sound/soc/fsl/Kconfig"
-source "sound/soc/davinci/Kconfig"
-source "sound/soc/omap/Kconfig"
-source "sound/soc/blackfin/Kconfig"
 
 # Supported codecs
 source "sound/soc/codecs/Kconfig"
sound/soc/Makefile +10 -2
index 4d475c3..86a9b1f 100644
@@ -1,5 +1,13 @@
 snd-soc-core-objs := soc-core.o soc-dapm.o
 
 obj-$(CONFIG_SND_SOC)	+= snd-soc-core.o
-obj-$(CONFIG_SND_SOC)	+= codecs/ atmel/ pxa/ s3c24xx/ sh/ fsl/ davinci/
-obj-$(CONFIG_SND_SOC)	+= omap/ au1x/ blackfin/
+obj-$(CONFIG_SND_SOC)	+= codecs/
+obj-$(CONFIG_SND_SOC)	+= atmel/
+obj-$(CONFIG_SND_SOC)	+= au1x/
+obj-$(CONFIG_SND_SOC)	+= blackfin/
+obj-$(CONFIG_SND_SOC)	+= davinci/
+obj-$(CONFIG_SND_SOC)	+= fsl/
+obj-$(CONFIG_SND_SOC)	+= omap/
+obj-$(CONFIG_SND_SOC)	+= pxa/
+obj-$(CONFIG_SND_SOC)	+= s3c24xx/
+obj-$(CONFIG_SND_SOC)	+= sh/
Signature · 1 line
1.5.6.5
author
#3 lore raw

PATCH 3/4 ASoC: Complain if we fail to create DAPM controls

This should never happen and it's helpful to identify the specific control that failed when it does happen.

---
 sound/soc/soc-dapm.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)
sound/soc/soc-dapm.c +5 -1
index 61d7d85..8863edd 100644
@@ -1320,8 +1320,12 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec,
 
 	for (i = 0; i < num; i++) {
 		ret = snd_soc_dapm_new_control(codec, widget);
-		if (ret < 0)
+		if (ret < 0) {
+			printk(KERN_ERR
+			       "ASoC: Failed to create DAPM control %s: %d\n",
+			       widget->name, ret);
 			return ret;
+		}
 		widget++;
 	}
 	return 0;
Signature · 1 line
1.5.6.5
author
#4 lore raw

PATCH 4/4 ASoC: Add WM8350 AudioPlus codec driver

The WM8350 is an integrated audio and power management subsystem which provides a single-chip solution for portable audio and multimedia systems.

The integrated audio CODEC provides all the necessary functions for high-quality stereo recording and playback. Programmable on-chip amplifiers allow for the direct connection of headphones and microphones with a minimum of external components. A programmable low-noise bias voltage is available to feed one or more electret microphones. Additional audio features include programmable high-pass filter in the ADC input path.

This driver was originally written by Liam Girdwood with further updates from me.

---
 include/linux/mfd/wm8350/audio.h |   38 +-
 sound/soc/codecs/Kconfig         |    4 +
 sound/soc/codecs/Makefile        |    2 +
 sound/soc/codecs/wm8350.c        | 1583 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/wm8350.h        |   20 +
 5 files changed, 1643 insertions(+), 4 deletions(-)
 create mode 100644 sound/soc/codecs/wm8350.c
 create mode 100644 sound/soc/codecs/wm8350.h
include/linux/mfd/wm8350/audio.h +34 -4
index 217bb22..af95a1d 100644
@@ -1,7 +1,7 @@
 /*
  * audio.h  --  Audio Driver for Wolfson WM8350 PMIC
  *
- * Copyright 2007 Wolfson Microelectronics PLC
+ * Copyright 2007, 2008 Wolfson Microelectronics PLC
  *
  *  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
@@ -70,9 +70,9 @@
 #define WM8350_CODEC_ISEL_0_5                   3	/* x0.5 */
 
 #define WM8350_VMID_OFF                         0
-#define WM8350_VMID_500K                        1
-#define WM8350_VMID_100K                        2
-#define WM8350_VMID_10K                         3
+#define WM8350_VMID_300K                        1
+#define WM8350_VMID_50K                         2
+#define WM8350_VMID_5K                          3
 
 /*
  * R40 (0x28) - Clock Control 1
@@ -591,8 +591,38 @@
 #define WM8350_IRQ_CODEC_MICSCD			41
 #define WM8350_IRQ_CODEC_MICD			42
 
+/*
+ * WM8350 Platform data.
+ *
+ * This must be initialised per platform for best audio performance.
+ * Please see WM8350 datasheet for information.
+ */
+struct wm8350_audio_platform_data {
+	int vmid_discharge_msecs;	/* VMID --> OFF discharge time */
+	int drain_msecs;	/* OFF drain time */
+	int cap_discharge_msecs;	/* Cap ON (from OFF) discharge time */
+	int vmid_charge_msecs;	/* vmid power up time */
+	u32 vmid_s_curve:2;	/* vmid enable s curve speed */
+	u32 dis_out4:2;		/* out4 discharge speed */
+	u32 dis_out3:2;		/* out3 discharge speed */
+	u32 dis_out2:2;		/* out2 discharge speed */
+	u32 dis_out1:2;		/* out1 discharge speed */
+	u32 vroi_out4:1;	/* out4 tie off */
+	u32 vroi_out3:1;	/* out3 tie off */
+	u32 vroi_out2:1;	/* out2 tie off */
+	u32 vroi_out1:1;	/* out1 tie off */
+	u32 vroi_enable:1;	/* enable tie off */
+	u32 codec_current_on:2;	/* current level ON */
+	u32 codec_current_standby:2;	/* current level STANDBY */
+	u32 codec_current_charge:2;	/* codec current @ vmid charge */
+};
+
+struct snd_soc_codec;
+
 struct wm8350_codec {
 	struct platform_device *pdev;
+	struct snd_soc_codec *codec;
+	struct wm8350_audio_platform_data *platform_data;
 };
 
 #endif
sound/soc/codecs/Kconfig +4 -0
index bf68052..c41289b 100644
@@ -13,6 +13,7 @@ config SND_SOC_ALL_CODECS
 	select SND_SOC_TWL4030 if TWL4030_CORE
 	select SND_SOC_UDA134X
 	select SND_SOC_UDA1380 if I2C
+	select SND_SOC_WM8350 if MFD_WM8350
 	select SND_SOC_WM8510 if (I2C || SPI_MASTER)
 	select SND_SOC_WM8580 if I2C
 	select SND_SOC_WM8728 if (I2C || SPI_MASTER)
@@ -100,6 +101,9 @@ config SND_SOC_UDA134X
 config SND_SOC_UDA1380
         tristate
 
+config SND_SOC_WM8350
+	tristate
+
 config SND_SOC_WM8510
 	tristate
 
sound/soc/codecs/Makefile +2 -0
index 9a20fdd..c4ddc9a 100644
@@ -12,6 +12,7 @@ snd-soc-tlv320aic3x-objs := tlv320aic3x.o
 snd-soc-twl4030-objs := twl4030.o
 snd-soc-uda134x-objs := uda134x.o
 snd-soc-uda1380-objs := uda1380.o
+snd-soc-wm8350-objs := wm8350.o
 snd-soc-wm8510-objs := wm8510.o
 snd-soc-wm8580-objs := wm8580.o
 snd-soc-wm8728-objs := wm8728.o
@@ -39,6 +40,7 @@ obj-$(CONFIG_SND_SOC_TLV320AIC3X)	+= snd-soc-tlv320aic3x.o
 obj-$(CONFIG_SND_SOC_TWL4030)	+= snd-soc-twl4030.o
 obj-$(CONFIG_SND_SOC_UDA134X)	+= snd-soc-uda134x.o
 obj-$(CONFIG_SND_SOC_UDA1380)	+= snd-soc-uda1380.o
+obj-$(CONFIG_SND_SOC_WM8350)	+= snd-soc-wm8350.o
 obj-$(CONFIG_SND_SOC_WM8510)	+= snd-soc-wm8510.o
 obj-$(CONFIG_SND_SOC_WM8580)	+= snd-soc-wm8580.o
 obj-$(CONFIG_SND_SOC_WM8728)	+= snd-soc-wm8728.o
sound/soc/codecs/wm8350.c new file +1583 -0

1,583 lines not on this page · raw message

sound/soc/codecs/wm8350.h new file +20 -0
new file mode 100644
index 0000000..cc2887a
@@ -0,0 +1,20 @@
+/*
+ * wm8350.h - WM8903 audio codec interface
+ *
+ * Copyright 2008 Wolfson Microelectronics PLC.
+ *
+ *  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 _WM8350_H
+#define _WM8350_H
+
+#include <sound/soc.h>
+
+extern struct snd_soc_dai wm8350_dai;
+extern struct snd_soc_codec_device soc_codec_dev_wm8350;
+
+#endif
Signature · 1 line
1.5.6.5
#5 lore raw

Re: [PATCH 4/4] ASoC: Add WM8350 AudioPlus codec driver

Quoted 11 lines · Mark Brown

The WM8350 is an integrated audio and power management subsystem which provides a single-chip solution for portable audio and multimedia systems.

The integrated audio CODEC provides all the necessary functions for high-quality stereo recording and playback. Programmable on-chip amplifiers allow for the direct connection of headphones and microphones with a minimum of external components. A programmable low-noise bias voltage is available to feed one or more electret microphones. Additional audio features include programmable high-pass filter in the ADC input path.

Quoted 4 lines

This driver was originally written by Liam Girdwood with further updates from me.

Liam

#6 lore raw
In reply to Mark Brown

At Thu, 18 Dec 2008 17:30:21 +0000,

Quoted 8 lines · Mark Brown

The following changes since commit 49d92c7d5bbd158734bc34ed578a68b214a48583:
Stanley.Miao (1):
ASoC: TWL4030: hands-free start-up sequence.

are available in the git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-tiwai

Applied now. Thanks.

Takashi

Quoted 22 lines

Alexander Beregalov (1):
ASoC: switch davinci DPRINTK to pr_debug()

Mark Brown (3):
ASoC: Ease merge difficulties from new architectures
ASoC: Complain if we fail to create DAPM controls
ASoC: Add WM8350 AudioPlus codec driver

 include/linux/mfd/wm8350/audio.h |   38 +-
 sound/soc/Kconfig                |   10 +-
 sound/soc/Makefile               |   12 +-
 sound/soc/codecs/Kconfig         |    4 +
 sound/soc/codecs/Makefile        |    2 +
 sound/soc/codecs/wm8350.c        | 1583 ++++++++++++++++++++++++++++++++++++++
 sound/soc/codecs/wm8350.h        |   20 +
 sound/soc/davinci/davinci-pcm.c  |   18 +-
 sound/soc/soc-dapm.c             |    6 +-
 9 files changed, 1669 insertions(+), 24 deletions(-)
 create mode 100644 sound/soc/codecs/wm8350.c
 create mode 100644 sound/soc/codecs/wm8350.h