summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8994.c
AgeCommit message (Collapse)Author
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-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-12-09Merge 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-23ASoC: 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>
2012-10-24ASoC: wm8994: Only enable extra BCLK cycles when requiredMark Brown
Rather than always assuming the maximum possible BCLK rate will be required generate BCLKs for stereo if either one or two channels is enabled. In order to support this we also need to ensure that only the relevant channels are enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-24ASoC: 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-10-15ASoC: wm8994: Tune VMID power down sequenceMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-15ASoC: wm8994: Tune VMID power up sequenceMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-15ASoC: wm8994: Allow a delay between jack insertion and microphone detectMark Brown
This can be used to provide some additional settling time to ensure that we don't start microphone detection while the microphone pin is connected to one of the headphone pins. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-05Merge branch 'asoc-omap' into for-3.7Mark Brown
2012-08-23ASoC: wm8994: Update for new WM1811 variantsMark Brown
There are some new WM1811 variants distinguished by both revision and cust_id which need slightly different handling. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-22ASoC: wm_hubs: Allow configuration of MICBIAS power up delay via pdataMark Brown
Sometimes the analogue circuitry connected to the microphone needs some time to settle after power up. Allow systems to configure this delay in the platform data, the driver will then insert the required delay during power up of paths that involve the microphone. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>