summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic3x.c
Commit message (Collapse)AuthorAgeFilesLines
* ASoC: tlv320aic3x: no mono controls 3007 modelJan Weitzel2013-12-091-43/+83
| | | | | | | | | | | | | | | if codec driver is used for AIC3X_MODEL_3007 the mono iout controls overwrite registers for class-d amplifier. classd amplifier controls are only used for AIC3X_MODEL_3007. Removing all mono snd_kcontrol_new, snd_soc_dapm_widget, snd_soc_dapm_route and aic3x_init stuff from common code and call only for not AIC3X_MODEL_3007 codecs. Testet only with AIC3X_MODEL_3007 Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/tlv320aic3x' into asoc-nextMark Brown2013-10-241-121/+113Star
|\
| * ASoC: tlv320aic3x: Include linux/of.h headerSachin Kamat2013-10-161-0/+1
| | | | | | | | | | | | | | 'of_match_ptr' is defined in linux/of.h. Include it explicitly. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: tlv320aic3x: Convert to direct regmap API usageMark Brown2013-09-241-78/+73Star
| | | | | | | | | | | | | | | | | | | | | | | | This is slightly more complex than a standard regmap conversion due to the moderately detailed cache control and the open coding of a register patch for the class D speaker on the TLV320AIC3007. Although the device supports paging this is not currently implemented as the additional pages are only used during the application of the patch for the TLV320AIC3007. Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: tlv320aic3x: Don't reference cache datastructure directlyMark Brown2013-09-241-5/+6
| | | | | | | | | | | | | | Rather than referencing the cache directly read back the values we are going to restore, supporting refactoring to use regmap. Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: tlv320aic3x: Move to table based DAPM initMark Brown2013-09-241-6/+4Star
| | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: tlv320aic3x: Move to table based control initMark Brown2013-09-241-2/+2
| | | | | | | | Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: tlv320aic3x: Move resource acquisition to I2C probeMark Brown2013-09-241-30/+33
| | | | | | | | | | | | This is more idiomatic and interacts better with deferred probing. Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: tlv320aic3x: Remove nonsense comment for register cacheMark Brown2013-09-241-6/+0Star
| | | | | | | | | | | | | | Every statement in this comment is incorrect either through bitrot or (mostly) through never having corresponded to reality in the first place. Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: tlv320aic3x: Connect 'Left Line1R Mux' and 'Right Line1L Mux'Peter Ujfalusi2013-10-071-0/+4
|/ | | | | | | | | | The two paths were not connected in the DAPM route causing the associated routes to be non working and the following warnings printed in the logs: tlv320aic3x-codec 0-001b: ASoC: mux Right Line1L Mux has no paths tlv320aic3x-codec 0-001b: ASoC: mux Left Line1R Mux has no paths Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/tlv320aic3x' into asoc-nextMark Brown2013-08-221-0/+4
|\
| * ASoC: tlv320aic3x: List tlv320aic3106 as a supported deviceMark Brown2013-07-161-0/+2
| | | | | | | | | | | | | | Currently there is no specific handling for it but the tlv320aic3106 is supported using this driver. Signed-off-by: Mark Brown <broonie@linaro.org>
| * ASoC: tlv320aic3x: Add compatible strings for specific devicesMark Brown2013-07-161-0/+2
| | | | | | | | | | | | | | | | The driver supports a range of devices but currently doesn't allow those device names to be used for enumeration on DT. Add the currently listed I2C IDs as compatible strings. Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrolLars-Peter Clausen2013-07-291-4/+3Star
| | | | | | | | | | | | | | | | | | | | We use the same 3 lines to get the CODEC for a kcontrol in a quite a few places. This patch puts them into a common helper function. Having this encapsulated in a helper function will also make it more easier to eventually change the data layout of the kcontrol's private data. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: tlv320aic3x: Use snd_soc_dapm_mixer_update_powerLars-Peter Clausen2013-07-241-33/+16Star
|/ | | | | | | | Use snd_soc_dapm_mixer_update_power() instead of reimplementing its functionality. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: tlv320aix3x: Use SOC_SINGLE_EXT() instead of open-coding itLars-Peter Clausen2013-06-191-4/+2Star
| | | | | Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* ASoC: tlv320aic3x: Remove deadlock from snd_soc_dapm_put_volsw_aic3x()Andreas Irestål2013-06-071-5/+5
| | | | | | | | | | When calling snd_soc_dapm_sync(), it eventually tries to lock the same mutex already locked in snd_soc_dapm_put_volsw_aic3x() and a deadlock occurs. By moving the mutex unlock to just before snd_soc_dapm_sync(), this deadlock is prevented. This problem was introduced in Linux 3.5 Signed-off-by: Andreas Irestål <Andreas.Irestal@axis.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* Merge remote-tracking branch 'asoc/topic/tlv320aic3x' into asoc-nextMark Brown2013-02-111-6/+77
|\
| * ASoC: tlv320aic3x: Convert mic bias to a supply widgetHebbar Gururaja2013-02-041-6/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Convert MicBias widgets to supply widget. On tlv320aic3x, Mic bias power on/off shares the same register bits with output mic bias voltage. So, when power on mic bias, we need reclaim it to voltage value. Provide a new platform data so that the micbias voltage can be sent according to board requirement. Now since tlv320aic3x codec driver is DT aware, update dt files and functions to handle this new "micbias-vg" platform data. Because of sharing of bits, when enabling the micbias, voltage also needs to be updated. So use SND_SOC_DAPM_POST_PMU & SND_SOC_DAPM_PRE_PMD macro to create an event to handle this. Since micbias is converted to supply widget, updated machine drivers as well. This change is runtime tested on da850-evm with audio loopback (arecord|aplay) for confirmation. Signed-off-by: Hebbar Gururaja <gururaja.hebbar@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: tlv320aic3x: Remove mono supportBenoît Thébaudeau2013-01-301-2/+2
|/ | | | | | | | | | | Playing a mono stream on the TLV320AIC3x results in too fast playback rate. Remove mono support so that mono streams can be played correctly on this codec. Tested with imx-ssi (i.MX25) and TLV320AIC3104. Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau@advansee.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: tlv320aic3x: Add device tree bindingsHebbar, Gururaja2012-08-271-0/+31
| | | | | | | Device tree support for tlv320aic3x CODEC driver. Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: tlv320aic3x: Use module_i2c_driverSachin Kamat2012-08-061-17/+1Star
| | | | | | | | module_i2c_driver makes the code simpler by eliminating module_init and module_exit calls. Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge tag 'asoc-3.6' of ↵Takashi Iwai2012-07-191-2/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for 3.6 This has been a pretty quiet release - very little activity in framework terms, mostly just a few new drivers and updates: - Added the ability to add and remove DAPM paths dynamically, mostly for reparenting on clock changes. - New machine drivers for Marvell Brownstone, ST-Ericsson Ux500 reference platform and ttc-dkp. - New CPU drivers for Blackfin BF6xx SPORTs in I2S mode, Marvell MMP, Synopsis Designware I2S controllers, and SPEAr DMA and S/PDIF - New CODEC drivers for Dialog DA732x, ST STA529, ST-Ericsson AB8500, TI Isabelle and Wolfson Microelectronics WM5102 and WM5110
| * ASoC: tlv320aic3x: add input clock selectionJiri Prchal2012-07-101-0/+6
| | | | | | | | | | | | | | | | This patch adds input selection of main codec clock - from what pin. Both registers set same value since codec uses clock divider or pll at one time. Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: tlv320aic3x: add AGC settingsJiri Prchal2012-07-101-0/+25
| | | | | | | | | | | | | | | | This patch adds AGC target level and times settings for TLV320AIC3x. Enums uses small arrays of two channels left and right since it uses different registers. Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: tlv320aic3x: add deemphasis switchJiri Prchal2012-07-091-0/+3
| | | | | | | | | | | | | | This patch adds missing deemphasis switch. Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: tlv320aic3x: extending registers cacheJiri Prchal2012-07-041-1/+3
| | | | | | | | | | | | | | Adds missing register default values to cache. Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: tlv320aic3x: Change Class-D amplifier gain control nameJarkko Nikula2012-06-031-1/+1
| | | | | | | | | | | | | | | | | | ALSA mixers cannot classify this "Class-D Amplifier Gain" speaker output gain control as a playback control. Fix this by changing the name as "Class-D Playback Volume". Signed-off-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: tlv320aic3x: Fix codec pll configure bugHebbar, Gururaja2012-06-291-3/+1Star
|/ | | | | | | | | | | | | | | | | | | | | | | In sound/soc/codecs/tlv320aic3x.c data = snd_soc_read(codec, AIC3X_PLL_PROGA_REG); snd_soc_write(codec, AIC3X_PLL_PROGA_REG, data | (pll_p << PLLP_SHIFT)); In the above code, pll-p value is OR'ed with previous value without clearing it. Bug is not seen if pll-p value doesn't change across Sampling frequency. However on some platforms (like AM335x EVM-SK), pll-p may have different values across different sampling frequencies. In such case, above code configures the pll with a wrong value. Because of this bug, when a audio stream is played with pll value different from previous stream, audio is heard as differently(like its stretched). Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
* ASoC: tlv320aic3x: Remove unused, non-standard headset detectionMark Brown2012-05-141-18/+0Star
| | | | | | | aic3x_set_headset_detection() isn't made available outside the driver or referenced within the driver which sparse notices and complains about. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: codecs: Remove rtd->codec usage from CODEC driversMark Brown2012-04-041-2/+1Star
| | | | | | | | | | In order to support CODEC<->CODEC links remove the assumption that there is only a single CODEC on a DAI link by removing the use of the CODEC pointer in the rtd from the CODEC drivers. They are already being passed their DAI whenever they are passed an rtd and can get the CODEC from there. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: tlv320aic3x: Remove even more unused codeMark Brown2012-02-071-24/+0Star
| | | | | | | | Now that we're not implementing GPIO or microphone detection support there's no users for the read() function any more. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
* ASoC: tlv320aic3x: remove unused codeFelipe Contreras2012-02-061-36/+0Star
| | | | | | | Looks like nobody is or will be using this code. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: core: Add support for DAI and machine kcontrols.Liam Girdwood2012-02-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently ASoC can only add kcontrols using codec and platform component device handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for SoC card machine drivers too. This allows the kcontrol to have a direct handle to the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily get it's private data. This change makes snd_soc_add_controls() static and wraps it in the folowing calls (card and dai are new) :- snd_soc_add_card_controls() snd_soc_add_codec_controls() snd_soc_add_dai_controls() snd_soc_add_platform_controls() This patch also does a lot of small mechanical changes in individual codec drivers to replace snd_soc_add_controls() with snd_soc_add_codec_controls(). It also updates the McBSP DAI driver to use snd_soc_add_dai_controls(). Finally, it updates the existing machine drivers that register controls to either :- 1) Use snd_soc_add_card_controls() where no direct codec control is required. 2) Use snd_soc_add_codec_controls() where there is direct codec control. In the case of 1) above we also update the machine drivers to get the correct component data pointers from the kcontrol (rather than getting the machine pointer via the codec pointer). Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Set idle_bias_off flag in snd_soc_codec_driverAxel Lin2012-01-271-1/+1
| | | | | | | | | Since commit 33c5f969 "ASoC: Allow idle_bias_off to be specified in CODEC drivers", now we can set idle_bias_off flag in struct snd_soc_codec_driver for devices can unconditionally support idle_bias_off. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Convert tlv320aic3x to devm_kzalloc()Axel Lin2012-01-021-4/+1Star
| | | | | Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Drop unused state parameter from CODEC suspend callbackLars-Peter Clausen2011-12-021-1/+1
| | | | | | | | | | The existence of this parameter is purely historical. None of the CODEC drivers uses it and we always pass in the same value anyway, so it should be safe to remove it. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Remove unneeded platform_device.h inclusions from CODECsMark Brown2011-11-271-1/+0Star
| | | | | | They've not been needed for a long time if they were ever required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen2011-11-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure") introduced the possibility to have constant DAI ops structures, yet this is barley used in both existing drivers and also new drivers being submitted, although none of them modifies its DAI ops structure. The later is not surprising since existing drivers are often used as templates for new drivers. So this patch just constifies all existing snd_soc_dai_ops structs to eliminate the issue altogether. The patch was generated with the following coccinelle semantic patch: // <smpl> @@ identifier ops; @@ -struct snd_soc_dai_ops ops = +const struct snd_soc_dai_ops ops = { ... }; // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Remove conditional I2C usage from tlv320aic3x driverMark Brown2011-11-221-6/+0Star
| | | | | | | The driver only supports I2C so doesn't need to do things conditionally. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jarkko Nikula <jhnikula@gmail.com>
* Merge branch 'for-3.2' into for-3.3Mark Brown2011-11-081-0/+1
|\ | | | | | | | | Conflicts: sound/soc/codecs/wm8940.c
| * ASoC: tlv320aic3x: Clear BIT_CLK_MASTER and WORD_CLK_MASTER bits for for ↵Axel Lin2011-10-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | slave mode According to the datasheet: Page0 / Register8: Audio Serial Data interface Control Register A BIT 7: Bit Clock Directional Control 0: Bit clock is an input (slave mode) 1: Bit clock is an output (master mode) BIT 6: Word Clock Directional Control 0: Word clock is an input (slave mode) 1: Word clock is an output (master mode) Current code sets BIT_CLK_MASTER and WORD_CLK_MASTER bits for master mode, but does not clear these bits for slave mode. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: tlv320aic3x: Use snd_soc_update_bits for read-modify-writeAxel Lin2011-10-271-27/+14Star
|/ | | | | | | | | Use snd_soc_update_bits for read-modify-write register access instead of open-coding it using snd_soc_read and snd_soc_write Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: tlv320aic3x: Convert codec->hw_read to snd_soc_readAxel Lin2011-10-141-1/+4
| | | | | | | codec->hw_read is broken now, let's covert to snd_soc_read. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Fix DAPM sync for TLV320AIC3x custom DAPM widgetMark Brown2011-10-101-0/+4
| | | | | | | We really should be doing this in the core, not in a driver... Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Jarkko Nikula <jarkko.nikula@bitmer.com>
* ASoC: tlv320aic3x: Use driver_data field of struct i2c_device_id to identify ↵Axel Lin2011-09-301-9/+4Star
| | | | | | | | | models Save model information in driver_data so we can simplify the implementation. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* ASoC: Remove unused "control_data" field of struct aic3x_privAxel Lin2011-09-301-3/+0Star
| | | | | | | | | The control_data field is used to initialize the codec's control_data field, but since this is also done by the snd-soc-cache core, the redundant assignment can be removed and the field can be dropped. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge branch 'topic/asoc' of ↵Mark Brown2011-07-091-13/+21
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into for-3.1
| * ASoC: tlv320aic3x: Add correct hw registers to Line1 cross connect muxesJarkko Nikula2011-07-041-13/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit af46800 ("ASoC: Implement mux control sharing") revealed that "Left Line1[L | R] Mux" and "Right Line1[L | R] Mux" widgets were pointing to the same kcontrols and codec registers and thus soc-core falsely detected them as shared controls. This is actually wrong since there are separate registers in hardware that configure Line1L to RADC and Line1R to LADC cross connects so these muxes should not be shared. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@ti.com>
* | ASoC: tlv320aic3x: Do soft reset to codec when going to bias off stateJarkko Nikula2011-05-231-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TLV320AIC33, TLV320AIC34 and I believe others too in this family have some hw bugs that cause that analogue and digital VDD supplies remain leaking up to a few mA of current after certain use cases even the hw blocks inside codec are driven to off. Highest leakages occur after using the bypass paths inside codec but it is possible to get smaller leakages just by toggling mute switches in unused audio paths (i.e. no DAPM changes) while codec is on due another active audio path. While some cases are able to workaroud by making sure that e.g. output mixer switches are muted before powering down the output stage this doesn't help all the cases. Therefore use the software reset command to clear possible leakage currents since that works in every cases and affects only this codec instance. Only drawback is that now cache sync is required everytime when codec bias comes out from bias off state, not only when supply regulators were off. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@ti.com>