summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8994.c
AgeCommit message (Collapse)Author
2014-03-13Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown
2014-03-11ASoC: io: New signature for snd_soc_codec_set_cache_io()Xiubo Li
Now that all users have been converted to regmap and the config.reg_bits and config.val_bits can be setted by each user through regmap core API. So these two params are redundant here. Since the only control type that left is SND_SOC_REGMAP, so remove it. Drop the control params and add struct regmap *regmap to simplify the code. Signed-off-by: Xiubo Li <Li.Xiubo@freescale.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-03-01ASoC: wm8994: Use SOC_ENUM_SINGLE_VIRT_DECL()Lars-Peter Clausen
For the upcoming consolidation for MUXs and virtual MUXs we need to mark virtual enums as such. 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-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-20ASoC: wm8994: 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>
2014-02-20ASoC: wm8994: Fix the wrong number of enum itemsTakashi Iwai
wm8994 codec driver has a few places wrongly defining the number of enum items. Use SOC_ENUM_SINGLE_DECL() macro and they are automatically fixed. 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>
2013-11-27ASoC: wm8994: Move DCS done IRQ request laterwangbiao
once code return from request_threaded_irq, irq was setup enabled by default, but completion var dcs_done not got initialized yet, if then a dcs done irq was raised, system will got hung as the sync mechanism is invalid now. so this patch move dcs done irq request to the end of initialization of completion. Signed-off-by: wang, biao <biao.wang@intel.com> Signed-off-by: Zhang, Di <di.zhang@intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-08-22Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown
2013-08-06ASoC: wm8994: Fix class W controlsMark Brown
Commit 6e0650 (ASoC: wm8994: Use SOC_SINGLE_EXT() instead of open-coding it) went too far and converted a DAPM control to use SOC_SINGLE_EXT() which crashes. Revert that portion of the patch. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-29ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrolLars-Peter Clausen
We use the same 3 lines to get the CODEC for a kcontrol in a quite a few places. This patch puts them into a common helper function. Having this encapsulated in a helper function will also make it more easier to eventually change the data layout of the kcontrol's private data. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-19ASoC: wm8994: Use power efficient workqueueMark Brown
The accessory detect debounce work 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>
2013-07-15Merge remote-tracking branch 'asoc/fix/wm8994' into asoc-linusMark Brown
2013-07-15ASoC: wm8994: Move runtime PM init to platform device initMark Brown
As well as being better style this allows the device to idle when there is no audio card instantaited which is probably what we want. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-07-05ASoC: wm8994: Remove overly noisy debug loggingMark Brown
This was committed in error. Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-28Merge tag 'asoc-v3.11-2' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: More updates for v3.11 Some more fixes and enhancements, and also a bunch of refectoring for AC'97 support which enables more than one AC'97 controller driver to be built in.
2013-06-19ASoC: wm8994: 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>
2013-06-17Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown
2013-06-01ASoC: wm8994: Allow debounce before MICDET identificationMark Brown
For systems which do not have a jack detection feature allow some debounce to be specified before we perform accessory identification, improving robustness without impacting button detection responsiveness. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-06-01ASoC: wm8994: Remove unused variableMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-30ASoC: wm8994: Add digital loopback pathsMark Brown
There is loopback control within the audio interfaces, provide control of this as there are some obscure scenarios where this could be used in production. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-30ASoC: wm8994: Ensure microphone detection state is reset on removalMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-30ASoC: wm8994: Avoid leaking pm_runtime reference on removed jack raceMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-29ASoC: wm8994: Defer declaration of open circuit microphonesMark Brown
Provide a bit of debounce to handle pathological cases with slow input better by allowing the microphone detection to run for a bit longer. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-28ASoC: wm8994: Ensure lambda is zeroed for WM8994Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-28ASoC: wm8994: Remove restore of DAC enable stateMark Brown
It's not been needed since the regmap conversion. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-28ASoC: wm8994: check for array index returnedVinod Koul
The array 'drc_cfg' of size 3 may use index value -22 (EINVAL) The array 'retune_mobile_cfg' of size 3 may use index value -22 (EINVAL) Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-28ASoC: wm8994: Fix reporting of accessory removal on WM8958Mark Brown
During recent refactoring the code to report removal when MICDET reports an absent microphone was removed, causing problems for systems which rely solely on the MICDET for this functionality. Restore it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-28ASoC: wm8994: use the correct pointer to get the control valueVinod Koul
Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-20ASoC: wm8994: Handle LRCLK inversion for WM8958 and WM1811AMark Brown
On WM8958 and WM1811A separate control of the LRCLK inversion bit is available for the DAC and ADC LRCLKs which for compatibility reasons is done in a new register bit. Since writes to each scheme have no effect on parts using the other just always write to both for simplicity. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Vinod Koul <vinod.koul@intel.com> Tested-by: Samreen Nilofer <samreen.nilofer@intel.com>
2013-05-18ASoC: wm8994: missing break in wm8994_get_fll_config()Dan Carpenter
Smatch complains that: sound/soc/codecs/wm8994.c:2087 wm8994_get_fll_config() warn: missing break? reassigning 'fll->k' Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-13ASoC: wm8994: Support EFS mode for FLLMark Brown
Later WM8994 devices support an enhanced accuracy FLL divisor mode called EFS which allows more precise selection of fractional source to output ratios. Support this on relevant devices. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-05-03Merge tag 'asoc-v3.10-4' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next ASoC: Updates for v3.10 A few more bug fixes, the DAPM clock fix is actually a driver specific one since currently there's only one user of the clock support due to the problems relying on the clock API.
2013-04-30ASoC: wm8994: missing break in wm8994_aif3_hw_params()Dan Carpenter
The missing break here means that we always return early and the function is a no-op. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-04-09ASoC: wm8994: Remove duplicate revision cacheMark Brown
There's already a device revision stored in the core data structure, don't duplicate it in the CODEC driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-21ASoC: wm8994: Restore AIFnCLK after reducing it for low clock ratesMark Brown
This helps to ensure a smooth startup when we restore. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-21ASoC: wm8994: Support constraining the maximum number of channels clockedMark Brown
Some systems use the audio CODEC to clock a DAI with multiple data lines in parallel, meaning that bit clocks are only required for a smaller number of channels than data is sent for. In some cases providing the extra bit clocks can take the other devices on the audio bus out of spec. Support such systems by allowing a maximum number of channels to be specified. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-02-12Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown
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-12-10Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown
2012-12-07ASoC: wm8994: Fix variable double useMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-03ASoC: wm8994: Allow microphone identification callback to be overriddenMark Brown
Allow custom accessory identification mechanisms to make use of the MICDET support in the device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-03ASoC: wm8994: Check jack is inserted when handling mic IRQMark Brown
If we've got jack detection support then check that the jack is still inserted when handling a mic IRQ in order to avoid transient reports caused by shorts during the removal process as the two interrupts race with each other. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-03ASoC: wm8994: Support custom accessory identification for WM1811AMark Brown
Allow the user to override the accessory identification code with their own implementation if the system provides an alternative method. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-03ASoC: wm8994: Simplify button detection codeMark Brown
Currently the WM8994 driver allows the WM8958 microphone detection code to be replaced in its entirety, providing a default implementation. This doesn't actually reflect the needs of users well. They generally wish to replace only the accessory identification parts of the algorithm (eg, using an external GPIO to provide the equivalent of the JACKDET support in the WM1811A). In preparation for supporting these users better refactor the existing code so that we have separate identification and button detection callbacks, selecting between them rather than using the mic_detecting flag in the existing callback. This also simplifies the code by introducing a more explicit state machine for the detecting and button states. In anticipation of future refactoring the callback is left in the signature for wm8958_mic_detect(), it will be removed at a later stage. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-03ASoC: wm8994: Stop mic detection whenever we detect an open circuitMark Brown
Jack detection will not do anything to help us detect a microphone when there is a fault in the cable and the debounce we have is enough to avoid getting an intermediate result so halt microphone detection when we detect that one is not present. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-28ASoC: wm8994: Use the same DCS codes for all WM1811 variantsMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-24ASoC: wm8994: Use pdata cached in MFD driverMark Brown
This is better style and facilitates implementation of device tree support for the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-22ASoC: wm8994: Lower AIFnCLK divisor when dropping to 32kHzMark Brown
When lowering SYSCLK to 50kHz for accessory detection also lower the AIFnCLK divisor to normalise the clocking configuration within the device. This will not disrupt audio as we cannot support active audio with such a low SYSCLK. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-11-04ALSA: Fix typo in drivers soundMasanari Iida
Correct spelling typo in debug messages within drivers/sound Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>