summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/tlv320aic3x.c
Commit message (Collapse)AuthorAgeFilesLines
*-. Merge remote-tracking branches 'asoc/topic/tas2552', 'asoc/topic/tas5720', ↵Mark Brown2017-09-011-0/+45
|\ \ | | | | | | | | | 'asoc/topic/tegra', 'asoc/topic/tlv320aic32x4' and 'asoc/topic/tlv320aic3x' into asoc-next
| | * ASoC: tlv320aic3x: Support for OCMV configurationPeter Ujfalusi2017-08-311-0/+45
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In aic3x class of devices Output Common-Mode Voltage can be configured for better analog performance. The OCMV value depends on the Analog and digital domain power supply voltage configuration. The default OCMV of 1.35V gives best performance when AVDD is around 2.7V and DVDD is 1.525V, but for higher AVDD/DVDD higher OCMV setting is recommended. The patch gives an automatic way of guessing the best OCMV which can be overwritten by a DT parameter if needed. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* | ASoC: codecs: add const to snd_soc_codec_driver structuresBhumika Goyal2017-08-101-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Declare snd_soc_codec_driver structures as const as they are only passed as an argument to the function snd_soc_register_codec. This argument is of type const, so declare the structures with this property as const. In file codecs/sn95031.c, snd_soc_codec_driver structure is also used in a copy operation along with getting passed to snd_soc_register_codec. So, it can be made const too. Done using Coccinelle: @match disable optional_qualifier@ identifier s; position p; @@ static struct snd_soc_codec_driver s@p={...}; @good1@ identifier match.s; position p; @@ snd_soc_register_codec(...,&s@p,...) @bad@ identifier match.s; position p!={match.p,good1.p}; @@ s@p @depends on !bad disable optional_qualifier@ identifier match.s; @@ static +const struct snd_soc_codec_driver s={...}; Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tlv320aic3x: Add delay after power on and register syncPeter Ujfalusi2016-12-311-0/+6
| | | | | | | | | | | When the codec is powered on, it's registers are in reset state as the power off will do a soft reset of the codec. After the register sync we need to add delay to remove the pop-noise on stream start. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: tlv320aic3x: Mark the RESET register as volatilePeter Ujfalusi2016-12-311-0/+13
| | | | | | | | | | 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>
* ASoC: dapm: Support second register for DAPM control updatesChen-Yu Tsai2016-11-021-1/+1
| | | | | | | | | | | | | | | To support double channel shared controls split across 2 registers, one for each channel, we must be able to update both registers together. Add a second set of register fields to struct snd_soc_dapm_update, and update the DAPM control writeback (put) callbacks to support this. For codecs that use custom events which call into DAPM to do updates, also clear struct snd_soc_dapm_update before using it, so the second set of fields remains clean. Signed-off-by: Chen-Yu Tsai <wens@csie.org> Signed-off-by: Mark Brown <broonie@kernel.org>
* ASoC: codec duplicated callback function goes to component on tlv320aic3xKuninori Morimoto2016-08-081-6/+8
| | | | | | | | | | 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>
* Merge branch 'for-linus' into for-nextTakashi Iwai2015-10-131-8/+11
|\
| * ASoC: tlv320aic3x: Prevent writing reserved registers on tlv320aic3104 CODECsRick Mann2015-10-011-8/+11
| | | | | | | | | | | | | | | | 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>
* | ASoC: tlv320aic3x: Improve tdm supportJyri Sarha2015-09-161-4/+26
|/ | | | | | | | | | | | 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>
*-. Merge remote-tracking branches 'asoc/topic/rcar', 'asoc/topic/reg-default', ↵Mark Brown2015-08-301-1/+1
|\ \ | | | | | | | | | 'asoc/topic/rl6231', 'asoc/topic/rockchip' and 'asoc/topic/rt286' into asoc-next
| | * regmap: Use reg_sequence for multi_reg_write / register_patchNariman Poushin2015-07-161-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski2015-07-151-1/+0
|/ | | | | | | | 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>
* ASoC: tlv320aic3x: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen2015-05-151-4/+5
| | | | | | | | | | 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>
* ASoC: Move bias level update to the coreLars-Peter Clausen2015-04-271-1/+0
| | | | | | | | | 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>
*-. Merge remote-tracking branches 'asoc/topic/tdm-slot', 'asoc/topic/tegra', ↵Mark Brown2015-02-041-101/+244
|\ \ | | | | | | | | | 'asoc/topic/tlv320aic3x', 'asoc/topic/ts3a227e' and 'asoc/topic/ts3a277e' into asoc-next
| | * ASoC: tlv320aic3x: Fix bad comment before intercon_extra_3104 definitionJyri Sarha2015-02-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| | * ASoC: tlv320aic3x: Add support for tlv320aic3104Jyri Sarha2015-02-031-101/+244
| |/ | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'asoc/topic/w-codec' into asoc-nextMark Brown2015-02-041-1/+1
|\ \
| * | ASoC: tlv320aic3x: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen2015-01-151-1/+1
| |/ | | | | | | | | | | | | | | 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>
* | ASoC: tlv320aic3x: Fix data delay configurationPeter Ujfalusi2015-01-301-1/+1
|/ | | | | | | | | | | | | | 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
* ASoC: tlv320aic3x: Cleanup manual bias level transitionsLars-Peter Clausen2014-11-271-1/+0
| | | | | | | | | 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>
* ASoC: tlv320aic3x: Add output driver pop reduction controlsMisael Lopez Cruz2014-11-111-0/+14
| | | | | | | | | | 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>
* ASoC: tlv320aic3x: Convert SOC_ENUM_SINGLE/DOUBLE arrays to individualPeter Ujfalusi2014-11-111-72/+79
| | | | | | | | 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>
* ASoC: tlv320aic3x: Add TDM supportPeter Ujfalusi2014-11-101-3/+59
| | | | | | | | | | | | | 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>
*-. Merge remote-tracking branches 'asoc/topic/suspend', 'asoc/topic/tas2552', ↵Mark Brown2014-10-061-0/+13
|\ \ | | | | | | | | | 'asoc/topic/tegra', 'asoc/topic/tlv320aic31xx' and 'asoc/topic/tlv320aic3x' into asoc-next
| | * ASoC: tlv320aic3x: fix PLL D configurationDmitry Lavnikevich2014-10-031-0/+13
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | ASoC: tlv320aic3x: Remove unnecessary suspend/resume bias level changesLars-Peter Clausen2014-09-031-16/+0
|/ | | | | | | | | | | | 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>
*-. Merge remote-tracking branches 'asoc/topic/tlv320aic3x', 'asoc/topic/width', ↵Mark Brown2014-08-041-6/+7
|\ \ | | | | | | | | | 'asoc/topic/wm0010', 'asoc/topic/wm8904' and 'asoc/topic/wm8962' into asoc-next
| * | ASoC: tlv320aic3x: Convert to params_width()Mark Brown2014-08-011-6/+5
| | | | | | | | | | | | | | | | | | The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown <broonie@linaro.org>
| * | ASoC: tlv320aic3x: Add support for S24_LE formatPeter Ujfalusi2014-06-301-1/+3
| | | | | | | | | | | | | | | | | | | | | 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>
| | |
| \ \
*-. \ \ Merge remote-tracking branches 'asoc/topic/omap', 'asoc/topic/oom' and ↵Mark Brown2014-08-041-6/+2
|\ \ \ \ | |_|/ / |/| | / | | |/ | |/| 'asoc/topic/pxa' into asoc-next
| | * ASoC: tlv320aic3x: Remove redundant OOM messageSachin Kamat2014-06-271-6/+2
| |/ | | | | | | | | | | | | Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
* | ASoC: tlv320aic3x: Correct S24_3LE supportPeter Ujfalusi2014-06-301-1/+1
|/ | | | | | | | | | 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>
*-. Merge remote-tracking branches 'asoc/fix/pxa' and 'asoc/fix/tlv320aic3x' ↵Mark Brown2014-06-031-1/+1
|\ \ | | | | | | | | | into asoc-linus
| | * ASoC: tlv320aci3x: Fix custom snd_soc_dapm_put_volsw_aic3x() functionPeter Ujfalusi2014-06-011-1/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | | | 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
* | ASoC: tlv320aic3x: fix shared reset pin for DTSebastian Reichel2014-04-151-2/+7
|/ | | | | | | | | | | | 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>
* ASoC: codec: Simplify ASoC probe code.Xiubo Li2014-03-111-6/+0
| | | | | | | | 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>
* 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/+113
|\
| * 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/+73
| | | | | | | | | | | | | | | | | | | | | | | | 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/+4
| | | | | | | | 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/+0
| | | | | | | | | | | | | | 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>
OpenPOWER on IntegriCloud