aboutsummaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tlv320aic3x.c
AgeCommit message (Collapse)Author
2012-08-27ASoC: tlv320aic3x: Add device tree bindingsHebbar, Gururaja
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>
2012-08-06ASoC: tlv320aic3x: Use module_i2c_driverSachin Kamat
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>
2012-07-19Merge tag 'asoc-3.6' of ↵Takashi Iwai
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
2012-07-10ASoC: tlv320aic3x: add input clock selectionJiri Prchal
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>
2012-07-10ASoC: tlv320aic3x: add AGC settingsJiri Prchal
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>
2012-07-09ASoC: tlv320aic3x: add deemphasis switchJiri Prchal
This patch adds missing deemphasis switch. Signed-off-by: Jiri Prchal <jiri.prchal@aksignal.cz> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-04ASoC: tlv320aic3x: extending registers cacheJiri Prchal
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>
2012-06-29ASoC: tlv320aic3x: Fix codec pll configure bugHebbar, Gururaja
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
2012-06-03ASoC: tlv320aic3x: Change Class-D amplifier gain control nameJarkko Nikula
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>
2012-05-14ASoC: tlv320aic3x: Remove unused, non-standard headset detectionMark Brown
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>
2012-04-04ASoC: codecs: Remove rtd->codec usage from CODEC driversMark Brown
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>
2012-02-07ASoC: tlv320aic3x: Remove even more unused codeMark Brown
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>
2012-02-06ASoC: tlv320aic3x: remove unused codeFelipe Contreras
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>
2012-02-04ASoC: core: Add support for DAI and machine kcontrols.Liam Girdwood
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>
2012-01-27ASoC: Set idle_bias_off flag in snd_soc_codec_driverAxel Lin
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>
2012-01-02ASoC: Convert tlv320aic3x to devm_kzalloc()Axel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-02ASoC: Drop unused state parameter from CODEC suspend callbackLars-Peter Clausen
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>
2011-11-27ASoC: Remove unneeded platform_device.h inclusions from CODECsMark Brown
They've not been needed for a long time if they were ever required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-23ASoC: Constify snd_soc_dai_ops structsLars-Peter Clausen
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>
2011-11-22ASoC: Remove conditional I2C usage from tlv320aic3x driverMark Brown
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>
2011-11-08Merge branch 'for-3.2' into for-3.3Mark Brown
Conflicts: sound/soc/codecs/wm8940.c
2011-10-27ASoC: tlv320aic3x: Clear BIT_CLK_MASTER and WORD_CLK_MASTER bits for for ↵Axel Lin
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>
2011-10-27ASoC: tlv320aic3x: Use snd_soc_update_bits for read-modify-writeAxel Lin
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>
2011-10-14ASoC: tlv320aic3x: Convert codec->hw_read to snd_soc_readAxel Lin
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>
2011-10-10ASoC: Fix DAPM sync for TLV320AIC3x custom DAPM widgetMark Brown
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>
2011-09-30ASoC: tlv320aic3x: Use driver_data field of struct i2c_device_id to identify ↵Axel Lin
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>
2011-09-30ASoC: Remove unused "control_data" field of struct aic3x_privAxel Lin
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>
2011-07-09Merge branch 'topic/asoc' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into for-3.1
2011-07-04ASoC: tlv320aic3x: Add correct hw registers to Line1 cross connect muxesJarkko Nikula
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>
2011-05-23ASoC: tlv320aic3x: Do soft reset to codec when going to bias off stateJarkko Nikula
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>
2011-05-23ASoC: tlv320aic3x: Don't sync first two registers from register cacheJarkko Nikula
There is no need to sync first two registers from cache to hw after a reset. First one is used to select page for register access and this driver is normally accessing page 0 only. Second one does a software reset which is obviously unneeded after hardware or previous software reset command. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@ti.com>
2011-05-16ASoC: Fix wrong data type access in a few codec driversJarkko Nikula
Commit fafd217 ("ASoC: Store a list of widgets in a DAPM mux/mixer kcontrol") changed the control private data type that is passed to snd_soc_cnew when creating dapm mixer and mux controls. Commit did not update a few codec drivers that are using their own put callbacks and thus are accessing a wrong data type. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2010-12-17Merge branch 'topic/asoc' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into for-2.6.38
2010-12-15ASoC: Move DAPM paths from DAPM context to snd_soc_cardJarkko Nikula
Decoupling DAPM paths from DAPM context is a first prerequisite when extending ASoC core to cross-device paths. This patch is almost a nullop and does not allow to construct cross-device setup but the path clean-up part in dapm_free_widgets is prepared to remove cross-device paths between a device being removed and others. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-02ASoC: Remove unused aic3x_i2c_init and aic3x_i2c_exit functionsAxel Lin
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jarkko Nikula <jhnikula@gmail.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-25Merge branch 'for-2.6.37' into for-2.6.38Mark Brown
2010-11-25ASoC: tlv320aic3x - fix variable may be used uninitialized warningAxel Lin
If aic3x_read failed , val is used uninitialized. Fix it by initializing val to 0. This patch fixes below compile warning: sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_get_gpio': sound/soc/codecs/tlv320aic3x.c:1183: warning: 'val' may be used uninitialized in this function sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_headset_detected': sound/soc/codecs/tlv320aic3x.c:1211: warning: 'val' may be used uninitialized in this function sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_button_pressed': sound/soc/codecs/tlv320aic3x.c:1219: warning: 'val' may be used uninitialized in this function Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-24Merge branch 'topic/asoc' of ↵Mark Brown
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into for-2.6.38
2010-11-23Merge branch 'for-2.6.38' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc Conflicts: sound/soc/codecs/tpa6130a2.c
2010-11-22ASoC: Do not include soc-dapm.hJarkko Nikula
There is no need to include soc-dapm.h since soc.h includes it. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-16ASoC: Fix incorrect kfree in aic3x_probe error pathAxel Lin
We allocated memory for aic3x in aic3x_i2c_probe, and will free the memory in either aic3x_i2c_probe error path or aic3x_i2c_remove. Thus we should not call kfree(aic3x) in aic3x_probe, otherwise we have double free of aic3x. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-06ASoC: Decouple DAPM from CODECsLiam Girdwood
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths. This patch decouples DAPM related variables from struct snd_soc_codec and moves them to new struct snd_soc_dapm_context that is used to encapsulate DAPM context of a device. ASoC core and API of DAPM functions are modified to use DAPM context instead of codec. This patch does not change current functionality and a large part of changes come because of structure and internal API changes. Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some minor core changes, codecs and machine driver conversions from Jarkko Nikula <jhnikula@gmail.com>. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Manuel Lauss <manuel.lauss@googlemail.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Cliff Cai <cliff.cai@analog.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Ryan Mallon <ryan@bluewatersys.com> Cc: Timur Tabi <timur@freescale.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Jassi Brar <jassi.brar@samsung.com> Cc: Daniel Gloeckner <dg@emlix.com> Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-03ASoC: tlv320aic3x: Add support to shared common reset lineJarkko Nikula
This is aimed to configurations where multiple aic3x codecs share the same reset line and are powered from same supply voltages. Currently aic3x_probe will fail if trying to request already requested gpio_reset and passing -1 to another aic3x instances cause that those instances cannot release reset in aic3x_set_power. That is, another instances can work only if primary aic3x instance is powered and reset is released. Solve this by implementing a list of probed instances that is used for checking if other instance shares the same gpio_reset number. If a shared reset line exists, then only first instance tries to request and configure it and the last instance releases it. Runtime modifications are not needed since aic3x_regulator_event with help of regulator framework takes already care that reset is pulled down only when some or all supplies are disabled meaning that all instances using them are idle. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03ASoC: tlv320aic3x: Use gpio_is_valid in checking for valid gpio_resetJarkko Nikula
I promised to convert this at some point. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20ASoC: tlv320aic3x: Let the codec hit SND_SOC_BIAS_OFF when idleJarkko Nikula
Now codec hits the SND_SOC_BIAS_OFF also when it is idle. This is also the default state after probing and codec is left unconfigured and unpowered by default. Initialization will happen when the bias state changes and aic3x_set_power does power-up and cache sync. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20ASoC: tlv320aic3x: Use regulator notifiers for optimizing the cache syncJarkko Nikula
There is no need to reset the codec and perform cache sync if none of the supply regulators were not disabled. Patch registers a notifier callback for each supply and callback then sets a flag to indicate when cache sync is required. HW writes are also needless when codec bias is off so cache_only flag is set independently of actual supply regulators state. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20ASoC: tlv320aic3x: Add runtime regulator control to aic3x_set_bias_levelJarkko Nikula
Now all the regulators are disabled when entering into SND_SOC_BIAS_OFF and enabled when coming back to SND_SOC_BIAS_STANDBY state. Currently this runtime control happens only with suspend/resume as this patch does not change the default idle behavior. This patch manages all the regulators and reset since it seems that register sync is needed even if only analog supplies AVDD and DRVDD are disabled. This was noted when the system was running with idle behavior changed and IOVDD and DVDD were on. It is not known are all the registers needed to sync or only some subset of them. Therefore patch plays safe and does always full shutdown/power-up. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20ASoC: tlv320aic3x: Move regulator management from i2c to soc domainJarkko Nikula
It will be easier to keep regulator enable/disable calls in sync when dynamic regulator management is added if regulator management is moved from aic3x_i2c_probe/_remove to aic3x_probe/_remove. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20Merge remote branch 'asoc/for-2.6.37' into for-2.6.37Liam Girdwood