aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs
AgeCommit message (Collapse)Author
2009-02-13ASoC: add additional controls to the CS4270 codec driverTimur Tabi
Update the CS4270 codec driver to allow applications to use the mixer to control Digital Loopback, Soft Ramp, Zero Cross, Popguard, and Auto-Mute. Soft Ramp, Zero Cross, and Auto-Mute are disabled by the driver when it first initializes the hardware, but these features either don't work or interfere with normal ALSA behavior. However, they can now be re-enabled by an application if desired. Remove CONFIG_SND_SOC_CS4270_HWMUTE and always allow ASoC to control the mute bits. The driver previously and erroneously assumed that these bits control only external muting circuitry, but they also control internal muting circuitry, so they should always be used. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-09ASoC: TLV320AIC3X: Add TLV information for volume controlsJarkko Nikula
TLV320AIC3X volume controls are logarithmic. Export their dB ranges. Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-09ASoC: TLV320AIC3X: Fix volume rangesJarkko Nikula
This is a minor fix but helps to define dB ranges for volume controls. Only DAC digital volume has full register value range from 0 to 127 but ADC PGA gain and output stage volume controls don't. For ADC PGA, maximum value is 119 and then it saturates to the same gain value of 59.5 dB. For output stages, value 117 corresponds to -78.3 dB and is muted for values 118 and above. Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-06Merge branch 'for-2.6.29' into for-2.6.30Mark Brown
2009-02-06ASoC: WM8990: Fix kcontrol's private value use in put callbackJarkko Nikula
Function wm899x_outpga_put_volsw_vu misuses the kcontrol's private value by still accessing it as bitfields even SOC_SINGLE_VALUE constructs it as a pointer into struct soc_mixer_control after the commit 4eaa9819dc08d7bfd1065ce530e31b18a119dcaf. This is very similar fix than fix to TLV320AIC3X codec made by Eero Nurkkala <ext-eero.nurkkala@nokia.com>. This fix is compile tested only. Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com> Cc: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-06ASoC: TLV320AIC3X: Fix kcontrol's private value use in put callbackEero Nurkkala
Function snd_soc_dapm_put_volsw_aic3x misuses the kcontrol's private value by still accessing it as bitfields even SOC_SINGLE_VALUE constructs it as a pointer into struct soc_mixer_control after the commit 4eaa9819dc08d7bfd1065ce530e31b18a119dcaf. This was causing arbitrary register writes when touching the controls defined with SOC_DAPM_SINGLE_AIC3X. Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com> Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-04ASoC: uda1380: split set_dai_fmt into _both, _playback and _capture variantsPhilipp Zabel
This patch splits set_dai_fmt into three variants (single interface, dual interface playback only, dual interface capture only) so that data input and output formats can be configured separately for dual interface setups. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Tested-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-03ASoC: Don't unconditionally use the PLL in UDA1380Vasily Khoruzhick
Without this fix driver switches to WSPLL in uda1380_pcm_prepare even if SYSCLK was chosen (uda1380_pcm_prepare modifies UDA1380_CLK register to disable R00_DAC_CLK before flushing reg cache) Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-03Merge branch 'fix/asoc' into topic/asocTakashi Iwai
2009-02-03ALSA: ASoC: email - update email addresses.Liam Girdwood
This just updates my email address on some drivers I'd forgotten in a previous patch. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-02ASoC: fix message display in CS4270 codec driverTimur Tabi
Replace printk calls with dev_xxx calls. Set the 'dev' field of the codec and codec_dai structures so that these calls work. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-02ASoC: fix build break in CS4270 codec driverTimur Tabi
Fix a oversight in the CS4270 codec driver that caused a build break. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-31ASoC: fix documentation in CS4270 codec driverTimur Tabi
Spruce up the documentation in the CS4270 codec. Use kerneldoc where appropriate. Fix incorrect comments. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-30ASoC: fix initialization order of the CS4270 codec driverTimur Tabi
ASoC codec drivers typically serve two masters: the I2C bus and ASoC itself. When a codec driver registers with ASoC, a probe function is called. Most codec drivers call ASoC first, and then register with the I2C bus in the ASoC probe function. However, in order to support multiple codecs on one board, it's easier if the codec driver is probed via the I2C bus first. This is because the call to i2c_add_driver() can result in the I2C probe function being called multiple times - once for each codec. In the current design, the driver registers once with ASoC, and in the ASoC probe function, it calls i2c_add_driver(). The results in the I2C probe function being called multiple times before the driver can register with ASoC again. The new design has the driver call i2c_add_driver() first. In the I2C probe function, the driver registers with ASoC. This allows the ASoC probe function to be called once per I2C device. Also add code to check if the I2C probe function is called more than once, since that is not supported with the current ASoC design. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-29ASoC: TWL4030: Add analog loopback supportPeter Ujfalusi
This patch adds the analog loopback/bypass support for twl4030 codec. Details for the implementation: It seams that the analog loopback needs the DAC powered on on the channel, where the loopback is selected. The switch for the DACs has been moved from the DAPM_DAC to the "Analog XX Playback Mixer". In this way the DAC will be powered while the audio playback is used or/and the loopback is enabled for the channel. The twl4030 codec powering has been reworked. Now the codec will be powered as long as it does not receives the SND_SOC_BIAS_OFF event. The exceptions are when the given change in the registers needs the codec power down/up cycle in order to take effect. Otherwise the codec is on. When the codec enters to STANDBY state and none of the loopback paths are enabled, than the amplifiers, which are no in the DAPM path are forced to turn off and the PLL is disabled. When playback/capture starts the disabled gains are restored and the PLL is enabled. When one of the loopback enabled in STANDBY mode, the disabled gains are restored and the PLL is enabled also. In short: the codec always goes to the lowest power state based on the bias_level and the bypass_state. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-29Merge branch 'for-2.6.29' into for-2.6.30Mark Brown
2009-01-29ASoC: Fix null string usage with WM8753 DAIsMark Brown
The WM8753 driver multiplexes the DAI structures it exposes to the outside world, leaving them uninitialised until the codec probes. Since the DAI name is used during the registration and setup process provide a dummy name. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27ASoC: TWL4030: Move the twl4030_power_up and _power_down functionPeter Ujfalusi
Move the twl4030_power_up and twl4030_power_down function earlier to facilitate the analog bypass implementation. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27ASoC: TWL4030: Physical ADC and amplifier power switch changePeter Ujfalusi
Change the power switches for the physical ADC and for the amplifiers for the analog capture path to map more closely the actual path inside of the codec. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27ASoC: TWL4030: Enable Headset Left anti-pop/bias ramp only if the Headset ↵Peter Ujfalusi
Left is in use The Headset Left anti-pop and bias ramp does not need to be enabled, if the headset is not in use. Move the code to DAPM event handler for HeadsetL. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27ASoC: TWL4030: Code clean up for codec power up and downPeter Ujfalusi
Merge the codec up and down functions to a simple one. Codec is powered down by default (reg_cache change). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27ASoC: TWL4030: Syncronize the reg_cache for ANAMICL after the offset cancelationPeter Ujfalusi
The offset cancelation bit in ANAMICL register is self cleanig. Make sure that the reg_cache holds the same value as the HW register. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27ASoC: Push the codec runtime storage into the card structureMark Brown
This is a further stage on the road to refactoring away the ASoC platform device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-23ASoC: improve I2C initialization code in CS4270 driverTimur Tabi
Further improvements in the I2C initialization sequence of the CS4270 driver. All ASoC initialization is now done in the I2C probe function. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-23ASoC: Fix L3 bus handling in KconfigMark Brown
It has no external dependencies but needs to be selected for L3 based codecs to work. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-23ASoC: Include header file in cs4270 and wm9705Mark Brown
Ensures that the DAI and socdev exported by the codec match up with their exported prototype. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-23ASoC: Fix spurious codec driver dependenciesMark Brown
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. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-23ASoC: remove stand-alone mode support from CS4270 codec driverTimur Tabi
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] Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-20ASoC: Fix WM9705 capture switch nameIan Molton
This patch fixes the acpture switch name so that it better reflects its purpose. Signed-off-by: Ian Molton <iann@mnementh.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-19ASoC: fixes to caching implementationsIan Molton
This patch takes fixes a number of bugs in the caching code used by several ASoC codec drivers. Mostly off-by-one fixes. Signed-off-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-16ASoC: Ignore output frequency for WM9713 PLLMark Brown
The WM9713 driver does not support configuring the PLL output frequency so the output frequency parameter is irrelevant. Allow users to set it to zero by ignoring it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-16ASoC: Driver for the WM9705 AC97 codec.Ian Molton
This driver adds support for the wm9705 ac97 codec. The driver supports audio input and output. Signed-off-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-09Merge branch 'for-2.6.29' into for-2.6.30Mark Brown
2009-01-09ASoC: TWL4030: Module unloading fixPeter Ujfalusi
Call the snd_soc_free_pcm and snd_soc_dapm_free when the codec driver is unloaded. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-09ASoC: cleanup duplicated code.Ian Molton
Many codec drivers were implementing cookie-cutter copies of the function that adds kcontrols to the codec. This patch moves this code to a common function snd_soc_add_controls() in soc-core.c and updates all drivers using copies of this function to use the new common version. [Edited to raise priority of error log message and document parameters. -- broonie] Signed-off-by: Ian Molton <ian@mnementh.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-09ASoC: Implement WM8350 headphone jack detectionMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-08ASoC: TWL4030: Change the soc_value_enum back to soc_enumPeter Ujfalusi
The soc_value_enum has been merged to soc_enum. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-06ASoC: Fix SND_SOC_ALL_CODECS handling of dual SPI and I2C control busesMark Brown
For codecs that have both SPI and I2C support we need to ensure that we don't try to make the codec driver built in when I2C is modular since that won't link. Do this by creating a helper variable which uses conditional defaults to pick up the correct value for all combinations. We don't need to do anything special for I2C-only codecs since a conditional select passes on the full value for a tristate. Reported-by: Ingo Molnar <mingo@elte.hu> Tested-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-05ASoC: TWL4030: Convert the bitfield enums to VALUE_ENUM typePeter Ujfalusi
Convert the bitfield coded enums to the new VALUE_ENUM type. Remove the enum check, since the VALUE_ENUM type can handle the bitfield coding and also handles the 'holes' in the bitfield. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-31ASoC: TWL4030: DAPM based capture implementationPeter Ujfalusi
This patch adds DAPM implementaion for the capture path on twlx030. TWL has two physical ADC and two digital microphone (stereo) connections. The CPU interface has four microphone channels. For simplicity the microphone channel paths are named as: TX1 (Left/Right) - when using i2s mode, only the TX1 data is valid TX2 (Left/Right) Input routing (simplified version): There is two levels of mux settings for TWL in input path: Analog input mux: ADCL <- {Off, Main mic, Headset mic, AUXL, Carkit mic} ADCR <- {Off, Sub mic, AUXR} Analog/Digital mux: TX1 Analog mode: TX1L <- ADCL TX1R <- ADCR TX1 Digital mode: TX1L <- Digimic0 (Left) TX1R <- Digimic0 (Right) TX2 Analog mode: TX2L <- ADCL TX2R <- ADCR TX2 Digital mode: TX2L <- Digimic1 (Left) TX2R <- Digimic1 (Right) The patch provides the following user controls for the capture path: Mux settings: "TX1 Capture Route": {Analog, Digimic0} "TX2 Capture Route": {Analog, Digimic1} "Analog Left Capture Route": {Off, Main Mic, Headset Mic, AUXL, Carkit Mic} "Analog Right Capture Route": {Off, Sub Mic, AUXR} Volume/Gain controls: "TX1 Digital Capture Volume": Stereo gain control for TX1 path "TX2 Digital Capture Volume": Stereo gain control for TX2 path "Analog Capture Volume": Stereo gain control for the analog path only Important things for the board files: Microphone bias: "Mic Bias 1": Bias for Main mic or for digimic0 (analog or digital path) "Mic Bias 2": Bias for Sub mic or for digimic1 (analog or digital path) "Headset Mic Bias": Bias for Headset mic When the routing configured correctly only the needed components will be powered/enabled. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-31ASoC: TWL4030: Make the enum filter generic for twl4030Peter Ujfalusi
Modify the enum filter to more generic that it will filter out the enums with text "Invalid". The enum filter also required for the capture path. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-22ASoC: Fix DSP formats in SSM2602 audio codecJarkko Nikula
Thanks to Troy Kisky <troy.kisky@boundarydevices.com> for noticing. - DSP_A format has 1-bit data delay which corresponds to SSM6202 submode 2 - DSP_B has 0-bit data delay which corresponds to submode 1 - Currently driver sets them opposite so swap the submode setting Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com> Cc: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-22ASoC: Fix incorrect DSP format in OMAP McBSP DAI and affected driversJarkko Nikula
- OMAP McBSP DAI driver claims to support DSP_A format which has 1-bit data delay but configures link for 0-bit data delay which is in fact DSP_B - Fix this by changing format from DSP_A to DSP_B - Fix also TLV320AIC23 codec and OSK5912 machine drivers since the same error is populated also there Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com> Acked-by: Arun KS <arunks@mistralsolutions.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-20ALSA: ASoC - Add missing __devexit annotation to wm8350.cTakashi Iwai
Added the missing __devexit annotation to wm8350_codec_remove(): sound/soc/codecs/wm8350.c:1546: warning: 'wm8350_codec_remove' defined but not used Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-20ALSA: ASoC: tlv320aic3x add dsp_aTroy Kisky
Add SND_SOC_DAIFMT_DSP_A mode option. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-18ASoC: Add WM8350 AudioPlus codec driverMark 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. This driver was originally written by Liam Girdwood with further updates from me. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-11ASoC: TWL4030: hands-free start-up sequence.Stanley.Miao
A special start-up sequence is required to reduce the pop-noise of Class D amplifier when enable hands-free on TWL4030. Signed-off-by: Stanley.Miao <stanley.miao@windriver.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ASoC: Stop WM8903 SYSCLK when suspendingMark Brown
This will save some additional power. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ASoC: Convert WM8903 driver to register at I2C probe timeMark Brown
The driver now registers the codec and DAI when probed as an I2C device. Also convert the driver to use a single dynamic allocation to simplify error handling. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-10ASoC: Convert WM8900 to do more work at I2C probe timeMark Brown
Redo the instantiation of the WM8900 to do most of the initialisation work when the I2C driver probes rather than when the ASoC device is instantiated, registering the codec with the ASoC core when done. Also move all dynamic allocations into a single kmalloc() to simplify error handling and rename the I2C driver to make output more sensible. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>