summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8996.c
AgeCommit message (Collapse)Author
2014-08-04Merge remote-tracking branches 'asoc/topic/atmel', 'asoc/topic/cirrus' and ↵Mark Brown
'asoc/topic/cleanup' into asoc-next
2014-08-04Merge remote-tracking branches 'asoc/topic/adau1977', 'asoc/topic/ak4642', ↵Mark Brown
'asoc/topic/ak5386' and 'asoc/topic/arizona' into asoc-next
2014-07-03ASoC: wm8996: Remove unused variableSachin Kamat
'ret' is not used in the function. Remove it. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-19ASoC: wm5100/wm8903/wm8996: Replace open-coded snd_soc_dapm_to_codec()Lars-Peter Clausen
We now have a generic helper function to cast from a DAPM context to a CODEC. Make use of it in the places which previously open-coded it. 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-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/wm8996', 'asoc/topic/wm9081' and ↵Mark Brown
'asoc/topic/wm9705' 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-03-01Merge branches 'topic/dapm', 'topic/sign', 'topic/adau1373', ↵Mark Brown
'topic/max98090', 'topic/mc13783', 'fix/wm8994' and 'topic/wm8995' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-enum
2014-02-25ASoC: wm8996: Replace codec->control_data with wm8996->regmapLars-Peter Clausen
With the ongoing component-ization of the ASoC framework and the continuing migration to using regmap for IO the control_data field of the snd_soc_codec struct will eventually be removed. Prepare the wm8996 driver for this by using wm8996->regmap instead of accessing the CODEC's control_data field. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23ASoC: wm8996: 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: wm8996: Update locking around use of DAPM pin APICharles Keepax
The pin updates in this driver look like they are intended to be done atomically, update to do so. Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> 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-11-08Merge remote-tracking branch 'asoc/topic/wm8996' into asoc-nextMark Brown
2013-11-07ASoC: wm8996: 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-10-30ASoC: wm8996: Fix negative array index readTakashi Iwai
Spotted by coverity CID 146355. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2012-12-09ASoC: 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-08ASoC: dapm: Add flags to regulator suppliesMark Brown
This will be used to enable additional control of the regulators. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-06-25ASoC: wm8996: Move register default configuration to I2C probeMark Brown
This gets the registers set up as early as possible, mainly useful for the GPIOs to ensure that they're in the correct mode. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25ASoC: wm8996: Inline wm8996_reset() and optimise cache-only usageMark Brown
There is only one caller and this allows us to cleanly leave the CODEC with the internal LDO powered down which is the default state we're looking for and means that we can robustly disable the register cache only when we either disable the LDO or power down the external regulators. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25ASoC: wm8996: Move regulator notifier callbacks into I2C levelMark Brown
Now that we're using regmap the cache is available here. 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: wm8996: Convert to devm_regmap_init_i2c()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11ASoC: wm8996: Remove write sequencer registers from the defaults tableMark Brown
They aren't marked as readable and the feature is never used so they'll never get referenced. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11ASoC: wm8996: Mark the CODEC as cache only when powering off on bootMark Brown
Otherwise we might try to write to a powered off device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11ASoC: wm8996: Move reset before the initial regulator disableMark Brown
If we don't have control over the LDO but do have control over the other regulators then we may end up trying to write to a powered off device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11ASoC: wm8996: Remove spurious regulator_bulk_free()Mark Brown
We're using demv_regulator_bulk_get() so don't need to manually free and this is in the CODEC driver not the I2C driver anyway. 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-04-26ASoC: wm8996: Put the microphone biases into bypass mode when idleMark Brown
When we're not actively doing audio we don't need the microphone biases to be regulated, noise is not important when we are not looking at the audio signal. Save some power by putting the MICBIAS regulators into bypass mode when not doing audio. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14ASoC: wm8996: Add 44.1kHz supportMark Brown
The WM8996 specification has been updated to specify 44.1kHz as a supported sample rate. Update the driver to accept this configuration. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-08ASoC: wm8996: Remove separate output stage enable stepMark Brown
Marginally improve performance during startup. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-08ASoC: wm8996: Remove some volatile regisers from the defaults tableMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-29ASoC: wm8996: Remove stub register cacheMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-29ASoC: wm8996: Fix /RESET bounce orderingMark Brown
We want to leave the device out of rather than in reset. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21ASoC: wm8996: Convert to use DAPM routes for stream connectionsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21ASoC: wm8996: Implement DRC coefficient configurationMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-17ASoC: wm8996: Make sure we bounce /RESET to resetMark Brown
While it matches the current code only bringing the device out of reset isn't actually doing what the function says so make sure we set the GPIO high before we pull it low. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-17ASoC: wm8996: Convert to module_i2c_driver()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-16ASoC: Show device id in the debug messageAxel Lin
Show the id we read when the id mismatch is detected. This is useful for debugging. Signed-off-by: Axel Lin <axel.lin@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-09Merge tag 'v3.3-rc3' as we've got several bugfixes in there which areMark Brown
colliding annoyingly with development. Linux 3.3-rc3 .. the number of the half-beast? Conflicts: sound/soc/codecs/wm5100.c sound/soc/codecs/wm8994.c
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-02-01ASoC: wm8996: Use devm_regulator_bulk_get()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-01ASoC: wm8996: Switch to using common code for managing CPVDD supplyMark Brown
Nice code saving. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-01Merge tag 'v3.3-rc2' into for-3.4Mark Brown
A reasonable amount of new development is causing fiddly merge conflicts between different resource management changes (mostly fixing bugs in resource management due to noticing things while doing enhancements in the same area). Linux 3.3-rc2 .. several days delayed. No reason, I just didn't think of it.
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-26ASoC: wm8996: Handle failures to determine accessory polarityMark Brown
If we get an indeterminate impedance with both headset polarities then give up and report the accessory as a headphone rather than continually retrying. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-25ASoC: wm8996: Mark register cache as dirty when regulators are disabledMark Brown
Otherwise we won't resync later. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-22ASoC: wm8996: Call _POST_PMU callback for CPVDDMark Brown
We should be allowing a 5ms delay after the charge pump is started in order to ensure it has finished ramping. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
2012-01-20ASoC: 24 bits are significant on the WM8996 audio interfacesMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20ASoC: Disable register synchronisation for low frequency WM8996 SYSCLKMark Brown
With a low frequency SYSCLK and a fast I2C clock register synchronisation may occasionally take too long to take effect, causing I/O issues. Disable synchronisation in order to avoid any issues. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org