summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/tlv320aic32x4.c
AgeCommit message (Collapse)AuthorFilesLines
2016-08-08ASoC: codec duplicated callback function goes to component on tlv320aic32x4Kuninori Morimoto1-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>
2016-05-13ASoC: tlv320aic32x4: Properly implement the positive and negative pins into ↵Jeremy McDermond1-49/+161
the mixers The TLV320AIC32x4 has a very flexible mixer on the inputs to the ADCs. Each mixer has an available set of available pins that can be connected to the ADC positive and negative pins via three different resistor values. This allows for configuration of differential inputs as well as doing level manipulation between sources going into the mixers. The current code only provides positive pins and I implemented the resistors in an earlier patch. It turns out that it appears to more accurately model what's happening to implement each of the pins as a MUX rather than on/off switches and a mixer. This way each pin can be set to its desired resistor value. Since there are no switches, the mixer is no longer necessary in the DAPM path. I set the DAPM paths such that the "off" position of any of the MUXes turns the path off. This should allow for any input confiuration available on the codec. Signed-off-by: Jeremy McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-21ASoC: tlv320aic32x4: Add additional input pinsJeremy McDermond1-0/+8
The input mixers support routing the IN1_R pin to the Left PGA and the IN2_L pin to the Right PGA. This patch allows for those routings. Signed-off-by: Jeremy McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-21ASoC: tlv320aic32x4: Implement resistors on input pinsJeremy McDermond1-6/+24
The input pins of the aic3204 have resistors inline with them. The current code assumes that you want a 10k resistor inline with your inputs and implements it as a simple switch. This patch creates an enum for each pin and allows you to switch between not connected, 10k, 20k and 40k ohm values. This more closely models the acutal aic3204 part. These pin settings are documented in TI's SLAA557 pages 135 and 136 (http://www.ti.com/lit/ml/slaa557/slaa557.pdf). Signed-off-by: Jeremy McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-19ASoC: tlv320aic32x4: Add 96k sample rateJeremy McDermond1-2/+5
The TLV320AIC32x4 series supports 96ksps rates in hardware. This patch adds the necessary PLL divider values and clock settings to the table to make 96ksps work. Signed-off-by: Jeremy McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-19ASoC: tlv320aic32x4: Break out I2C support into separate moduleJeremy McDermond1-52/+24
To prepare for abstracting adding SPI support, the I2C pieces needs to be in its own moudle. This patch moves common probe code into aic32x4_probe and common removal code into aic32x4_remove. It also creates a static regmap config structure to be copied in the I2C specific driver. Signed-off-by: Jeremy McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2016-04-19ASoC: tlv320aic32x4: Change name of probe functionJeremy McDermond1-2/+2
The codec's probe function is named aic32x4_probe. This is going to conflict with later work to implement SPI support and separate out I2S into its own file. In line with other drivers in the tree, this function is renamed to aic32x4_codec_probe instead. Signed-off-by: Jeremy McDermond <nh6z@nh6z.net> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-07-15ASoC: drivers: Drop owner assignment from i2c_driverKrzysztof Kozlowski1-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>
2015-04-27ASoC: Move bias level update to the coreLars-Peter Clausen1-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>
2014-11-27ASoC: tlv320aic32x4: Cleanup manual bias level transitionsLars-Peter Clausen1-23/+1
Set the CODEC driver's suspend_bias_off flag rather than manually going to SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes the code a bit shorter and cleaner. 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 either. The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe() can also be removed as the core will automatically do this after the CODEC has been probed. 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 Brown1-5/+5
'asoc/topic/wm0010', 'asoc/topic/wm8904' and 'asoc/topic/wm8962' into asoc-next
2014-07-31ASoC: tlv320aic32x4: Convert to params_width()Mark Brown1-5/+5
The CODEC doesn't care how data is laid out in memory. Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-22ASoC: tlv320aic32x4: Fixed Coding Style IssuesShahina Shaik1-4/+8
Fixed Coding style issues of lines over 80 characters. Signed-off-by: Shahina Shaik <sharab.shaik@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-22ASoC: tlv320aic32x4: Fixed Coding style IssuesShahina Shaik1-6/+3
Fixed a brace coding style issue in the tlv320aic32x4.c Signed-off-by: Shahina Shaik <sharab.shaik@gmail.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-11ASoC: codec: Simplify ASoC probe code.Xiubo Li1-2/+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>
2014-02-23ASoC: tlv320aic32x4: Rearrange clock tree shutdownMarkus Pargmann1-16/+16
Rearrange clock tree shutdown to disable them in the reversed order of startup. First disable all dividers, then PLL followed by master clock. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23ASoC: tlv320aic32x4: Support for regulatorsMarkus Pargmann1-1/+125
Support regulators to power up the codec. This patch also enables the AVDD LDO if no AV regulator was found. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23ASoC: tlv320aic32x4: Support for master clockMarkus Pargmann1-0/+21
Add support for a master clock passed through DT. The master clock of the codec is only active when the codec is in use. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: tlv320aic32x4: DT supportMarkus Pargmann1-0/+25
Add DT support for this codec. The bindings differ a bit from the aic3x codec bindings, so I created a new binding documentation. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: tlv320aic32x4: Use signed int mixer controlsMarkus Pargmann1-10/+16
There are a number of mixer controls that support negative values. They use signed values for this with different number of bits for the values. Currently they only support the positive range. This patch replaces the unsigned mixers with signed mixers to support the full range. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-03ASoC: tlv320aic32x4: Use gpio_is_validMarkus Pargmann1-2/+2
Use function gpio_is_valid to check for gpio ports. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-27ASoC: tlv320aic32x4: Fix MICPGA input configurationMarkus Pargmann1-4/+6
Currently the Negative Terminal Input Routing Configuration is only set when there is a special routing configuration. If we don't use one of the inputs IN1 or IN2 as negative terminal input, the PGA and recording does not work. This patch adds a route from CM1L/CM1R to the PGA as negative input by default. With this configuration the PGA can amplify all input signals and line-in/mic works again. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-27ASoC: tlv320aic32x4: Fix mono playbackMarkus Pargmann1-7/+11
Playback of a mono stream should output the same stream on both channels. At the moment only the left analog signal is valid, the right one is just noise. This patch maps the left digital channel onto both DACs when receiving a mono stream. Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-01-16ASoC: tlv320aic32x4: Fix regmap range_minMarkus Pargmann1-1/+1
range_min is the lowest address in the virtual register range. This is the first register with address 0, not the first register of page 1. Currently all writes to page 1 are mapped to page 0, so the codec fails to operate. Fixes: 4d208ca429ad (ASoC: tlv320aic32x4: Convert to direct regmap API usage) Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org (v3.13 if the fix misses -final)
2014-01-13ASoC: codec: tlv320aic32x4: Fix regmap range configMarkus Pargmann1-1/+1
This codec driver fails to probe because it has a higher regmap range_max value than max_register. This patch sets the range_max to the max_register value as described in the for struct regmap_range_cfg: "@range_max: Address of the highest register in virtual range." Fixes: 4d208ca429ad (ASoC: tlv320aic32x4: Convert to direct regmap API usage) Signed-off-by: Markus Pargmann <mpa@pengutronix.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org (v3.13 if the fix misses -final)
2013-09-26ASoC: tlv320aic32x4: Convert to direct regmap API usageMark Brown1-66/+23
This moves us towards being able to remove the duplicate register I/O functionality in ASoC and saves some code. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-09-26ASoC: tlv320aic32x4: Move GPIO acquisition to I2C probeMark Brown1-5/+7
This is more idiomatic and interacts better with deferred probe. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-27ASoC: tlv320aic32x4: Convert table based control and DAPM setupLars-Peter Clausen1-15/+7
Let the core take care of instantiating the controls and DAPM widgets and routes, this makes the code a bit shorter. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2012-12-09ASoC: codecs: remove __dev* attributesBill Pemberton1-4/+4
CONFIG_HOTPLUG is going away as an option. As result the __dev* markings will be going away. Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst, and __devexit. Signed-off-by: Bill Pemberton <wfp5p@virginia.edu> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-01ASoC: tlv320aic32x4: Add rstn gpio to platform data.Javier Martin1-0/+14
Add the possibility to specify a gpio through platform data so that a HW reset can be issued to the codec. Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-01ASoC: tlv320aic32x4: Fix problem with first capture.Javier Martin1-0/+10
In its previous status, the first capture didn't work properly; nothing was actually recorded from the microphone. This behaviour was observed using a Visstrim M10 board. In order to solve this BUG a workaround has been added that, during the initialization process of the codec, powers on and off the ADC. The issue seems related to a HW BUG or some behavior that is not documented in the datasheet. Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-06ASoC: tlv320aic32x4: Use module_i2c_driverSachin Kamat1-18/+1
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-02-04ASoC: core: Add support for DAI and machine kcontrols.Liam Girdwood1-1/+1
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-20ASoC: tlv320aic32x4: always enable analouge blockWolfram Sang1-3/+5
Register LDOCTLEN must always be initialized to clear the analog power control bit, otherwise the analog block will stay deactivated. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20ASoC: tlv320aic32x4: always enable dividersWolfram Sang1-56/+46
Dividers (such as MDAC) are always needed, independent of the codec being I2S master or slave. Needed on a custom board where the codec has to be slave. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-28ASoC: Convert tlv320aic32x4 to devm_kzalloc()Axel Lin1-4/+2
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 Clausen1-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>
2011-11-27ASoC: Remove unneeded platform_device.h inclusions from CODECsMark Brown1-1/+0
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 Clausen1-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>
2011-10-13ASoC: tlv320aic32x4: Use snd_soc_update_bits for read-modify-writeAxel Lin1-37/+24
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> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06ASoC: tlv320aic32x4 fix initialization of micpga routingWolfram Sang1-2/+2
Checking the pdata-flags used 'or', so the check is always true. Use 'and' to correctly mask the flags. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Cc: Javier Martin <javier.martin@vista-silicon.com> Cc: Liam Girdwood <lrg@ti.com> Cc: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-03-07ASoC: Fix outdated API usage in tlv320aic32x4Mark Brown1-5/+5
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-03-04ASoC: Add TI tlv320aic32x4 codec support.Javier Martin1-0/+794
This patch adds support for tlv320aic3205 and tlv320aic3254 codecs. It doesn't include miniDSP support for aic3254. Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>