aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8904.c
AgeCommit message (Collapse)Author
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-07-31ASoC: wm8904: 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> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
2014-06-27ASoC: wm8904: Remove redundant OOM messageSachin Kamat
Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-09ASoC: wm8904: switch to CCFBo Shen
Enable WM8904 to support common clock framework. Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen
For CODEC controls snd_kcontrol_chip() currently returns a pointer to the CODEC that registered the control. With the upcoming consolidation of platform and CODEC controls this will change. Prepare for this by introducing the snd_soc_kcontrol_codec() helper function that will hide the implementation details of how the CODEC for a control can be obtained. This will allow us to change this easily in the future. The patch also updates all CODEC drivers to use the new helper function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-13Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown
2014-03-12Merge remote-tracking branches 'asoc/topic/wm5100', 'asoc/topic/wm8523', ↵Mark Brown
'asoc/topic/wm8731', 'asoc/topic/wm8737', 'asoc/topic/wm8741', 'asoc/topic/wm8753', 'asoc/topic/wm8903', 'asoc/topic/wm8904', 'asoc/topic/wm8940' and 'asoc/topic/wm8955' into asoc-next
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>
2014-02-23ASoC: wm8904: Use SOC_ENUM_SINGLE_DECL()Takashi Iwai
Just replace with the helper macro. No functional change at all. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20ASoC: Rename soc_enum.max field with itemsTakashi Iwai
The name "max" in struct soc_enum is rather confusing since it actually takes the number of items. With "max", one might try to assign (nitems - 1) value. Rename the field to a more appropriate one, "items", which is also used in struct snd_ctl_elem_info, too. This patch also rewrites some code like "if (x > e->nitems - 1)" with "if (x >= e->nitems)". Not only the latter improves the readability, it also fixes a potential bug when e->items is zero. 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>
2013-12-18ASoC: wm8904: fix DSP mode B configurationBo Shen
When wm8904 work in DSP mode B, we still need to configure it to work in DSP mode. Or else, it will work in Right Justified mode. Signed-off-by: Bo Shen <voice.shen@atmel.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-11-07ASoC: wm8904: Replace BUG() with WARN()Takashi Iwai
BUG() used in the driver is just to spit the stack trace on buggy points, not really needed to stop the whole operation. For that purpose, it'd be more convenient to use WARN() instead with more error information. Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-06ASoC: wm8904: Use WARN_ON() instead of BUG_ON()Takashi Iwai
Use WARN_ON() and handle the error cases accordingly. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-27ASoC: wm8904: Remove unnecessary call to snd_soc_dapm_new_widgets()Lars-Peter Clausen
The core will call snd_soc_dapm_new_widgets() once all components of the card have been initialized, so there is no need to do this manually in the driver. Calling it earlier also might result in a partially instantiated system being powered up which cause undesired side effects. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-18ASoC: wm8904: fix the typo error for LINER MuxBo Shen
fix the typo error, from "LINEL Mux" to "LINER Mux" Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-19ASoC: wm8904: 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>
2012-12-10ASoC: codecs: remove __dev* attributesBill Pemberton
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-22Merge tag 'v3.6-rc6' into for-3.7Mark Brown
Linux 3.6-rc6 has all our bug fixes. Conflicts (trivial overlap): sound/soc/omap/am3517evm.c
2012-09-14ASoC: wm8904: correct the indexBo Shen
Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10ASoC: wm8904: remove redundant codeBo Shen
The core_intercon is added two times, remove the redundant one Signed-off-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25ASoC: wm8904: Move register default setup into I2C probe()Mark Brown
Get it done as early as possible, it's neater and minimises the time the pins aren't configured as requested. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25ASoC: wm8904: Move regulator acquisition and device identification to I2CMark Brown
It's more idiomatic to have the resource allocation at this level. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25ASoC: wm8904: Rely entirely on the core for bias level managementMark Brown
Even though the WM8904 is able to use idle_bias_off during both probe and resume we were needlessly leaving the device in standby mode. Instead power the device down as soon as we've confirmed that we can talk to it and don't manage the bias level at all over suspend and resume, the core will take us down to our minimum power level. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25Merge tag 'v3.5-rc4' into for-3.6Mark Brown
Linux 3.5-rc4 contains some bug fixes which overlap with new features.
2012-06-11ASoC: wm8904: Fix cache only managementMark Brown
We should be using the regmap API consistently for all the cache only configuration and we should be going cache only before we power down the supplies. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11ASoC: wm8904: Fix GPIO and MICBIAS initialisation for regmap conversionMark Brown
We no longer have a flat ASoC cache so can't peer directly into the array any more but should instead use the register I/O functions to update the cache. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org (v3.4)
2012-06-09ASoC: wm8904: Convert to devm_regmap_init_i2c()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-09ASoC: wm8904: Convert to module_i2c_driver()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03ASoC: codecs: Refresh copyrights for Wolfson driversMark Brown
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-20ASoC: Optimise performance of WM8904 ADC 128fs OSR modeMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20ASoC: Convert WM8904 to direct regmap API usageMark Brown
The device has a very sparse register map so should benefit from using a rbtree cache. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20ASoC: Use standard cache sync for WM8904Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20ASoC: Convert wm8904 to devm_kzalloc()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20ASoC: Make WM8904 I2C usage unconditionalMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-03ASoC: Remove unused -codec from Wolfson device driver namesMark Brown
Devices that aren't MFDs don't need to distinguish this. 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-08Merge branch 'for-3.2' into for-3.3Mark Brown
Conflicts: sound/soc/codecs/wm8940.c
2011-10-31ASoC: Convert wm8904 MICBIAS to a supply widgetMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-31ASoC: WM8904: Set `invert' bit for Capture SwitchHong Xu
Set `invert' bit for Capture Switch. Otherwise analogue is muted when Capture Switch is ON. Signed-off-by: Hong Xu <hong.xu@atmel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
2011-09-27ASoC: Remove unused "control_data" field of struct wm8904_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-06-23ASoC: Add basic WM8918 supportMark Brown
The WM8918 is register compatible with the WM8904 with a subset of the functionality. Add the device ID, a subsequent patch will ensure that only the relevant functionality is exported to userspace. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.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>
2011-01-17ASoC: Avoid direct register cache access when setting defaultsMark Brown
Directly accessing the register cache means that we can't use anything except a flat register cache so use snd_soc_update_bits(). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-13ASoC: Update users of readable_register()/volatile_register()Dimitris Papastamos
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-28Merge branch 'for-2.6.37' into for-2.6.38Mark Brown
2010-12-28ASoC: codecs: wm8904: Fix register cache incoherencyLars-Peter Clausen
The multi-component patch(commit f0fba2ad1) moved the allocation of the register cache from the driver to the ASoC core. Most drivers where adjusted to this, but the wm8904 driver still uses its own register cache for its private functions, while functions from the ASoC core use the generic cache. Thus we end up with two from each other incoherent caches, which can lead to undefined behaviour. This patch fixes the issue by changing the wm8904 driver to use the generic register cache in its private functions. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Cc: Ian Lartey <ian@opensource.wolfsonmicro.com> Cc: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org (for 2.6.37 only)