summaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/wm8994.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'asoc/topic/io' into asoc-nextMark Brown2014-03-131-2/+1
|\
| * ASoC: io: New signature for snd_soc_codec_set_cache_io()Xiubo Li2014-03-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
* | ASoC: wm8994: Use SOC_ENUM_SINGLE_VIRT_DECL()Lars-Peter Clausen2014-03-011-2/+1
| | | | | | | | | | | | | | | | | | 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>
| |
| \
| \
| \
*---. \ Merge branches 'topic/dapm', 'topic/sign', 'topic/adau1373', ↵Mark Brown2014-03-011-83/+97
|\ \ \ \ | | | |/ | | |/| | | | | 'topic/max98090', 'topic/mc13783', 'fix/wm8994' and 'topic/wm8995' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into asoc-enum
| | | * ASoC: wm8994: Fix the wrong number of enum itemsTakashi Iwai2014-02-201-65/+70
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * / ASoC: wm8994: Update locking around use of DAPM pin APICharles Keepax2014-02-201-18/+27
| |/ | | | | | | | | | | | | | | 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>
* / ASoC: Rename soc_enum.max field with itemsTakashi Iwai2014-02-201-2/+2
|/ | | | | | | | | | | | | | | | | | 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>
* ASoC: wm8994: Move DCS done IRQ request laterwangbiao2013-11-271-6/+5
| | | | | | | | | | | | | | 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>
* Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown2013-08-221-15/+20
|\
| * ASoC: wm8994: Fix class W controlsMark Brown2013-08-061-1/+1
| | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Use power efficient workqueueMark Brown2013-07-191-9/+14
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Move runtime PM init to platform device initMark Brown2013-07-151-5/+5
| | | | | | | | | | | | | | 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>
* | ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrolLars-Peter Clausen2013-07-291-3/+1
| | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'asoc/fix/wm8994' into asoc-linusMark Brown2013-07-151-4/+0
|\ \ | |/ |/|
| * ASoC: wm8994: Remove overly noisy debug loggingMark Brown2013-07-051-4/+0
| | | | | | | | | | | | This was committed in error. Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge tag 'asoc-v3.11-2' of ↵Takashi Iwai2013-06-281-8/+4
|\ \ | |/ |/| | | | | | | | | | | | | | | 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.
| * ASoC: wm8994: Use SOC_SINGLE_EXT() instead of open-coding itLars-Peter Clausen2013-06-191-8/+4
| | | | | | | | | | Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
* | Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown2013-06-171-43/+145
|\ \ | |/ |/|
| * ASoC: wm8994: Allow debounce before MICDET identificationMark Brown2013-06-011-2/+33
| | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Remove unused variableMark Brown2013-06-011-1/+0
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8994: Add digital loopback pathsMark Brown2013-05-301-2/+29
| | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Defer declaration of open circuit microphonesMark Brown2013-05-291-9/+31
| | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Ensure lambda is zeroed for WM8994Mark Brown2013-05-281-0/+1
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8994: Remove restore of DAC enable stateMark Brown2013-05-281-16/+0
| | | | | | | | | | | | It's not been needed since the regmap conversion. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8994: Handle LRCLK inversion for WM8958 and WM1811AMark Brown2013-05-201-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: missing break in wm8994_get_fll_config()Dan Carpenter2013-05-181-0/+1
| | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Support EFS mode for FLLMark Brown2013-05-131-13/+36
| | | | | | | | | | | | | | | | 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>
* | ASoC: wm8994: Ensure microphone detection state is reset on removalMark Brown2013-05-301-0/+1
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: wm8994: Avoid leaking pm_runtime reference on removed jack raceMark Brown2013-05-301-1/+1
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: wm8994: check for array index returnedVinod Koul2013-05-281-0/+5
| | | | | | | | | | | | | | | | 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>
* | ASoC: wm8994: Fix reporting of accessory removal on WM8958Mark Brown2013-05-281-0/+5
| | | | | | | | | | | | | | | | 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>
* | ASoC: wm8994: use the correct pointer to get the control valueVinod Koul2013-05-281-1/+1
|/ | | | | Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* Merge tag 'asoc-v3.10-4' of ↵Takashi Iwai2013-05-031-0/+1
|\ | | | | | | | | | | | | | | | | | | 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.
| * ASoC: wm8994: missing break in wm8994_aif3_hw_params()Dan Carpenter2013-04-301-0/+1
| | | | | | | | | | | | | | | | | | 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
* | ASoC: wm8994: Remove duplicate revision cacheMark Brown2013-04-091-12/+11
| | | | | | | | | | | | | | 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>
* | ASoC: wm8994: Restore AIFnCLK after reducing it for low clock ratesMark Brown2013-03-211-0/+32
| | | | | | | | | | | | This helps to ensure a smooth startup when we restore. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: wm8994: Support constraining the maximum number of channels clockedMark Brown2013-03-211-2/+11
|/ | | | | | | | | | | | 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>
* Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown2013-02-121-5/+5
|\
| * ASoC: wm8994: Fix variable double useMark Brown2012-12-071-5/+5
| | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
* | ASoC: codecs: remove __dev* attributesBill Pemberton2012-12-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | 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>
* | Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown2012-12-101-141/+202
|\|
| * ASoC: wm8994: Allow microphone identification callback to be overriddenMark Brown2012-12-031-6/+16
| | | | | | | | | | | | | | Allow custom accessory identification mechanisms to make use of the MICDET support in the device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8994: Check jack is inserted when handling mic IRQMark Brown2012-12-031-0/+12
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Support custom accessory identification for WM1811AMark Brown2012-12-031-15/+21
| | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Simplify button detection codeMark Brown2012-12-031-50/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Stop mic detection whenever we detect an open circuitMark Brown2012-12-031-25/+31
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Use the same DCS codes for all WM1811 variantsMark Brown2012-11-281-14/+2
| | | | | | | | | | Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
| * ASoC: wm8994: Use pdata cached in MFD driverMark Brown2012-11-241-22/+28
| | | | | | | | | | | | | | This is better style and facilitates implementation of device tree support for the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
| * ASoC: wm8994: Lower AIFnCLK divisor when dropping to 32kHzMark Brown2012-11-221-0/+12
| | | | | | | | | | | | | | | | | | 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>
| * ASoC: wm8994: Lower AIFnCLK divisor when dropping to 32kHzMark Brown2012-10-241-0/+12
| | | | | | | | | | | | | | | | | | 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>