summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tlv320aic3x.c
AgeCommit message (Collapse)Author
2017-08-07ASoC: tlv320aic3x: Mark the RESET register as volatilePeter Ujfalusi
[ Upstream commit 63c3194b82530bd71fd49db84eb7ab656b8d404a ] The RESET register only have one self clearing bit and it should not be cached. If it is cached, when we sync the registers back to the chip we will initiate a software reset as well, which is not desirable. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Reviewed-by: Jarkko Nikula <jarkko.nikula@bitmer.com> Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <alexander.levin@verizon.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-08-08ASoC: codec duplicated callback function goes to component on tlv320aic3xKuninori Morimoto
codec driver and component driver has duplicated callback functions, and codec side functions are just copied to component side when register timing. This was quick-hack, but no longer needed. This patch moves these functions from codec driver to component driver. Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-10-13Merge branch 'for-linus' into for-nextTakashi Iwai
2015-10-01ASoC: tlv320aic3x: Prevent writing reserved registers on tlv320aic3104 CODECsRick Mann
The current code writes a set of registers that are reserved on the tlc320aic3104. The change skips those registers for that IC. Signed-off-by: Rick Mann <rmann@latencyzero.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-09-16ASoC: tlv320aic3x: Improve tdm supportJyri Sarha
Before this patch the set_tdm_slots() callback did not store the value of slot width anywhere. The tdm support only worked if selected slot width was equal to the sample width. With this patch all sample widths that fit into the slot width are supported. There unused bits are filled unnecessarily in the capture direction, but the other end of the i2s bus should be able to ignore them. Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-08-30Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', ↵Mark Brown
'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
2015-07-16regmap: Use reg_sequence for multi_reg_write / register_patchNariman Poushin
Separate the functionality using sequences of register writes from the functions that take register defaults. This change renames the arguments in order to support the extension of reg_sequence to take an optional delay to be applied after any given register in a sequence is written. This avoids adding an int to all register defaults, which could substantially increase memory usage for regmaps with large default tables. This also updates all the clients of multi_reg_write/register_patch. Signed-off-by: Nariman Poushin <nariman@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-05-15ASoC: tlv320aic3x: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen
The dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm.bias_level with snd_soc_codec_get_bias_level() and replace all other manual access to codec->dapm with snd_soc_codec_get_dapm(). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-04-27ASoC: Move bias level update to the coreLars-Peter Clausen
All drivers have the same line at the end of the set_bias_level callback to update the bias_level state. Move this update into snd_soc_dapm_force_bias_level() and remove them from the drivers. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-04Merge remote-tracking branches 'asoc/topic/tdm-slot', 'asoc/topic/tegra', ↵Mark Brown
'asoc/topic/tlv320aic3x', 'asoc/topic/ts3a227e' and 'asoc/topic/ts3a277e' into asoc-next
2015-02-04Merge remote-tracking branch 'asoc/topic/w-codec' into asoc-nextMark Brown
2015-02-04ASoC: tlv320aic3x: Fix bad comment before intercon_extra_3104 definitionJyri Sarha
The intercon_extra_3104 is obviously for tlv320aic3104. Reported-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com> Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-02-03ASoC: tlv320aic3x: Add support for tlv320aic3104Jyri Sarha
Disables GPIO support and LINE2 input and renames Mic3 input to Mic2, if tlv320aic3104 mode is seleced. Devicetree binding document is updated accordingly. Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-01-30ASoC: tlv320aic3x: Fix data delay configurationPeter Ujfalusi
Fix the issue introduced by: 368494093354 ASoC: tlv320aic3x: Add TDM support The CTRLC register were not receiving the correct delay configuration, which will corrupt DSP_A audio mode. Fixes: 368494093354 (ASoC: tlv320aic3x: Add TDM support) Reported-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2015-01-15ASoC: tlv320aic3x: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen
The codec field of the snd_soc_widget struct is eventually going to be removed, use snd_soc_dapm_to_codec(w->dapm) instead. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-27ASoC: tlv320aic3x: Cleanup manual bias level transitionsLars-Peter Clausen
Since the ASoC core now takes care of setting the bias level to SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually anymore. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-11ASoC: tlv320aic3x: Add output driver pop reduction controlsMisael Lopez Cruz
Output driver has two parameters that can be configured to reduce pop noise: power-on delay and ramp-up step time. Two new kcontrols have been added to set these parameters. Signed-off-by: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-11ASoC: tlv320aic3x: Convert SOC_ENUM_SINGLE/DOUBLE arrays to individualPeter Ujfalusi
It is easier to find the relevant enums in the code. Use the SOC_ENUM_*_DECL macro for the individual items. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10ASoC: tlv320aic3x: Add TDM supportPeter Ujfalusi
TDM support is achieved using DSP transfer mode and setting a programmable offset which specifies where data begins with respect to the frame sync. It requires 256-clock mode if CODEC is master (not currently supported in the driver). No additional dependency if CODEC is slave. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-10-06Merge remote-tracking branches 'asoc/topic/suspend', 'asoc/topic/tas2552', ↵Mark Brown
'asoc/topic/tegra', 'asoc/topic/tlv320aic31xx' and 'asoc/topic/tlv320aic3x' into asoc-next
2014-10-03ASoC: tlv320aic3x: fix PLL D configurationDmitry Lavnikevich
Current caching implementation during regcache_sync() call bypasses all register writes of values that are already known as default (regmap reg_defaults). Same time in TLV320AIC3x codecs register 5 (AIC3X_PLL_PROGC_REG) write should be immediately followed by register 6 write (AIC3X_PLL_PROGD_REG) even if it was not changed. Otherwise both registers will not be written. This brings to issue that appears particulary in case of 44.1kHz playback with 19.2MHz master clock. In this case AIC3X_PLL_PROGC_REG is 0x6e while AIC3X_PLL_PROGD_REG is 0x0 (same as register default). Thus AIC3X_PLL_PROGC_REG also remains not written and we get wrong playback speed. In this patch snd_soc_read() is used to get cached pll values and snd_soc_write() (unlike regcache_sync() this function doesn't bypasses hardware default values) to write them to registers. Signed-off-by: Dmitry Lavnikevich <d.lavnikevich@sam-solutions.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
2014-09-03ASoC: tlv320aic3x: Remove unnecessary suspend/resume bias level changesLars-Peter Clausen
The ASoC core will only call the suspend/resume callbacks when the device's DAPM context is idle. Since this driver sets idle_bias_off to true this means that the device is already in SND_SOC_BIAS_OFF when the suspend callback is called, so there is no need to manually set this state again. There is also no need to go to SND_SOC_BIAS_STANDBY in the resume callback since the core will go right back to SND_SOC_BIAS_OFF. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-08-04Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/width', ↵Mark Brown
'asoc/topic/wm0010', 'asoc/topic/wm8904' and 'asoc/topic/wm8962' into asoc-next
2014-08-04Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/oom' and ↵Mark Brown
'asoc/topic/pxa' into asoc-next
2014-08-01ASoC: tlv320aic3x: Convert to params_width()Mark Brown
The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-30ASoC: tlv320aic3x: Add support for S24_LE formatPeter Ujfalusi
The codec need to be configured to 24bit mode in case of S24_LE format. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-30ASoC: tlv320aic3x: Correct S24_3LE supportPeter Ujfalusi
Correct the hw_params callback to configure the codec correctly in case of S24_3LE format since in case of S24_3LE the codec has been configured to 16bit format mode. S24_LE is not defined as supported format for the codec. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-27ASoC: tlv320aic3x: Remove redundant OOM messageSachin Kamat
Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-03Merge remote-tracking branches 'asoc/fix/pxa' and 'asoc/fix/tlv320aic3x' ↵Mark Brown
into asoc-linus
2014-06-01ASoC: tlv320aci3x: Fix custom snd_soc_dapm_put_volsw_aic3x() functionPeter Ujfalusi
For some unknown reason the parameters for snd_soc_test_bits() were in wrong order: It was: snd_soc_test_bits(codec, val, mask, reg); /* WRONG!!! */ while it should be: snd_soc_test_bits(codec, reg, mask, val); Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2014-04-15ASoC: tlv320aic3x: fix shared reset pin for DTSebastian Reichel
Currently the second tlv320aic3x instance fails to be probed from DT if the reset pin is shared with the first one. This patch fixes it by moving the list add of the reset pin into the i2c_probe method. Signed-off-by: Sebastian Reichel <sre@kernel.org> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-11ASoC: codec: Simplify ASoC probe code.Xiubo Li
For some CODEC drivers like who act as the MFDs children are ignored by this patch. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-12-09ASoC: tlv320aic3x: no mono controls 3007 modelJan Weitzel
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>
2013-10-24Merge remote-tracking branch 'asoc/topic/tlv320aic3x' into asoc-nextMark Brown
2013-10-16ASoC: tlv320aic3x: Include linux/of.h headerSachin Kamat
'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>
2013-10-07ASoC: tlv320aic3x: Connect 'Left Line1R Mux' and 'Right Line1L Mux'Peter Ujfalusi
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>
2013-09-24ASoC: tlv320aic3x: Convert to direct regmap API usageMark Brown
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>
2013-09-24ASoC: tlv320aic3x: Don't reference cache datastructure directlyMark Brown
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>
2013-09-24ASoC: tlv320aic3x: Move to table based DAPM initMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-24ASoC: tlv320aic3x: Move to table based control initMark Brown
Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-24ASoC: tlv320aic3x: Move resource acquisition to I2C probeMark Brown
This is more idiomatic and interacts better with deferred probing. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-24ASoC: tlv320aic3x: Remove nonsense comment for register cacheMark Brown
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>
2013-08-22Merge remote-tracking branch 'asoc/topic/tlv320aic3x' into asoc-nextMark Brown
2013-07-29ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrolLars-Peter Clausen
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>
2013-07-24ASoC: tlv320aic3x: Use snd_soc_dapm_mixer_update_powerLars-Peter Clausen
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>
2013-07-16ASoC: tlv320aic3x: List tlv320aic3106 as a supported deviceMark Brown
Currently there is no specific handling for it but the tlv320aic3106 is supported using this driver. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-16ASoC: tlv320aic3x: Add compatible strings for specific devicesMark Brown
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>
2013-06-19ASoC: tlv320aix3x: Use SOC_SINGLE_EXT() instead of open-coding itLars-Peter Clausen
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-07ASoC: tlv320aic3x: Remove deadlock from snd_soc_dapm_put_volsw_aic3x()Andreas Irestål
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>