summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/twl4030.c
AgeCommit message (Collapse)AuthorFilesLines
2010-08-04ASoC: TWL4030: Capture route runtime DAPM ordering fixPeter Ujfalusi1-36/+12
Fix the ordering problem in DAPM domain, when the user changes between digital and analog sources during active capture (or loopback) scenario. Before this patch, when the user changed from analog source to digital there were a short time, when the codec enabled analog mic bias (2.2 volts) instead of the correct digital mic bias (1.8 volts) to the digital microphones. This behaviour caused by the former implementation of selecting the correct type of bias. This was done at the POST_REG event of the DAPM_MUX_E("TXx Capture Route") widget. By moving the bias type selection as DAPM_SUPPLY and connecting it to the corresponding digimic widget the problematic situation can be avoided. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-27ASoC: TWL4030: Capture route DAPM event fixPeter Ujfalusi1-2/+0
There is no need to handle POST_PMU, POST_PMD event with the Capture Route widget. It is enough to handle POST_REG event, since that will come when the user changes the routing, and we will switch the needed bits in the registers. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-21ASoC: TWL4030: Add configurable delay after digimic enablePeter Ujfalusi1-4/+21
When digital microphones are connected to twl, delay is needed after enabling the digimic interface of the codec. Add new parameter for the setup data, which can be used to pass the apropriate delay in ms after the digimic interface has been enabled. Without certain delay (in certain HW configuration) the beggining of the recorded sample contains a glitch, which is generated by the digital microphones. Delaying the micbias1, 2 (which is the bias for the digimic0 or 1) does not help, since the glitch is coming after switching the digimic interface. Reversing the micbias and digimic enable order does not work either (in that case the wait need to be added after the micbias enabled). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-13ASoC: TWL4030: DAC power optimizationPeter Ujfalusi1-6/+9
Restructure the DAPM connections in order to enable only the needed DAC (out of four in twl4030 series). I need to keep the 'AIF Enable' supply connected to the L2/R2 digital path, since the digital loopback needs AIF and APLL running. If no valid route available, than none of the DAC will be powered, but the AIF and APLL is going to be enabled. Furthermore, if only one audio path have valid route, than only the corresponding DAC will be powered. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsomicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-13ASoC: TWL4030: Fix for digital loopback gain rangePeter Ujfalusi1-3/+4
When the gain is configured using dB value it was not possible to use -24dB since the loopback got muted instead of -24dB. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsomicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-31Merge branch 'for-2.6.36' of ↵Takashi Iwai1-125/+166
git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc
2010-05-31ASoC: TWL4030: Add functionalty to reset the registersPeter Ujfalusi1-0/+17
Machine driver can instruct the codec driver to reset the chip registers to their default values at probe time. If machine driver does not provide setup data, then the registers are going to be reseted to their defaults, to be safe. If the developer on the platform confirms that the register reset is not needed, than it can be skipped, saving ~20ms time in probe. As safety measure do the register reset at remove time also. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-31ASoC: TWL4030: Use BIAS_OFF instead of BIAS_STANDBY, when not in usePeter Ujfalusi1-35/+51
Restructure the codec power code in order to be able to hit off when the codec is not in use. Since the audio registers are accessible while the codec is powered down, there is no need for additional safety mechanism. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-31ASoC: TWL4030: Correct the ARXR2_APGA_CTL chip defaultPeter Ujfalusi1-0/+3
It seams at least on twl5031 that the ARXR2_APGA_CTL register does not have the same default value as it is written in the TRM. Since the codec part of the PM chip has not been actually changed according to TI, assuming, that all version has the same problem, so writing there the TRM value. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-31ASoC: TWL4030: Helper to check chip default registersPeter Ujfalusi1-1/+24
Since the twl4030 codec driver supports different version of the PM chip, a helper function can come handy, which can check the driver's default versus the chip values. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-31ASoC: TWL4030: Optimize the power up sequencePeter Ujfalusi1-73/+60
Since the reg cache now contains the chip default values for all registers (REG_OPTION is reset to it's default within this patch), there is no longer need to rewrite _all_ registers. Initialize only few selected registers. According to the latest information, the offset cancellation need to be done only once, when the codec is powered on, so there is no need for the power up wrapper. Move all chip initialization code under chip_init, and do it when the codec is initialized. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-31ASoC: TWL4030: Make offset cancellation path configurablePeter Ujfalusi1-1/+5
Add means for machine drivers to select the path for offset cancellation. Reset the reg cache value to the chip reset value at the same time. Machine drivers can specify which path need to be used for offset cancellation via the twl4030_setup.offset_cncl_path. For paths use the defines from include/linux/mfd/twl4030-codec.h: TWL4030_OFFSET_CNCL_SEL_* Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-31ASoC: TWL4030: Remove wrapper for power downPeter Ujfalusi1-11/+2
There is no need for the power down wrapper. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-31ASoC: TWL4030: Revisit codec defaultsPeter Ujfalusi1-22/+22
Reset most of the codec registers to their chip reset value. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-20Merge branch 'topic/asoc' into for-linusTakashi Iwai1-59/+144
Conflicts: sound/soc/codecs/ad1938.c
2010-05-12ASoC: TWL4030: Add control for digimic Left Right swapPeter Ujfalusi1-0/+12
The codec has support for swapping the left and right channels in the digimic interface. New kcontrol to handle this bit. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-10ASoC: Remove unneeded suspend bias managment from CODEC driversMark Brown1-1/+0
The core will ensure that the device is in either STANDBY or OFF bias before suspending, restoring the bias in the driver is unneeded. Some drivers doing slightly more roundabout things have been left alone for now. Tested-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-03ASoC: TWL4030: Remove OUTL/R outputsPeter Ujfalusi1-4/+0
OUTL/R are leftovers from the original driver, and they are no longer needed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-03ASoC: TWL4030: AIF/APLL fix in DAPM domainPeter Ujfalusi1-22/+60
This patch orders the APLL and AIF power sequence in case of HiFi (audio in TWL4030 terms) playback/capture. We also need to make sure that the AIF is running during playback/capture, when there is no valid DAPM route available. For this purpose I introduce these virtual widgets: /* To have complete playback route all the time */ DAPM_OUTPUT("Virtual HiFi OUT") /* Will keep AIF/APLL enabled */ /* To have complete capture route all the time */ DAPM_INPUT("Virtual HiFi IN") /* Will keep AIF/APLL enabled */ /* To have complete playback route for the voice module */ DAPM_OUTPUT("Virtual Voice OUT") /* Will keep APLL enabled */ The DAPM_SUPPLY widgets for APLL and AIF are placed in a way, that during any audio activity the needed configuration of AIF and APLL will be enabled (playback, capture, analog loopback, digital loopback, and voice activity). The apll reference counting code has been lifted, and modified from Liam Girdwood's earlier patch. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-20ASoC: missing conversions to snd_soc_codec_*_drvdata()Takashi Iwai1-1/+1
Conversions to snd_soc_codec_{get|set}_drvdata() were missing in some files in the previous commit. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-17ASoC: Add indirection for CODEC private dataMark Brown1-16/+16
One of the features of the multi CODEC work is that it embeds a struct device in the CODEC to provide diagnostics via a sysfs class rather than via the device tree, at which point it's much better to use the struct device private data rather than having two places to store it. Provide an accessor function to allow this change to be made more easily, and update all the CODEC drivers are updated. To ensure use of the accessor the private data structure member is renamed, meaning that if code developed with older an older core that still uses private_data is merged it will fail to build. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-30include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo1-0/+1
implicit slab.h inclusion from percpu.h percpu.h is included by sched.h and module.h and thus ends up being included when building most .c files. percpu.h includes slab.h which in turn includes gfp.h making everything defined by the two files universally available and complicating inclusion dependencies. percpu.h -> slab.h dependency is about to be removed. Prepare for this change by updating users of gfp and slab facilities include those headers directly instead of assuming availability. As this conversion needs to touch large number of source files, the following script is used as the basis of conversion. http://userweb.kernel.org/~tj/misc/slabh-sweep.py The script does the followings. * Scan files for gfp and slab usages and update includes such that only the necessary includes are there. ie. if only gfp is used, gfp.h, if slab is used, slab.h. * When the script inserts a new include, it looks at the include blocks and try to put the new include such that its order conforms to its surrounding. It's put in the include block which contains core kernel includes, in the same order that the rest are ordered - alphabetical, Christmas tree, rev-Xmas-tree or at the end if there doesn't seem to be any matching order. * If the script can't find a place to put a new include (mostly because the file doesn't have fitting include block), it prints out an error message indicating which .h file needs to be added to the file. The conversion was done in the following steps. 1. The initial automatic conversion of all .c files updated slightly over 4000 files, deleting around 700 includes and adding ~480 gfp.h and ~3000 slab.h inclusions. The script emitted errors for ~400 files. 2. Each error was manually checked. Some didn't need the inclusion, some needed manual addition while adding it to implementation .h or embedding .c file was more appropriate for others. This step added inclusions to around 150 files. 3. The script was run again and the output was compared to the edits from #2 to make sure no file was left behind. 4. Several build tests were done and a couple of problems were fixed. e.g. lib/decompress_*.c used malloc/free() wrappers around slab APIs requiring slab.h to be added manually. 5. The script was run on all .h files but without automatically editing them as sprinkling gfp.h and slab.h inclusions around .h files could easily lead to inclusion dependency hell. Most gfp.h inclusion directives were ignored as stuff from gfp.h was usually wildly available and often used in preprocessor macros. Each slab.h inclusion directive was examined and added manually as necessary. 6. percpu.h was updated not to include slab.h. 7. Build test were done on the following configurations and failures were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my distributed build env didn't work with gcov compiles) and a few more options had to be turned off depending on archs to make things build (like ipr on powerpc/64 which failed due to missing writeq). * x86 and x86_64 UP and SMP allmodconfig and a custom test config. * powerpc and powerpc64 SMP allmodconfig * sparc and sparc64 SMP allmodconfig * ia64 SMP allmodconfig * s390 SMP allmodconfig * alpha SMP allmodconfig * um on x86_64 SMP allmodconfig 8. percpu.h modifications were reverted so that it could be applied as a separate patch and serve as bisection point. Given the fact that I had only a couple of failures from tests on step 6, I'm fairly confident about the coverage of this conversion patch. If there is a breakage, it's likely to be something in one of the arch headers which should be easily discoverable easily on most builds of the specific arch. Signed-off-by: Tejun Heo <tj@kernel.org> Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org> Cc: Ingo Molnar <mingo@redhat.com> Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-22ASoC: TWL4030: PM fix for output amplifiersPeter Ujfalusi1-16/+56
Gain controls on outputs affect the power consumption when the gain is set to non 0 value. Outputs with amps have one register to configure the routing and the gain: PREDL_CTL (0x25): bit 0: Voice enable bit 1: Audio L1 enable bit 2: Audio L2 enable bit 3: Audio R2 enable bit 4-5: Gain (0x0 - power down, 0x1 - 6dB, 0x2 - 0dB, 0x3 - -6dB) bit 0 - 3: is handled in DAPM domain (DAPM_MIXER) bit 4 - 5: has simple volume control If there is no audio activity (BIAS_STANDBY), and user changes the volume, than the output amplifier will be enabled. If the user changes the routing (but the codec remains in BIAS_STANDBY), than the cached gain value also be written to the register, which enables the amplifier. The existing workaround for this is to have virtual PGAs associated with the outputs, and whit DAPM PMD the gain on the output will be forced to 0 (off) by bypassing the regcache. This failed to disable the amplifiers in several scenario (as mentioned above). Also if the codec is in BIAS_ON state, and user modifies a volume control, which path is actually not enabled, than that amplifier will be enabled as well, but it will be not turned off, since there is no DAPM path, which would make mute it. To prevent amps being enabled, when they are not needed, introduce the following workaround: Track the state of each of this type of output. In twl4030_write only allow actual write, when the given output is enabled, otherwise only update the reg_cache. The PGA event handlers on power up will write the cached value to the chip (restoring gain, routing selection). On power down 0 is written to the register (disabling the amp, and also just in case clearing the routing). Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-02-17ASoC: TWL4030: Use codec defaults for Headset initial configurationPeter Ujfalusi1-2/+2
Disable the amplifiers for the headset outputs, and do not select routings by default to the headset outputs. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-02-10ASoC: TWL4030: Add supply for audio serial interface controlPeter Ujfalusi1-1/+13
The serial interface (TDM/I2S) for the audio block have been constantly enabled. Introduce a new DAPM_SUPPLY for handling the AIF_EN bit, so the interface is only enabled, when there is a need for it. For example when only the analog loopback is enabled, there is no need to keep the serial interface active. I have added the persons who contributed to the Voice path of twl4030 codec driver, so they might have the ability to test this patch, and send an update for the Voice path, if it is necessary Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-02-04ASoC: TWL4030: Module unloading fixPeter Ujfalusi1-2/+3
The module unloading path had several problems: - it freed up the private structure twice - it freed up the codec structure, which was allocated as part of the private structure - it did not freed up the reg_cache - it did not unregistered the dais and the codec Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-01-28ASoC: TWL4030: Modify codec default settingsPeter Ujfalusi1-4/+4
Change the legacy default register configuration, which left some internal components on. Now we have either DAPM, or other ways to control these bits, so there is no need to enable them by default. The affected parts: Disable ADCL and ADCR Disable ARXL2 and ARXR2 analog PGA (playback) Disable APLL by default Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-01-13ASoC: TWL4030: Replace comma with semicolon in probe functionPeter Ujfalusi1-1/+1
The codec structure initialization statements should be separated by semicolons. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-12-13mfd: Rename all twl4030_i2c*Balaji T K1-4/+4
This patch renames function names like twl4030_i2c_write_u8, twl4030_i2c_read_u8 to twl_i2c_write_u8, twl_i2c_read_u8 and also common variable in twl-core.c Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-12-13mfd: Rename twl4030* driver files to enable re-useSantosh Shilimkar1-1/+1
The upcoming TWL6030 is companion chip for OMAP4 like the current TWL4030 for OMAP3. The common modules like RTC, Regulator creates opportunity to re-use the most of the code from twl4030. This patch renames few common drivers twl4030* files to twl* to enable the code re-use. Signed-off-by: Rajendra Nayak <rnayak@ti.com> Signed-off-by: Balaji T K <balajitk@ti.com> Signed-off-by: Santosh Shilimkar <santosh.shilimkar@ti.com> Acked-by: Kevin Hilman <khilman@deeprootsystems.com> Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
2009-11-12ASoC: Remove redundant snd_soc_dapm_new_widgets() callsMark Brown1-1/+0
The DAPM widgets are now insntantiated by the core when creating the card so there is no need for the individual CODEC drivers to do so. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-11-10ASoC: TWL4030: Do not modify the APLL_CTL registerPeter Ujfalusi1-45/+31
APLL_CTL register is configured by the twl4030-codec MFD driver. Remove code, which makes changes in the APLL_CTL register, and replace those with checks against the configured audio_mclk configuration done in the MFD driver. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-11-03ASoC: Factor out snd_soc_init_card()Mark Brown1-12/+0
snd_soc_init_card() is always called as the last part of the CODEC probe function so we can factor it out into the core card setup rather than have each CODEC replicate the code to do the initialiastation. This will be required to support multiple CODECs per card. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-11-02ASoC: TWL4030: Make sure, that the codec is powered on startupPeter Ujfalusi1-0/+1
Set the codec->bias_level to SND_SOC_BIAS_OFF before changing the initial bias level to STANDBY. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-29ASoC: TWL4030: Add APLL supply for the capture pathPeter Ujfalusi1-0/+5
Capture path also need the APLL enabled, adding DAPM_SUPPLY for the Virtual ADCs. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-29ASoC: TWL4030: Change APLL powering sequencePeter Ujfalusi1-2/+24
It seams that certain part of the twl4030 codec needs the APLL enabled before they are enabled. Paths which has any digital processing needs need the APLL enabled before they can function. For example the vibra output will have some random data after it is enabled and before the APLL also enabled. If only analog components are in use (analog bypass), than it seams, that the APLL does not need to be enabled. This lowers the power consumption with around ~0.005A. Adding DAPM_SUPPLY to the Digital playback route and also to the capture route to enable and disable the APLL. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-29ASoC: TWL4030: Vibra motor stop fix when it is driven with audioJari Vanhala1-2/+10
This patch fixes vibrator playing incoherently, when driven with audio. There is something wrong in switch 3 at H-bridge and VIBRA_SET still affects PWM generator. Slowest value fixes things. Signed-off-by: Jari Vanhala <ext-jari.vanhala@nokia.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-28ASoC: TWL4030: Change codec_muted to apll_enabledPeter Ujfalusi1-10/+10
codec_muted is missleading, change it to apll_enabled, which is what it is doing: enabing and disabling the APLL. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-28ASoC: TWL4030: Remove bypass trackingPeter Ujfalusi1-98/+30
Since ASoC core now handling the codec bias differently there is no need to do the tracking of bypass switch states anymore. Handling of the common bit for analog loopbacks is done with DAPM_SUPPLY for the bypass paths. Now this bit is only enabled when there is a complete analog bypass path, compared to the previous implementation, when the global switch was enabled if there were any of the analog bypass switch was on (regardless if there were complete path or not) Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-25ASoC: TWL4030: Driver registration via twl4030_codec MFDPeter Ujfalusi1-77/+126
Change the way how the twl4030 soc codec driver is loaded/probed. Use the device probing via tlw4030_codec MFD device. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-10-19ASoC: TWL4030: Only update the needed bits in *set_dai_sysclkPeter Ujfalusi1-10/+12
Do not rewrite the whole register, but only update the needed bits in set_dai_sysclk functions. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-14ASoC: TWL4030: Fix for capture mixer stringsPeter Ujfalusi1-21/+25
Change the strings related to capture in order to be interpreted correctly by alsamixer and possible other UI based mixer applications. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-13ASoC: TWL4030: Introduce PGAs for outputsPeter Ujfalusi1-49/+60
Dynamically control and control only the needed output amplifier muting/un-muting. The original code was muting and un-muting the following output amplifiers: Earpiece PreDrivL/R, CarkitL/R at the same time regardless which pin is actually in use at the given moment. Move these as separate PGA so only the needed amplifier will be touched. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-03ASoC: TWL4030: Add tristate callbacks for HiFi and VoiceLopez Cruz, Misael1-0/+28
Add "set_tristate" callbacks for HiFi and Voice DAIs. Machine drivers can enable and disable tristate for each DAI with "snd_soc_dai_set_tristate" function. Signed-off-by: Misael Lopez Cruz <x0052729@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-07-02ASoC: TWL4030: Add EXTMUTE to reduce pop-noise effectCandelaria Villareal, Jorge1-0/+27
According to TRM, an external FET controlled by a 1.8V output signal can be used to reduce the pop-noise heard when the audio amplifier is switched on. It is suggested that GPIO6 of TWL4030 be used, but any other gpio can be used instead. This is indicated in machine driver with the following twl4030_setup_data members: -hs_extmute. Set to 1 if board has support for EXTMUTE. -set_hs_extmute. Set to a callback funcion to control an external gpio line. Set to NULL if MUTE[GPIO6] pin is used. Codec driver takes care of enabling and disabling this output during the headset pop attenuation sequence. Also add a delay to let VMID settle in ramp up sequence. Signed-off-by: Jorge Eduardo Candelaria <x0107209@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-26ASoC: Remove word "Switch" from Handsfree switch nameLopez Cruz, Misael1-6/+6
SoC dapm adds the suffix "Switch" to SND_SOC_DAPM_SWITCH controls, removing word "Switch" from HandsfreeL/HandsfreeR widget name for avoiding to duplicate it. Signed-off-by: Misael Lopez Cruz <x0052729@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-23ASoC: TWL4030: Correct bypass event for voice sidetoneLopez Cruz, Misael1-7/+13
Event for voice sidetone was being interpreted as an analog HiFi bypass event because VSTPGA register offset is less than ARXR2_APGA_CTL offset. Reordering the register checks allows to handle voice digital bypass event properly. Signed-off-by: Misael Lopez Cruz <x0052729@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-23ASoC: TWL4030: Add AVADC Clock PriorityLopez Cruz, Misael1-0/+12
AVDAC clk priority allows to determine the path ADC must be connected when the codec is in option2 and both HiFi and Voice paths are enabled. Signed-off-by: Misael Lopez Cruz <x0052729@ti.com> Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-22ASoC: TWL4030: Fix voice interface clock mastersLopez Cruz, Misael1-1/+1
Voice interface of twl4030 codec supports: CBM_CFM and CBS_CFS. It doesn't support CBS_CFM. Signed-off-by: Misael Lopez Cruz <x0052729@ti.com> Acked-By: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-06-20ASoC: Staticise put_twl4030_opmode_enum_double()Mark Brown1-1/+1
It's an operation for a control and doesn't need to be exported. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>