summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/sta32x.c
AgeCommit message (Collapse)AuthorFilesLines
2014-02-23ASoC: sta32x: Fix cache syncLars-Peter Clausen1-1/+1
codec->control_data contains a pointer to the regmap struct of the device, not to the device private data. Use snd_soc_codec_get_drvdata() instead. The issue was introduced in commit 29fdf4fbbe ("ASoC: sta32x: Convert to regmap"). Fixes: 29fdf4fbbe (ASoC: sta32x: Convert to regmap) Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2014-02-20ASoC: sta32x: Fix array access overflowTakashi Iwai1-36/+36
Preset EQ enum of sta32x codec driver declares too many number of items and it may lead to the access over the actual array size. Use SOC_ENUM_SINGLE_DECL() helper and it's automatically fixed. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-07-19ASoC: sta32x: Use power efficient workqueueMark Brown1-4/+6
None of the delayed work the driver schedules has particularly short delays and it is not performance sensitive so let the scheduler run it wherever is most efficient rather than in a per CPU workqueue by using the system power efficient workqueue. Signed-off-by: Mark Brown <broonie@linaro.org> Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
2012-12-10ASoC: 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-09-10ASoC: sta32x: Convert to regmapMark Brown1-27/+80
Long term all drivers should be using regmap directly. This is more idiomatic and moves us towards the removal of the ASoC level cache code. The initialiasation of reserved register bits in probe() is slightly odd as the defaults being written don't appear to match the silicon defaults but the new code should have the same effect as the old code. The watchdog code will now unconditionally do a mute and unmute when resyncing but since we only sync when we are very sure there is something to sync this should have no impact. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Johannes Stezenbach <js@sig21.net>
2012-09-10ASoC: sta32x: Move regulator acquisition to I2C probeMark Brown1-17/+15
This is better style as it ensures we don't try to do the ASoC probe without required resources. Also convert to devm_ while we're at it, saving a bit of code, and fix a leak of enable on error. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Johannes Stezenbach <js@sig21.net>
2012-08-06ASoC: sta32x: Use module_i2c_driverSachin Kamat1-11/+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-04-04ASoC: codecs: Remove rtd->codec usage from CODEC driversMark Brown1-2/+1
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-01-03ASoC: sta32x: Optimize the array work to find rate_min and rate_maxAxel Lin1-0/+1
For a given ir and fs, there is at most one possible match for the case mclk_ratios[ir][j].ratio * fs == freq. Thus we can break from the inner loop once a match is found. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-02ASoC: Convert sta32x to devm_kzalloc()Axel Lin1-9/+4
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-25ASoC: Staticise non-exported symbols in sta32xMark Brown1-2/+2
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Johannes Stezenbach <js@sig21.net>
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-11-14ASoC: sta32x: add workaround for ESD reset issueJohannes Stezenbach1-1/+49
sta32x resets and loses all configuration during ESD test. Work around by polling the CONFA register once a second and restore all coeffcients and registers when CONFA changes unexpectedly. Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-14ASoC: sta32x: add platform data definitionJohannes Stezenbach1-9/+21
Add a structure for platform specific configuration and use it, thereby removing a few FIXMEs which marked hard-coded values. Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-14ASoC: sta32x: preserve coefficient RAMJohannes Stezenbach1-1/+62
The coefficient RAM must be saved in a shadow so it can be restored when the codec is powered on using regulator_bulk_enable(). Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2011-10-13ASoC: sta32x: Write the register default value to cache for reserved registersAxel Lin1-15/+13
Chip documentation explicitly requires that the reset values of reserved register bits are left untouched. codec->hw_read is broken now. Here we use below trick to avoid writing to reserved registers while resume. Write the register default value to cache for reserved registers, so the write to the these registers are suppressed by the cache restore code when it skips writes of default registers. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-13ASoC: sta32x: Set reg_cache_default to sta32x_regsAxel Lin1-4/+1
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-19ASoC: sta32x: Move resource allocation and release to the corresponding ↵Axel Lin1-11/+2
callback functions This patch includes below small fixes: 1. Move sta32x_set_bias_level() from sta32x_i2c_remove() to sta32x_remove(). 2. Remove a redundant regulator_bulk_free() call in sta32x_i2c_remove(), as we will call regulator_bulk_free() in sta32x_remove(). 3. Remove unneeded snd_soc_codec_set_drvdata(codec, NULL) in sta32x_i2c_remove. The i2c core will set the clientdata to NULL. Signed-off-by: Axel Lin <axel.lin@gmail.com> Johannes Stezenbach <js@sig21.net> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-15ASoC: sta32x: shortcut the for loop to get ir and mcsAxel Lin1-2/+6
There is exactly one match or no match at all during the for loop iteration, thus we can break from the for loop once a match is found. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-15ASoC: sta32x: Fix a memory leak if snd_soc_register_codec failsAxel Lin1-0/+1
Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-14ASoC: STA32x: Preserve reserved register bitsJohannes Stezenbach1-0/+16
Chip documentation explicitly requires that the reset values of reserved register bits are left untouched. It is possible there are differences between STA326 and STA328 or future chip revisions in these bits, and clobbering them might cause malfunction. Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-07-14ASoC: STA32x: Add mixer controls for biquad coefficientsJohannes Stezenbach1-0/+124
The STA32x has a number of preset EQ settings, but also allows full user control of the biquad filter coeffcients (when "Automode EQ" is set to "User"). Each biquad has five signed, 24bit, fixed-point coefficients representing the range -1...1. The five biquad coefficients can be uploaded in one atomic operation into on-chip coefficient RAM. There are also a few prescale, postscale and mixing coefficients, in the same numeric format and range (a negative coefficient inverts phase). These coefficients are made available as SNDRV_CTL_ELEM_TYPE_BYTES mixer controls. Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-22ASoC: add STA32X codec driverJohannes Stezenbach1-0/+777
Signed-off-by: Johannes Stezenbach <js@sig21.net> [zonque@gmail.com: transform to new ASoC structure] Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>