ASoC updates for 2.6.31
Subsystems (7)
The following changes since commit 34e51ce60a210094bd66cf0a75dd8512247618ca:
Takashi Iwai (1):
Merge branch 'for-2.6.30' of git://git.kernel.org/.../broonie/sound-2.6 into topic/asoc
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git for-2.6.31
Alexander Beregalov (1):
ASoC: n810: replace BUG() with BUG_ON()
Daniel Glöckner (3):
ASoC: Add driver for s6000 I2S interface
ASoC: s6105 IP camera machine specific ASoC code
ASoC: correct s6000 I2S clock polarity
Daniel Ribeiro (1):
ASoC: pxa-ssp.c fix clock/frame invert
Mark Brown (11):
ASoC: Display return code when failing to add a DAPM kcontrol
ASoC: Provide core support for symmetric sample rates
ASoC: Add WM8988 CODEC driver
Merge branch 's6000' into for-2.6.31
ASoC: WM9713 requires symmetric rates on the voice DAI
ASoC: Factor out application of power for generic widgets
ASoC: Support DAPM events for DACs and ADCs
ASoC: Move the WM9713 voice DAC powerdown to a DAPM event
ASoC: Add WM8960 CODEC driver
Merge branch 'for-2.6.30' into for-2.6.31
Merge branch 'for-2.6.30' into for-2.6.31
Peter Ujfalusi (1):
ASoC: tlv320aic23: add DSP_A format support
include/sound/soc-dai.h | 1 + include/sound/soc-dapm.h | 10 + include/sound/soc.h | 6 + sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/codecs/Kconfig | 8 + sound/soc/codecs/Makefile | 4 + sound/soc/codecs/tlv320aic23.c | 2 + sound/soc/codecs/wm8960.c | 969 +++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8960.h | 127 +++++ sound/soc/codecs/wm8988.c | 1097 ++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8988.h | 60 +++ sound/soc/codecs/wm9713.c | 40 +- sound/soc/omap/n810.c | 7 +- sound/soc/pxa/pxa-ssp.c | 11 +- sound/soc/s6000/Kconfig | 19 + sound/soc/s6000/Makefile | 11 + sound/soc/s6000/s6000-i2s.c | 629 +++++++++++++++++++++++ sound/soc/s6000/s6000-i2s.h | 25 + sound/soc/s6000/s6000-pcm.c | 497 ++++++++++++++++++ sound/soc/s6000/s6000-pcm.h | 35 ++ sound/soc/s6000/s6105-ipcam.c | 244 +++++++++ sound/soc/soc-core.c | 38 ++ sound/soc/soc-dapm.c | 131 +++--- 24 files changed, 3893 insertions(+), 80 deletions(-) create mode 100644 sound/soc/codecs/wm8960.c create mode 100644 sound/soc/codecs/wm8960.h create mode 100644 sound/soc/codecs/wm8988.c create mode 100644 sound/soc/codecs/wm8988.h create mode 100644 sound/soc/s6000/Kconfig create mode 100644 sound/soc/s6000/Makefile create mode 100644 sound/soc/s6000/s6000-i2s.c create mode 100644 sound/soc/s6000/s6000-i2s.h create mode 100644 sound/soc/s6000/s6000-pcm.c create mode 100644 sound/soc/s6000/s6000-pcm.h create mode 100644 sound/soc/s6000/s6105-ipcam.c
PATCH 1/14 ASoC: Add driver for s6000 I2S interface
From: Daniel Glöckner <[email protected]>
This patch adds a driver for the I2S interface found on Stretch s6000 family processors.
--- sound/soc/Kconfig | 1 + sound/soc/Makefile | 1 + sound/soc/s6000/Kconfig | 10 + sound/soc/s6000/Makefile | 6 + sound/soc/s6000/s6000-i2s.c | 629 +++++++++++++++++++++++++++++++++++++++++++ sound/soc/s6000/s6000-i2s.h | 25 ++ sound/soc/s6000/s6000-pcm.c | 497 ++++++++++++++++++++++++++++++++++ sound/soc/s6000/s6000-pcm.h | 35 +++ 8 files changed, 1204 insertions(+), 0 deletions(-) create mode 100644 sound/soc/s6000/Kconfig create mode 100644 sound/soc/s6000/Makefile create mode 100644 sound/soc/s6000/s6000-i2s.c create mode 100644 sound/soc/s6000/s6000-i2s.h create mode 100644 sound/soc/s6000/s6000-pcm.c create mode 100644 sound/soc/s6000/s6000-pcm.h
sound/soc/Kconfig +1 -0
@@ -32,6 +32,7 @@ source "sound/soc/fsl/Kconfig" source "sound/soc/omap/Kconfig" source "sound/soc/pxa/Kconfig" source "sound/soc/s3c24xx/Kconfig" +source "sound/soc/s6000/Kconfig" source "sound/soc/sh/Kconfig" # Supported codecs
sound/soc/Makefile +1 -0
@@ -10,4 +10,5 @@ obj-$(CONFIG_SND_SOC) += fsl/ obj-$(CONFIG_SND_SOC) += omap/ obj-$(CONFIG_SND_SOC) += pxa/ obj-$(CONFIG_SND_SOC) += s3c24xx/ +obj-$(CONFIG_SND_SOC) += s6000/ obj-$(CONFIG_SND_SOC) += sh/
sound/soc/s6000/Kconfig new file +10 -0
@@ -0,0 +1,10 @@ +config SND_S6000_SOC + tristate "SoC Audio for the Stretch s6000 family" + depends on XTENSA_VARIANT_S6000 + help + Say Y or M if you want to add support for codecs attached to + s6000 family chips. You will also need to select the platform + to support below. + +config SND_S6000_SOC_I2S + tristate
sound/soc/s6000/Makefile new file +6 -0
@@ -0,0 +1,6 @@ +# s6000 Platform Support +snd-soc-s6000-objs := s6000-pcm.o +snd-soc-s6000-i2s-objs := s6000-i2s.o + +obj-$(CONFIG_SND_S6000_SOC) += snd-soc-s6000.o +obj-$(CONFIG_SND_S6000_SOC_I2S) += snd-soc-s6000-i2s.o
sound/soc/s6000/s6000-i2s.c new file +629 -0
629 lines not on this page · raw message
sound/soc/s6000/s6000-i2s.h new file +25 -0
@@ -0,0 +1,25 @@ +/* +* ALSA SoC I2S Audio Layer for the Stretch s6000 family +* +* Author: Daniel Gloeckner, <[email protected]> +* Copyright: (C) 2009 emlix GmbH <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _S6000_I2S_H +#define _S6000_I2S_H + +extern struct snd_soc_dai s6000_i2s_dai; + +struct s6000_snd_platform_data { +int lines_in; +int lines_out; +int channel_in; +int channel_out; +int wide; +int same_rate; +}; +#endif
sound/soc/s6000/s6000-pcm.c new file +497 -0
497 lines not on this page · raw message
sound/soc/s6000/s6000-pcm.h new file +35 -0
@@ -0,0 +1,35 @@ +/* +* ALSA PCM interface for the Stretch s6000 family +* +* Author: Daniel Gloeckner, <[email protected]> +* Copyright: (C) 2009 emlix GmbH <[email protected]> +* +* This program is free software; you can redistribute it and/or modify +* it under the terms of the GNU General Public License version 2 as +* published by the Free Software Foundation. +*/ + +#ifndef _S6000_PCM_H +#define _S6000_PCM_H + +struct snd_soc_dai ; +struct snd_pcm_substream ; + +struct s6000_pcm_dma_params { +unsigned int (*check_xrun)(struct snd_soc_dai *cpu_dai); +int (*trigger)(struct snd_pcm_substream *substream,int cmd,int after); +dma_addr_t sif_in; +dma_addr_t sif_out; +u32 dma_in; +u32 dma_out; +int irq; +int same_rate; + +spinlock_t lock; +int in_use; +int rate; +}; + +extern struct snd_soc_platform s6000_soc_platform; + +#endif
Signature · 6 lines
1.6.2.2 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 2/14 ASoC: s6105 IP camera machine specific ASoC code
In reply to Mark BrownFrom: Daniel Glöckner <[email protected]>
This patch adds machine specific code for the audio part of the Stretch s6105 IP camera reference design.
The device uses the tlv320aic31(01) codec to generate the clock for both I2S ports of the soc. While the master clock is generated by a configurable PLL chip, the code assumes the factory default settings.
An additional kcontrol has been added to handle the special routing of the board, connecting both HPLCOM and HPROUT to the same pin of the audio jack. One of these should always be switched off.
--- sound/soc/s6000/Kconfig | 9 ++ sound/soc/s6000/Makefile | 5 + sound/soc/s6000/s6105-ipcam.c | 244 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 258 insertions(+), 0 deletions(-) create mode 100644 sound/soc/s6000/s6105-ipcam.c
sound/soc/s6000/Kconfig +9 -0
@@ -8,3 +8,12 @@ config SND_S6000_SOC config SND_S6000_SOC_I2S tristate + +config SND_S6000_SOC_S6IPCAM + tristate "SoC Audio support for Stretch 6105 IP Camera" + depends on SND_S6000_SOC && XTENSA_PLATFORM_S6105 + select SND_S6000_SOC_I2S + select SND_SOC_TLV320AIC3X + help + Say Y if you want to add support for SoC audio on the + Stretch s6105 IP Camera Reference Design.
sound/soc/s6000/Makefile +5 -0
@@ -4,3 +4,8 @@ snd-soc-s6000-i2s-objs := s6000-i2s.o obj-$(CONFIG_SND_S6000_SOC) += snd-soc-s6000.o obj-$(CONFIG_SND_S6000_SOC_I2S) += snd-soc-s6000-i2s.o + +# s6105 Machine Support +snd-soc-s6ipcam-objs := s6105-ipcam.o + +obj-$(CONFIG_SND_S6000_SOC_S6IPCAM) += snd-soc-s6ipcam.o
sound/soc/s6000/s6105-ipcam.c new file +244 -0
244 lines not on this page · raw message
Signature · 6 lines
1.6.2.2 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 1/1 mx31ads: Depend on all the WM8350 core dependencies for WM1133-EV1 board
In reply to Mark BrownOtherwise we'd need massive ifdefs in the code.
--- arch/arm/mach-mx3/Kconfig | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-mx3/Kconfig +2 -0
@@ -19,6 +19,8 @@ config MACH_MX31ADS config MACH_MX31ADS_WM1133_EV1 bool "Support Wolfson Microelectronics 1133-EV1 module" depends on MACH_MX31ADS + depends on MFD_WM8350_I2C + depends on REGULATOR_WM8350 select MFD_WM8350_CONFIG_MODE_0 select MFD_WM8352_CONFIG_MODE_0 help
Signature · 1 line
1.6.2.2
PATCH 3/14 ASoC: correct s6000 I2S clock polarity
In reply to Mark BrownFrom: Daniel Glöckner <[email protected]>
According to the data sheet data is clocked out on the falling edge and latched on the rising edge of the bit clock. While the left sample is transmitted the word clock line is low.
--- sound/soc/s6000/s6000-i2s.c | 4 ++-- sound/soc/s6000/s6105-ipcam.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
sound/soc/s6000/s6000-i2s.c +2 -2
@@ -252,10 +252,10 @@ static int s6000_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, }switch (fmt &SND_SOC_DAIFMT_INV_MASK ) { -case SND_SOC_DAIFMT_IB_IF : +case SND_SOC_DAIFMT_NB_NF : w |=S6_I2S_LEFT_FIRST ;break ; -case SND_SOC_DAIFMT_IB_NF : +case SND_SOC_DAIFMT_NB_IF : w |=S6_I2S_RIGHT_FIRST ;break ;default :
sound/soc/s6000/s6105-ipcam.c +1 -1
@@ -43,7 +43,7 @@ static int s6105_hw_params(struct snd_pcm_substream *substream,/* set cpu DAI configuration */ ret =snd_soc_dai_set_fmt (cpu_dai,SND_SOC_DAIFMT_CBM_CFM | -SND_SOC_DAIFMT_IB_IF ); +SND_SOC_DAIFMT_NB_NF );if (ret <0 )return ret;
Signature · 6 lines
1.6.2.2 _______________________________________________ Alsa-devel mailing list [email protected] http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
PATCH 6/14 ASoC: Add WM8988 CODEC driver
In reply to Mark BrownThe WM8988 is a low power, high quality stereo CODEC designed for portable digital audio applications.
The device integrates complete interfaces to 2 stereo headphone or line out ports. External component requirements are drastically reduced as no separate headphone amplifiers are required. Advanced on-chip digital signal processing performs graphic equaliser, 3-D sound enhancement and automatic level control for the microphone or line input.
The WM8988 can operate as a master or a slave, with various master clock frequencies including 12 or 24MHz for USB devices, or standard 256fs rates like 12.288MHz and 24.576MHz. Different audio sample rates such as 96kHz, 48kHz, 44.1kHz are generated directly from the master clock without the need for an external PLL.
--- sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/wm8988.c | 1097 +++++++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8988.h | 60 +++ 4 files changed, 1163 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/wm8988.c create mode 100644 sound/soc/codecs/wm8988.h
sound/soc/codecs/Kconfig +4 -0
@@ -36,6 +36,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_WM8900 if I2C select SND_SOC_WM8903 if I2C select SND_SOC_WM8971 if I2C + select SND_SOC_WM8988 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8990 if I2C select SND_SOC_WM9705 if SND_SOC_AC97_BUS select SND_SOC_WM9712 if SND_SOC_AC97_BUS
@@ -141,6 +142,9 @@ config SND_SOC_WM8903 config SND_SOC_WM8971 tristate +config SND_SOC_WM8988 + tristate + config SND_SOC_WM8990 tristate
sound/soc/codecs/Makefile +2 -0
@@ -24,6 +24,7 @@ snd-soc-wm8753-objs := wm8753.o snd-soc-wm8900-objs := wm8900.o snd-soc-wm8903-objs := wm8903.o snd-soc-wm8971-objs := wm8971.o +snd-soc-wm8988-objs := wm8988.o snd-soc-wm8990-objs := wm8990.o snd-soc-wm9705-objs := wm9705.o snd-soc-wm9712-objs := wm9712.o
@@ -55,6 +56,7 @@ obj-$(CONFIG_SND_SOC_WM8753) += snd-soc-wm8753.o obj-$(CONFIG_SND_SOC_WM8900) += snd-soc-wm8900.o obj-$(CONFIG_SND_SOC_WM8903) += snd-soc-wm8903.o obj-$(CONFIG_SND_SOC_WM8971) += snd-soc-wm8971.o +obj-$(CONFIG_SND_SOC_WM8988) += snd-soc-wm8988.o obj-$(CONFIG_SND_SOC_WM8990) += snd-soc-wm8990.o obj-$(CONFIG_SND_SOC_WM8991) += snd-soc-wm8991.o obj-$(CONFIG_SND_SOC_WM9705) += snd-soc-wm9705.o
sound/soc/codecs/wm8988.c new file +1097 -0
1,097 lines not on this page · raw message
sound/soc/codecs/wm8988.h new file +60 -0
60 lines not on this page · raw message
Signature · 1 line
1.6.2.2
PATCH 8/14 ASoC: n810: replace BUG() with BUG_ON()
In reply to Mark BrownFrom: Alexander Beregalov <[email protected]>
--- sound/soc/omap/n810.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-)
sound/soc/omap/n810.c +3 -4
@@ -383,10 +383,9 @@ static int __init n810_soc_init(void)clk_set_parent (sys_clkout2_src, func96m_clk);clk_set_rate (sys_clkout2,12000000 ); -if (gpio_request (N810_HEADSET_AMP_GPIO ,"hs_amp" ) <0 ) -BUG (); -if (gpio_request (N810_SPEAKER_AMP_GPIO ,"spk_amp" ) <0 ) -BUG (); +BUG_ON ((gpio_request (N810_HEADSET_AMP_GPIO ,"hs_amp" ) <0 ) || + (gpio_request (N810_SPEAKER_AMP_GPIO ,"spk_amp" ) <0 )); +gpio_direction_output (N810_HEADSET_AMP_GPIO ,0 );gpio_direction_output (N810_SPEAKER_AMP_GPIO ,0 );
Signature · 1 line
1.6.2.2
PATCH 10/14 ASoC: Factor out application of power for generic widgets
In reply to Mark BrownThis is simple code motion, intended to support future refactoring of the DAPM algorithms and (more immediately) the additon of events for DACs and ADCs.
--- sound/soc/soc-dapm.c | 110 +++++++++++++++++++++++++++----------------------- 1 files changed, 60 insertions(+), 50 deletions(-)
sound/soc/soc-dapm.c +60 -50
@@ -522,6 +522,65 @@ int dapm_reg_event(struct snd_soc_dapm_widget *w, }EXPORT_SYMBOL_GPL (dapm_reg_event); +/* Standard power change method, used to apply power changes to most +* widgets. +*/ +static int dapm_generic_apply_power (struct snd_soc_dapm_widget *w) +{ +int ret; + +/* call any power change event handlers */ +if (w->event) +pr_debug ("power %s event for %s flags %x\n" , + w->power ?"on" :"off" , + w->name, w->event_flags); + +/* power up pre event */ +if (w->power && w->event && + (w->event_flags &SND_SOC_DAPM_PRE_PMU )) { + ret = w->event (w,NULL ,SND_SOC_DAPM_PRE_PMU ); +if (ret <0 ) +return ret; + } + +/* power down pre event */ +if (!w->power && w->event && + (w->event_flags &SND_SOC_DAPM_PRE_PMD )) { + ret = w->event (w,NULL ,SND_SOC_DAPM_PRE_PMD ); +if (ret <0 ) +return ret; + } + +/* Lower PGA volume to reduce pops */ +if (w->id == snd_soc_dapm_pga && !w->power) +dapm_set_pga (w, w->power); + +dapm_update_bits (w); + +/* Raise PGA volume to reduce pops */ +if (w->id == snd_soc_dapm_pga && w->power) +dapm_set_pga (w, w->power); + +/* power up post event */ +if (w->power && w->event && + (w->event_flags &SND_SOC_DAPM_POST_PMU )) { + ret = w->event (w, +NULL ,SND_SOC_DAPM_POST_PMU ); +if (ret <0 ) +return ret; + } + +/* power down post event */ +if (!w->power && w->event && + (w->event_flags &SND_SOC_DAPM_POST_PMD )) { + ret = w->event (w,NULL ,SND_SOC_DAPM_POST_PMD ); +if (ret <0 ) +return ret; + } + +return 0 ; +} +/* * Scan a single DAPM widget for a complete audio path and update the * power status appropriately.
@@ -601,56 +660,7 @@ static int dapm_power_widget(struct snd_soc_codec *codec, int event,if (!power_change)return 0 ; -/* call any power change event handlers */ -if (w->event) -pr_debug ("power %s event for %s flags %x\n" , - w->power ?"on" :"off" , - w->name, w->event_flags); - -/* power up pre event */ -if (power && w->event && - (w->event_flags &SND_SOC_DAPM_PRE_PMU )) { - ret = w->event (w,NULL ,SND_SOC_DAPM_PRE_PMU ); -if (ret <0 ) -return ret; - } - -/* power down pre event */ -if (!power && w->event && - (w->event_flags &SND_SOC_DAPM_PRE_PMD )) { - ret = w->event (w,NULL ,SND_SOC_DAPM_PRE_PMD ); -if (ret <0 ) -return ret; - } - -/* Lower PGA volume to reduce pops */ -if (w->id == snd_soc_dapm_pga && !power) -dapm_set_pga (w, power); - -dapm_update_bits (w); - -/* Raise PGA volume to reduce pops */ -if (w->id == snd_soc_dapm_pga && power) -dapm_set_pga (w, power); - -/* power up post event */ -if (power && w->event && - (w->event_flags &SND_SOC_DAPM_POST_PMU )) { - ret = w->event (w, -NULL ,SND_SOC_DAPM_POST_PMU ); -if (ret <0 ) -return ret; - } - -/* power down post event */ -if (!power && w->event && - (w->event_flags &SND_SOC_DAPM_POST_PMD )) { - ret = w->event (w,NULL ,SND_SOC_DAPM_POST_PMD ); -if (ret <0 ) -return ret; - } - -return 0 ; +return dapm_generic_apply_power (w); }/*
Signature · 1 line
1.6.2.2
PATCH 4/14 ASoC: Display return code when failing to add a DAPM kcontrol
In reply to Mark Brown--- sound/soc/soc-dapm.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
sound/soc/soc-dapm.c +3 -2
@@ -357,8 +357,9 @@ static int dapm_new_mixer(struct snd_soc_codec *codec, path->long_name); ret =snd_ctl_add (codec->card, path->kcontrol);if (ret <0 ) { -printk (KERN_ERR "asoc: failed to add dapm kcontrol %s\n" , - path->long_name); +printk (KERN_ERR "asoc: failed to add dapm kcontrol %s: %d\n" , + path->long_name, + ret);kfree (path->long_name); path->long_name =NULL ;return ret;
Signature · 1 line
1.6.2.2
PATCH 5/14 ASoC: Provide core support for symmetric sample rates
In reply to Mark BrownMany devices require symmetric configurations of capture and playback data formats, often due to shared clocking but sometimes also due to other shared playback and record configuration in the device. Start providing core support for this by allowing the DAIs or the machine to specify that the sample rates used should be kept symmetric.
A flag symmetric_rates is provided in the snd_soc_dai and snd_soc_dai_link structures. If this is set in either of the DAIs or in the machine then a constraint will be applied when a stream is already open preventing any changes in sample rate.
--- include/sound/soc-dai.h | 1 + include/sound/soc.h | 6 ++++++ sound/soc/soc-core.c | 38 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+), 0 deletions(-)
include/sound/soc-dai.h +1 -0
@@ -208,6 +208,7 @@ struct snd_soc_dai {/* DAI capabilities */ struct snd_soc_pcm_stream capture;struct snd_soc_pcm_stream playback; + unsigned int symmetric_rates:1;/* DAI runtime info */ struct snd_pcm_runtime *runtime;
include/sound/soc.h +6 -0
@@ -417,6 +417,12 @@ struct snd_soc_dai_link {/* codec/machine specific init - e.g. add machine controls */ int (*init)(struct snd_soc_codec *codec); +/* Symmetry requirements */ + unsigned int symmetric_rates:1; + +/* Symmetry data - only valid if symmetry is being enforced */ +unsigned int rate; +/* DAI pcm */ struct snd_pcm *pcm; };
sound/soc/soc-core.c +38 -0
@@ -113,6 +113,35 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec) }#endif +static int soc_pcm_apply_symmetry (struct snd_pcm_substream *substream) +{ +struct snd_soc_pcm_runtime *rtd = substream->private_data; +struct snd_soc_device *socdev = rtd->socdev; +struct snd_soc_card *card = socdev->card; +struct snd_soc_dai_link *machine = rtd->dai; +struct snd_soc_dai *cpu_dai = machine->cpu_dai; +struct snd_soc_dai *codec_dai = machine->codec_dai; +int ret; + +if (codec_dai->symmetric_rates || cpu_dai->symmetric_rates || + machine->symmetric_rates) { +dev_dbg (card->dev,"Symmetry forces %dHz rate\n" , + machine->rate); + + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_RATE , + machine->rate, + machine->rate); +if (ret <0 ) { +dev_err (card->dev, +"Unable to apply rate symmetry constraint: %d\n" , ret); +return ret; + } + } + +return 0 ; +} +/* * Called by ALSA when a PCM substream is opened, the runtime->hw record is * then initialized and any private data can be allocated. This also calls
@@ -221,6 +250,13 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) goto machine_err; } +/* Symmetry only applies if we've already got an active stream. */ +if (cpu_dai->active || codec_dai->active) { + ret =soc_pcm_apply_symmetry (substream); +if (ret !=0 ) + goto machine_err; + } +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,
@@ -521,6 +557,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, } } + machine->rate =params_rate (params); + out:mutex_unlock (&pcm_mutex);return ret;
Signature · 1 line
1.6.2.2
PATCH 7/14 ASoC: tlv320aic23: add DSP_A format support
In reply to Mark BrownFrom: Peter Ujfalusi <[email protected]>
Add DSP_A interface format support by setting the LRP bit in DSP mode.
--- sound/soc/codecs/tlv320aic23.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-)
sound/soc/codecs/tlv320aic23.c +2 -0
@@ -523,6 +523,8 @@ static int tlv320aic23_set_dai_fmt(struct snd_soc_dai *codec_dai,case SND_SOC_DAIFMT_I2S : iface_reg |=TLV320AIC23_FOR_I2S ;break ; +case SND_SOC_DAIFMT_DSP_A : + iface_reg |=TLV320AIC23_LRP_ON ;case SND_SOC_DAIFMT_DSP_B : iface_reg |=TLV320AIC23_FOR_DSP ;break ;
Signature · 1 line
1.6.2.2
PATCH 9/14 ASoC: WM9713 requires symmetric rates on the voice DAI
In reply to Mark Brown--- sound/soc/codecs/wm9713.c | 1 + 1 files changed, 1 insertions(+), 0 deletions(-)
sound/soc/codecs/wm9713.c +1 -0
@@ -1069,6 +1069,7 @@ struct snd_soc_dai wm9713_dai[] = { .rates = WM9713_PCM_RATES, .formats = WM9713_PCM_FORMATS,}, .ops = &wm9713_dai_ops_voice, + .symmetric_rates = 1, }, };EXPORT_SYMBOL_GPL (wm9713_dai);
Signature · 1 line
1.6.2.2
PATCH 11/14 ASoC: Support DAPM events for DACs and ADCs
In reply to Mark Brown--- include/sound/soc-dapm.h | 10 ++++++++++ sound/soc/soc-dapm.c | 16 ++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-)
include/sound/soc-dapm.h +10 -0
@@ -140,9 +140,19 @@#define SND_SOC_DAPM_DAC (wname, stname, wreg, wshift, winvert) \ { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ .shift = wshift, .invert = winvert} +#define SND_SOC_DAPM_DAC_E (wname, stname, wreg, wshift, winvert, \ + wevent, wflags) \ +{ .id = snd_soc_dapm_dac, .name = wname, .sname = stname, .reg = wreg, \ + .shift = wshift, .invert = winvert, \ + .event = wevent, .event_flags = wflags}#define SND_SOC_DAPM_ADC (wname, stname, wreg, wshift, winvert) \ { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ .shift = wshift, .invert = winvert} +#define SND_SOC_DAPM_ADC_E (wname, stname, wreg, wshift, winvert, \ + wevent, wflags) \ +{ .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ + .shift = wshift, .invert = winvert, \ + .event = wevent, .event_flags = wflags}/* generic register modifier widget */ #define SND_SOC_DAPM_REG (wid, wname, wreg, wshift, wmask, won_val, woff_val) \
sound/soc/soc-dapm.c +10 -6
@@ -598,18 +598,22 @@ static int dapm_power_widget(struct snd_soc_codec *codec, int event,if (w->id == snd_soc_dapm_adc && w->active) { in =is_connected_input_ep (w);dapm_clear_walk (w->codec); - w->power = (in !=0 ) ?1 :0 ; -dapm_update_bits (w); -return 0 ; + power = (in !=0 ) ?1 :0 ; +if (power == w->power) +return 0 ; + w->power = power; +return dapm_generic_apply_power (w); }/* active DAC */ if (w->id == snd_soc_dapm_dac && w->active) { out =is_connected_output_ep (w);dapm_clear_walk (w->codec); - w->power = (out !=0 ) ?1 :0 ; -dapm_update_bits (w); -return 0 ; + power = (out !=0 ) ?1 :0 ; +if (power == w->power) +return 0 ; + w->power = power; +return dapm_generic_apply_power (w); }/* pre and post event widgets */
Signature · 1 line
1.6.2.2
PATCH 12/14 ASoC: Move the WM9713 voice DAC powerdown to a DAPM event
In reply to Mark BrownThis ensures that we sync with the DAPM powerdown sequencing properly and don't need to bounce the power on the voice DAC so often.
--- sound/soc/codecs/wm9713.c | 39 ++++++++++++++++++++++----------------- 1 files changed, 22 insertions(+), 17 deletions(-)
sound/soc/codecs/wm9713.c +22 -17
@@ -189,6 +189,26 @@ SOC_SINGLE("3D Lower Cut-off Switch", AC97_REC_GAIN_MIC, 4, 1, 0), SOC_SINGLE("3D Depth", AC97_REC_GAIN_MIC, 0, 15, 1), }; +static int wm9713_voice_shutdown (struct snd_soc_dapm_widget *w, +struct snd_kcontrol *kcontrol,int event) +{ +struct snd_soc_codec *codec = w->codec; +u16 status, rate; + +BUG_ON (event !=SND_SOC_DAPM_PRE_PMD ); + +/* Gracefully shut down the voice interface. */ + status =ac97_read (codec,AC97_EXTENDED_MID ) |0x1000 ; + rate =ac97_read (codec,AC97_HANDSET_RATE ) &0xF0FF ; +ac97_write (codec,AC97_HANDSET_RATE , rate |0x0200 ); +schedule_timeout_interruptible (msecs_to_jiffies (1 )); +ac97_write (codec,AC97_HANDSET_RATE , rate |0x0F00 ); +ac97_write (codec,AC97_EXTENDED_MID , status); + +return 0 ; +} + +/* We have to create a fake left and right HP mixers because * the codec only has a single control that is shared by both channels. * This makes it impossible to determine the audio path using the current
@@ -400,7 +420,8 @@ SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_NOPM, 0, 0, NULL, 0),SND_SOC_DAPM_MIXER ("HP Mixer" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("Line Mixer" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ),SND_SOC_DAPM_MIXER ("Capture Mixer" ,SND_SOC_NOPM ,0 ,0 ,NULL ,0 ), -SND_SOC_DAPM_DAC ("Voice DAC" ,"Voice Playback" ,AC97_EXTENDED_MID ,12 ,1 ), +SND_SOC_DAPM_DAC_E ("Voice DAC" ,"Voice Playback" ,AC97_EXTENDED_MID ,12 ,1 , + wm9713_voice_shutdown,SND_SOC_DAPM_PRE_PMD ),SND_SOC_DAPM_DAC ("Aux DAC" ,"Aux Playback" ,AC97_EXTENDED_MID ,11 ,1 ),SND_SOC_DAPM_PGA ("Left ADC" ,AC97_EXTENDED_MID ,5 ,1 ,NULL ,0 ), SND_SOC_DAPM_PGA("Right ADC", AC97_EXTENDED_MID, 4, 1, NULL, 0),
@@ -936,21 +957,6 @@ static int wm9713_pcm_hw_params(struct snd_pcm_substream *substream,return 0 ; } -static void wm9713_voiceshutdown (struct snd_pcm_substream *substream, -struct snd_soc_dai *dai) -{ -struct snd_soc_codec *codec = dai->codec; -u16 status, rate; - -/* Gracefully shut down the voice interface. */ - status =ac97_read (codec,AC97_EXTENDED_STATUS ) |0x1000 ; - rate =ac97_read (codec,AC97_HANDSET_RATE ) &0xF0FF ; -ac97_write (codec,AC97_HANDSET_RATE , rate |0x0200 ); -schedule_timeout_interruptible (msecs_to_jiffies (1 )); -ac97_write (codec,AC97_HANDSET_RATE , rate |0x0F00 ); -ac97_write (codec,AC97_EXTENDED_MID , status); -} -static int ac97_hifi_prepare (struct snd_pcm_substream *substream,struct snd_soc_dai *dai) {
@@ -1019,7 +1025,6 @@ static struct snd_soc_dai_ops wm9713_dai_ops_aux = {static struct snd_soc_dai_ops wm9713_dai_ops_voice = { .hw_params = wm9713_pcm_hw_params, - .shutdown = wm9713_voiceshutdown, .set_clkdiv = wm9713_set_dai_clkdiv, .set_pll = wm9713_set_dai_pll, .set_fmt = wm9713_set_dai_fmt,
Signature · 1 line
1.6.2.2
PATCH 13/14 ASoC: pxa-ssp.c fix clock/frame invert
In reply to Mark BrownFrom: Daniel Ribeiro <[email protected]>
SCMODE(0): Data Driven (Falling), Data Sampled (Rising), Idle State (Low) SCMODE(1): Data Driven (Rising), Data Sampled (Falling), Idle State (Low) SCMODE(2): Data Driven (Rising), Data Sampled (Falling), Idle State (High) SCMODE(3): Data Driven (Falling), Data Sampled (Rising), Idle State (High)
SCMODE(3) does not invert the clock polarity compared to the default SCMODE(0).
This patch also adds all possible NF/IF, NB/IB combinations to the DSP_A and DSP_B modes.
--- sound/soc/pxa/pxa-ssp.c | 11 ++++++++++- 1 files changed, 10 insertions(+), 1 deletions(-)
sound/soc/pxa/pxa-ssp.c +10 -1
@@ -568,7 +568,10 @@ static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai,case SND_SOC_DAIFMT_NB_IF :break ;case SND_SOC_DAIFMT_IB_IF : - sspsp |=SSPSP_SCMODE (3 ); + sspsp |=SSPSP_SCMODE (2 ); +break ; +case SND_SOC_DAIFMT_IB_NF : + sspsp |=SSPSP_SCMODE (2 ) |SSPSP_SFRMP ;break ;default :return -EINVAL ;
@@ -585,7 +588,13 @@ static int pxa_ssp_set_dai_fmt(struct snd_soc_dai *cpu_dai,case SND_SOC_DAIFMT_NB_NF : sspsp |=SSPSP_SFRMP ;break ; +case SND_SOC_DAIFMT_NB_IF : +break ;case SND_SOC_DAIFMT_IB_IF : + sspsp |=SSPSP_SCMODE (2 ); +break ; +case SND_SOC_DAIFMT_IB_NF : + sspsp |=SSPSP_SCMODE (2 ) |SSPSP_SFRMP ;break ;default :return -EINVAL ;
Signature · 1 line
1.6.2.2
PATCH 14/14 ASoC: Add WM8960 CODEC driver
In reply to Mark BrownThe WM8960 is a low power, high quality stereo codec designed for portable digital audio applications.
Stereo class D speaker drivers provide 1W per channel into 8W loads. Guaranteed low leakage, excellent PSRR and pop/click suppression mechanisms enable direct battery connection for the speaker supply.
The device also integrates a complete microphone interface and a stereo headphone driver. External component requirements are drastically reduced as no separate microphone, speaker or headphone amplifiers are required. Advanced on-chip digital signal processing performs automatic level control for the microphone or line input.
Stereo 24-bit sigma-delta ADCs and DACs are used with low power over-sampling digital interpolation and decimation filters and a flexible digital audio interface.
The master clock can be input directly or generated internally by an onboard PLL, supporting most commonly-used clocking schemes.
This driver was originally written by Liam Girdwood, with substantial subsequent additions and updates for feature completeness and changes in the ASoC framework from me.
--- sound/soc/codecs/Kconfig | 4 + sound/soc/codecs/Makefile | 2 + sound/soc/codecs/wm8960.c | 969 +++++++++++++++++++++++++++++++++++++++++++++ sound/soc/codecs/wm8960.h | 127 ++++++ 4 files changed, 1102 insertions(+), 0 deletions(-) create mode 100644 sound/soc/codecs/wm8960.c create mode 100644 sound/soc/codecs/wm8960.h
sound/soc/codecs/Kconfig +4 -0
@@ -35,6 +35,7 @@ config SND_SOC_ALL_CODECS select SND_SOC_WM8753 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8900 if I2C select SND_SOC_WM8903 if I2C + select SND_SOC_WM8960 if I2C select SND_SOC_WM8971 if I2C select SND_SOC_WM8988 if SND_SOC_I2C_AND_SPI select SND_SOC_WM8990 if I2C
@@ -139,6 +140,9 @@ config SND_SOC_WM8900 config SND_SOC_WM8903 tristate +config SND_SOC_WM8960 + tristate + config SND_SOC_WM8971 tristate
sound/soc/codecs/Makefile +2 -0
@@ -23,6 +23,7 @@ snd-soc-wm8750-objs := wm8750.o snd-soc-wm8753-objs := wm8753.o snd-soc-wm8900-objs := wm8900.o snd-soc-wm8903-objs := wm8903.o +snd-soc-wm8960-objs := wm8960.o snd-soc-wm8971-objs := wm8971.o snd-soc-wm8988-objs := wm8988.o snd-soc-wm8990-objs := wm8990.o
@@ -56,6 +57,7 @@ obj-$(CONFIG_SND_SOC_WM8753) += snd-soc-wm8753.o obj-$(CONFIG_SND_SOC_WM8900) += snd-soc-wm8900.o obj-$(CONFIG_SND_SOC_WM8903) += snd-soc-wm8903.o obj-$(CONFIG_SND_SOC_WM8971) += snd-soc-wm8971.o +obj-$(CONFIG_SND_SOC_WM8960) += snd-soc-wm8960.o obj-$(CONFIG_SND_SOC_WM8988) += snd-soc-wm8988.o obj-$(CONFIG_SND_SOC_WM8990) += snd-soc-wm8990.o obj-$(CONFIG_SND_SOC_WM8991) += snd-soc-wm8991.o
sound/soc/codecs/wm8960.c new file +969 -0
969 lines not on this page · raw message
sound/soc/codecs/wm8960.h new file +127 -0
127 lines not on this page · raw message
Signature · 1 line
1.6.2.2
Re: [PATCH] mx31ads: Depend on all the WM8350 core dependencies for WM1133-EV1 board
In reply to Mark BrownQuoted 1 line · Mark Brown
Otherwise we'd need massive ifdefs in the code.
Sorry, forgot to delete this before sending - it's not in the branch I requested that you pull.
Re: [PATCH 05/14] ASoC: Provide core support for symmetric sample rates
In reply to Mark BrownQuoted 11 lines · On Tuesday 14 April 2009 15:33:04 ext Mark Brown wrote:
Many devices require symmetric configurations of capture and playback data formats, often due to shared clocking but sometimes also due to other shared playback and record configuration in the device. Start providing core support for this by allowing the DAIs or the machine to specify that the sample rates used should be kept symmetric.
A flag
symmetric_ratesis provided in thesnd_soc_daiandsnd_soc_dai_linkstructures. If this is set in either of the DAIs or in the machine then a constraint will be applied when a stream is already open preventing any changes in sample rate.
sound/soc/soc-core.c static int soc_ac97_dev_register(struct snd_soc_codec *codec) · line 134
Quoted 5 lines
sound/soc/soc-core.c +5
-0+ + ret =snd_pcm_hw_constraint_minmax (substream->runtime, +SNDRV_PCM_HW_PARAM_RATE , + machine->rate, + machine->rate);
Would it make sense to add also the channel count and probably sample_bits as constraint as well here?
I think the symmetric means that you should not be able to change any of the parameters.
Signature · 1 line
Péter
Re: [PATCH 05/14] ASoC: Provide core support for symmetric sample rates
Quoted 9 lines · Peter Ujfalusi
Quoted 2 lines · On Tuesday 14 April 2009 15:33:04 ext Mark Brown wrote:
Many devices require symmetric configurations of capture and playback data formats, often due to shared clocking but sometimes also due to
Would it make sense to add also the channel count and probably
sample_bitsas constraint as well here?
I think the symmetric means that you should not be able to change any of the parameters.
Yes, we should have something for those but they are a bit more complex:
normally with bit clock the restriction is actually that you need to have at least as many clocks as the format needs but can have more. This means that rather than an absolute symmetry requirement you end up setting a reduced maximum for both directions.
The two limits play into each other with DSP mode too: you can have twice as many channels in the same number of bit clocks if you halve the sameple size. For I2S style modes the channel count doesn't tend to be restricted since you always have the clocks for two channels even if you're only looking at one.