ASoC updates for next
Subsystems (5)
cover ASoC updates for next
The following changes since commit 15ad9a531a64d46af54839ab13542a81ad4c82a5:
Takashi Iwai (1):
Merge branch 'topic/fix/asoc' into topic/asoc
are available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asoc for-tiwai
Mark Brown (6):
ASoC: Fix handling of DAPM suspend work
ASoC: Convert core to use standard debug print macros
ASoC: Remove DAPM restriction on mixer control name lengths
ASoC: Add PXA SSP support
ASoC: Do a warm reset after cold when resetting the WM9713
ASoC: Use finer grained dependencies in SND_SOC_ALL_CODECS
Timur Tabi (1):
ASoC: Disable automatic volume control in the CS4270 sound driver
Troy Kisky (1):
ASoC: Allow setting codec register with debugfs filesystem
include/sound/soc.h | 4 + sound/soc/codecs/Kconfig | 44 ++- sound/soc/codecs/cs4270.c | 13 + sound/soc/codecs/wm9713.c | 2 + sound/soc/pxa/Kconfig | 13 + sound/soc/pxa/Makefile | 2 + sound/soc/pxa/pxa-ssp.c | 929 +++++++++++++++++++++++++++++++++++++++++++++ sound/soc/pxa/pxa-ssp.h | 47 +++ sound/soc/soc-core.c | 207 ++++++++--- sound/soc/soc-dapm.c | 44 +-- 10 files changed, 1200 insertions(+), 105 deletions(-) create mode 100644 sound/soc/pxa/pxa-ssp.c create mode 100644 sound/soc/pxa/pxa-ssp.h
PATCH 1/8 ASoC: Allow setting codec register with debugfs filesystem
From: Troy Kisky <[email protected]>
i.e. echo 6 59 >/sys/kernel/debug/soc-audio.0/codec_reg will set register 0x06 to a value of 0x59.
Also, pop_time debugfs interface setup is moved so that it is setup in the same function as codec_reg
--- include/sound/soc.h | 4 ++ sound/soc/soc-core.c | 116 ++++++++++++++++++++++++++++++++++++++++++++++++- sound/soc/soc-dapm.c | 33 +++----------- 3 files changed, 125 insertions(+), 28 deletions(-)
include/sound/soc.h +4 -0
@@ -425,6 +425,7 @@ struct snd_soc_codec {short reg_cache_step;/* dapm */ +u32 pop_time;struct list_head dapm_widgets;struct list_head dapm_paths;enum snd_soc_bias_level bias_level;
@@ -516,6 +517,9 @@ struct snd_soc_device {struct delayed_work delayed_work;struct work_struct deferred_resume_work;void *codec_data; +#ifdef CONFIG_DEBUG_FS +struct dentry *debugfs_root; +#endif };/* runtime channel data */
sound/soc/soc-core.c +113 -3
149 lines not on this page · raw message
sound/soc/soc-dapm.c +8 -25
@@ -37,7 +37,6 @@#include <linux/bitops.h> #include <linux/platform_device.h> #include <linux/jiffies.h> -#include <linux/debugfs.h> #include <sound/core.h> #include <sound/pcm.h> #include <sound/pcm_params.h>
@@ -67,17 +66,13 @@ static int dapm_status = 1;module_param (dapm_status, int,0 );MODULE_PARM_DESC (dapm_status,"enable DPM sysfs entries" ); -static struct dentry *asoc_debugfs; - -static u32 pop_time; - -static void pop_wait (void ) +static void pop_wait (u32 pop_time) {if (pop_time)schedule_timeout_uninterruptible (msecs_to_jiffies (pop_time)); } -static void pop_dbg (const char *fmt, ...) +static void pop_dbg (u32 pop_time,const char *fmt, ...) {va_list args;
@@ -85,7 +80,7 @@ static void pop_dbg(const char *fmt, ...)if (pop_time) {vprintk (fmt, args); -pop_wait (); +pop_wait (pop_time); }va_end (args);
@@ -230,10 +225,11 @@ static int dapm_update_bits(struct snd_soc_dapm_widget *widget) change = old != new;if (change) { -pop_dbg ("pop test %s : %s in %d ms\n" , widget->name, - widget->power ?"on" :"off" , pop_time); +pop_dbg (codec->pop_time,"pop test %s : %s in %d ms\n" , + widget->name, widget->power ?"on" :"off" , + codec->pop_time);snd_soc_write (codec, widget->reg, new); -pop_wait (); +pop_wait (codec->pop_time); }pr_debug ("reg %x old %x new %x change %d\n" , widget->reg, old, new, change);
@@ -821,23 +817,13 @@ static DEVICE_ATTR(dapm_widget, 0444, dapm_widget_show, NULL);int snd_soc_dapm_sys_add (struct device *dev) { -int ret =0 ; -if (!dapm_status)return 0 ; ret =device_create_file (dev, &dev_attr_dapm_widget);if (ret !=0 )return ret; - - asoc_debugfs =debugfs_create_dir ("asoc" ,NULL ); -if (!IS_ERR (asoc_debugfs) && asoc_debugfs) -debugfs_create_u32 ("dapm_pop_time" ,0744 , asoc_debugfs, - &pop_time); -else - asoc_debugfs =NULL ; - -return 0 ; +return device_create_file (dev, &dev_attr_dapm_widget); }static void snd_soc_dapm_sys_remove (struct device *dev)
@@ -845,9 +831,6 @@ static void snd_soc_dapm_sys_remove(struct device *dev)if (dapm_status) {device_remove_file (dev, &dev_attr_dapm_widget); } - -if (asoc_debugfs) -debugfs_remove_recursive (asoc_debugfs); }/* free all dapm widgets and resources */
Signature · 1 line
1.5.6.5
PATCH 2/8 ASoC: Fix handling of DAPM suspend work
From: Mark Brown <[email protected]>
Since we can query the playback stream power state directly we do not need to infer if it is powered up from the timer being scheduled. Doing this avoids problems that previously existed with streams being incorrectly determined to be powered up caused when the timer is scheduled when streams are closed after being partially set up.
--- sound/soc/soc-core.c | 55 ++++++++++++++++++++----------------------------- 1 files changed, 23 insertions(+), 32 deletions(-)
sound/soc/soc-core.c +23 -32
@@ -429,51 +429,42 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) } } -/* we only want to start a DAPM playback stream if we are not waiting -* on an existing one stopping */ -if (codec_dai->pop_wait) { -/* we are waiting for the delayed work to start */ -if (substream->stream ==SNDRV_PCM_STREAM_CAPTURE ) -snd_soc_dapm_stream_event (socdev->codec, - codec_dai->capture.stream_name, -SND_SOC_DAPM_STREAM_START ); -else { - codec_dai->pop_wait =0 ; -cancel_delayed_work (&socdev->delayed_work); -snd_soc_dai_digital_mute (codec_dai,0 ); - } - }else { -/* no delayed work - do we need to power up codec */ -if (codec->bias_level !=SND_SOC_BIAS_ON ) { +/* cancel any delayed stream shutdown that is pending */ +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK && + codec_dai->pop_wait) { + codec_dai->pop_wait =0 ; +cancel_delayed_work (&socdev->delayed_work); + } -snd_soc_dapm_set_bias_level (socdev, -SND_SOC_BIAS_PREPARE ); +/* do we need to power up codec */ +if (codec->bias_level !=SND_SOC_BIAS_ON ) { +snd_soc_dapm_set_bias_level (socdev, +SND_SOC_BIAS_PREPARE ); -if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) -snd_soc_dapm_stream_event (codec, +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) +snd_soc_dapm_stream_event (codec, codec_dai->playback.stream_name,SND_SOC_DAPM_STREAM_START ); -else -snd_soc_dapm_stream_event (codec, +else +snd_soc_dapm_stream_event (codec, codec_dai->capture.stream_name,SND_SOC_DAPM_STREAM_START ); -snd_soc_dapm_set_bias_level (socdev,SND_SOC_BIAS_ON ); -snd_soc_dai_digital_mute (codec_dai,0 ); +snd_soc_dapm_set_bias_level (socdev,SND_SOC_BIAS_ON ); +snd_soc_dai_digital_mute (codec_dai,0 ); - }else { -/* codec already powered - power on widgets */ -if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) -snd_soc_dapm_stream_event (codec, + }else { +/* codec already powered - power on widgets */ +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) +snd_soc_dapm_stream_event (codec, codec_dai->playback.stream_name,SND_SOC_DAPM_STREAM_START ); -else -snd_soc_dapm_stream_event (codec, +else +snd_soc_dapm_stream_event (codec, codec_dai->capture.stream_name,SND_SOC_DAPM_STREAM_START ); -snd_soc_dai_digital_mute (codec_dai,0 ); - } +snd_soc_dai_digital_mute (codec_dai,0 ); } out:
Signature · 1 line
1.5.6.5
PATCH 3/8 ASoC: Convert core to use standard debug print macros
--- sound/soc/soc-core.c | 36 ++++++++++++++---------------------- 1 files changed, 14 insertions(+), 22 deletions(-)
sound/soc/soc-core.c +14 -22
@@ -35,14 +35,6 @@#include <sound/soc-dapm.h> #include <sound/initval.h> -/* debug */ -#define SOC_DEBUG 0 -#if SOC_DEBUG -#define dbg(format, arg...) printk(format, ## arg) -#else -#define dbg(format, arg...) -#endif -static DEFINE_MUTEX (pcm_mutex);static DEFINE_MUTEX (io_mutex);static DECLARE_WAIT_QUEUE_HEAD (soc_pm_waitq);
@@ -229,12 +221,12 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) goto machine_err; } -dbg ("asoc: %s <-> %s info:\n" , codec_dai->name, cpu_dai->name); -dbg ("asoc: rate mask 0x%x\n" , runtime->hw.rates); -dbg ("asoc: min ch %d max ch %d\n" , runtime->hw.channels_min, - runtime->hw.channels_max); -dbg ("asoc: min rate %d max rate %d\n" , runtime->hw.rate_min, - runtime->hw.rate_max); +pr_debug ("asoc: %s <-> %s info:\n" , codec_dai->name, cpu_dai->name); +pr_debug ("asoc: rate mask 0x%x\n" , runtime->hw.rates); +pr_debug ("asoc: min ch %d max ch %d\n" , runtime->hw.channels_min, + runtime->hw.channels_max); +pr_debug ("asoc: min rate %d max rate %d\n" , runtime->hw.rate_min, + runtime->hw.rate_max);if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK ) cpu_dai->playback.active = codec_dai->playback.active =1 ;
@@ -279,18 +271,18 @@ static void close_delayed_work(struct work_struct *work)for (i =0 ; i < codec->num_dai; i++) { codec_dai = &codec->dai[i]; -dbg ("pop wq checking: %s status: %s waiting: %s\n" , - codec_dai->playback.stream_name, - codec_dai->playback.active ?"active" :"inactive" , - codec_dai->pop_wait ?"yes" :"no" ); +pr_debug ("pop wq checking: %s status: %s waiting: %s\n" , + codec_dai->playback.stream_name, + codec_dai->playback.active ?"active" :"inactive" , + codec_dai->pop_wait ?"yes" :"no" );/* are we waiting on this codec DAI stream */ if (codec_dai->pop_wait ==1 ) {/* Reduce power if no longer active */ if (codec->active ==0 ) { -dbg ("pop wq D1 %s %s\n" , codec->name, - codec_dai->playback.stream_name); +pr_debug ("pop wq D1 %s %s\n" , codec->name, + codec_dai->playback.stream_name);snd_soc_dapm_set_bias_level (socdev,SND_SOC_BIAS_PREPARE ); }
@@ -302,8 +294,8 @@ static void close_delayed_work(struct work_struct *work)/* Fall into standby if no longer active */ if (codec->active ==0 ) { -dbg ("pop wq D3 %s %s\n" , codec->name, - codec_dai->playback.stream_name); +pr_debug ("pop wq D3 %s %s\n" , codec->name, + codec_dai->playback.stream_name);snd_soc_dapm_set_bias_level (socdev,SND_SOC_BIAS_STANDBY ); }
Signature · 1 line
1.5.6.5
PATCH 4/8 ASoC: Remove DAPM restriction on mixer control name lengths
As well as ensuring that UI-relevant parts of control names don't get truncated in the DAPM code this avoids conflicts in long control names that differ only at the end of a long string.
--- sound/soc/soc-dapm.c | 11 ++++++++--- 1 files changed, 8 insertions(+), 3 deletions(-)
sound/soc/soc-dapm.c +8 -3
@@ -289,7 +289,7 @@ static int dapm_new_mixer(struct snd_soc_codec *codec, struct snd_soc_dapm_widget *w) {int i, ret =0 ; -char name[32 ]; +size_t name_len;struct snd_soc_dapm_path *path;/* add kcontrol */
@@ -303,11 +303,16 @@ static int dapm_new_mixer(struct snd_soc_codec *codec,continue ;/* add dapm control with long name */ -snprintf (name,32 ,"%s %s" , w->name, w->kcontrols[i].name); - path->long_name =kstrdup (name,GFP_KERNEL ); + name_len =2 +strlen (w->name) + +strlen (w->kcontrols[i].name); + path->long_name =kmalloc (name_len,GFP_KERNEL );if (path->long_name ==NULL )return -ENOMEM ; +snprintf (path->long_name, name_len,"%s %s" , + w->name, w->kcontrols[i].name); + path->long_name[name_len -1 ] ='\0' ; + path->kcontrol =snd_soc_cnew (&w->kcontrols[i], w, path->long_name); ret =snd_ctl_add (codec->card, path->kcontrol);
Signature · 1 line
1.5.6.5
PATCH 5/8 ASoC: Add PXA SSP support
The SSP ports PXA series processors can be used to implement a variety of audio interface formats. This patch implements support for I2S, DSP A and DSP B modes on these ports.
This patch is based on the previous out of tree pxa2xx-ssp driver (which was originally written by Liam Girdwood with updates from Philipp Zabel and Nicola Perrino) and pxa3xx-ssp driver (originally written by Seth Forsee based on the pxa2xx-ssp driver). Testing coverage is not complete currently.
--- sound/soc/pxa/Kconfig | 13 + sound/soc/pxa/Makefile | 2 + sound/soc/pxa/pxa-ssp.c | 929 +++++++++++++++++++++++++++++++++++++++++++++++ sound/soc/pxa/pxa-ssp.h | 47 +++ 4 files changed, 991 insertions(+), 0 deletions(-) create mode 100644 sound/soc/pxa/pxa-ssp.c create mode 100644 sound/soc/pxa/pxa-ssp.h
sound/soc/pxa/Kconfig +13 -0
@@ -21,6 +21,9 @@ config SND_PXA2XX_SOC_AC97 config SND_PXA2XX_SOC_I2S tristate +config SND_PXA_SOC_SSP + tristate + config SND_PXA2XX_SOC_CORGI tristate "SoC Audio support for Sharp Zaurus SL-C7x0" depends on SND_PXA2XX_SOC && PXA_SHARP_C7xx
@@ -75,3 +78,13 @@ config SND_PXA2XX_SOC_EM_X270 help Say Y if you want to add support for SoC audio on CompuLab EM-x270. + +config SND_SOC_ZYLONITE + tristate "SoC Audio support for Marvell Zylonite" + depends on SND_PXA2XX_SOC && MACH_ZYLONITE + select SND_PXA2XX_SOC_AC97 + select SND_PXA_SOC_SSP + select SND_SOC_WM9713 + help + Say Y if you want to add support for SoC audio on the + Marvell Zylonite reference platform.
sound/soc/pxa/Makefile +2 -0
@@ -2,10 +2,12 @@ snd-soc-pxa2xx-objs := pxa2xx-pcm.o snd-soc-pxa2xx-ac97-objs := pxa2xx-ac97.o snd-soc-pxa2xx-i2s-objs := pxa2xx-i2s.o +snd-soc-pxa-ssp-objs := pxa-ssp.o obj-$(CONFIG_SND_PXA2XX_SOC) += snd-soc-pxa2xx.o obj-$(CONFIG_SND_PXA2XX_SOC_AC97) += snd-soc-pxa2xx-ac97.o obj-$(CONFIG_SND_PXA2XX_SOC_I2S) += snd-soc-pxa2xx-i2s.o +obj-$(CONFIG_SND_PXA_SOC_SSP) += snd-soc-pxa-ssp.o # PXA Machine Support snd-soc-corgi-objs := corgi.o
sound/soc/pxa/pxa-ssp.c new file +929 -0
929 lines not on this page · raw message
sound/soc/pxa/pxa-ssp.h new file +47 -0
47 lines not on this page · raw message
Signature · 1 line
1.5.6.5
PATCH 6/8 ASoC: Do a warm reset after cold when resetting the WM9713
The WM9713 comes out of cold reset in low power mode so always requires a warm reset to bring up the AC97 link after a cold reset.
--- sound/soc/codecs/wm9713.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/codecs/wm9713.c +2 -0
@@ -1097,6 +1097,8 @@ int wm9713_reset(struct snd_soc_codec *codec, int try_warm) } soc_ac97_ops.reset (codec->ac97); +if (soc_ac97_ops.warm_reset) + soc_ac97_ops.warm_reset (codec->ac97);if (ac97_read (codec,0 ) != wm9713_reg[0 ])return -EIO ;return 0 ;
Signature · 1 line
1.5.6.5
PATCH 7/8 ASoC: Use finer grained dependencies in SND_SOC_ALL_CODECS
Move the bus dependencies in SND_SOC_ALL_CODECS into the individual codec options rather than have them centrally. This allows the inclusion of AC97 codecs when testing on platforms with AC97 support and will also handle codecs on multi-function devices more gracefully.
--- sound/soc/codecs/Kconfig | 44 ++++++++++++++++++++++++-------------------- 1 files changed, 24 insertions(+), 20 deletions(-)
sound/soc/codecs/Kconfig +24 -20
@@ -1,31 +1,35 @@ config SND_SOC_ALL_CODECS tristate "Build all ASoC CODEC drivers" - depends on I2C - select SPI - select SPI_MASTER - select SND_SOC_AD73311 - select SND_SOC_AK4535 - select SND_SOC_CS4270 - select SND_SOC_SSM2602 - select SND_SOC_TLV320AIC23 - select SND_SOC_TLV320AIC26 - select SND_SOC_TLV320AIC3X - select SND_SOC_UDA1380 - select SND_SOC_WM8510 - select SND_SOC_WM8580 - select SND_SOC_WM8731 - select SND_SOC_WM8750 - select SND_SOC_WM8753 - select SND_SOC_WM8900 - select SND_SOC_WM8903 - select SND_SOC_WM8971 - select SND_SOC_WM8990 + select SND_SOC_AC97 if SND_SOC_AC97_BUS + select SND_SOC_AD1980 if SND_SOC_AC97_BUS + select SND_SOC_AD73311 if I2C + select SND_SOC_AK4535 if I2C + select SND_SOC_CS4270 if I2C + select SND_SOC_SSM2602 if I2C + select SND_SOC_TLV320AIC23 if I2C + select SND_SOC_TLV320AIC26 if SPI_MASTER + select SND_SOC_TLV320AIC3X if I2C + select SND_SOC_UDA1380 if I2C + select SND_SOC_WM8510 if (I2C || SPI_MASTER) + select SND_SOC_WM8580 if I2C + select SND_SOC_WM8731 if (I2C || SPI_MASTER) + select SND_SOC_WM8750 if (I2C || SPI_MASTER) + select SND_SOC_WM8753 if (I2C || SPI_MASTER) + select SND_SOC_WM8900 if I2C + select SND_SOC_WM8903 if I2C + select SND_SOC_WM8971 if I2C + select SND_SOC_WM8990 if I2C + select SND_SOC_WM9712 if SND_SOC_AC97_BUS + select SND_SOC_WM9713 if SND_SOC_AC97_BUS help Normally ASoC codec drivers are only built if a machine driver which uses them is also built since they are only usable with a machine driver. Selecting this option will allow these drivers to be built without an explicit machine driver for test and development purposes. + Support for the bus types used to access the codecs to be built must + be selected separately. + If unsure select "N".
Signature · 1 line
1.5.6.5
PATCH 8/8 ASoC: Disable automatic volume control in the CS4270 sound driver
From: Timur Tabi <[email protected]>
Disable the automatic volume control feature of the CS4270 audio codec. This feature, which is enabled by default, causes volume change commands to be delayed. Sometimes the volume change happens after playback is started.
--- sound/soc/codecs/cs4270.c | 13 +++++++++++++ 1 files changed, 13 insertions(+), 0 deletions(-)
sound/soc/codecs/cs4270.c +13 -0
@@ -450,6 +450,19 @@ static int cs4270_hw_params(struct snd_pcm_substream *substream,return ret; } +/* Disable automatic volume control. It's enabled by default, and +* it causes volume change commands to be delayed, sometimes until +* after playback has started. +*/ + + reg =cs4270_read_reg_cache (codec,CS4270_TRANS ); + reg &= ~(CS4270_TRANS_SOFT |CS4270_TRANS_ZERO ); + ret =cs4270_i2c_write (codec,CS4270_TRANS , reg); +if (ret <0 ) { +printk (KERN_ERR "I2C write failed\n" ); +return ret; + } +/* Thaw and power-up the codec */ ret =snd_soc_write (codec,CS4270_PWRCTL ,0 );
Signature · 1 line
1.5.6.5
At Thu, 30 Oct 2008 15:57:18 +0000,
Quoted 8 lines · Mark Brown
The following changes since commit
15ad9a531a64d46af54839ab13542a81ad4c82a5:
Takashi Iwai (1):
Merge branch 'topic/fix/asoc' into topic/asocare available in the git repository at:
git://opensource.wolfsonmicro.com/linux-2.6-asocfor-tiwai
Thanks, pulled in, pushed out now.
Takashi