summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8994.c
AgeCommit message (Collapse)AuthorFilesLines
2012-06-05ASoC: wm8994: Apply volume updates with clocks enabledMark Brown1-35/+58
Volume updates may not be acted upon if there is no clock applied when the volume update is written. Ensure this doesn't happen by writing out registers with volume updates after we enable each of the clocks. There are more registers updated than before as previously we were relying on wm_hubs to set those for controls it manages. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-06-05ASoC: wm8994: Ensure all AIFnCLK events are run from the _late variantsMark Brown1-4/+8
Ensure that all the actions get taken at appropriate times by calling the _PRE and _POST events for the aifNclk_ev functions explicitly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-05-21Merge branch 'topic/asoc' into for-linusTakashi Iwai1-177/+113
2012-05-15ASoC: wm8994: Fix AIF2ADC power downMark Brown1-1/+1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-05-13Merge tag 'v3.4-rc7' into for-3.5Mark Brown1-54/+222
Linux 3.4-rc7 Conflicts): drivers/base/regmap/regmap.c (overlap with bug fixes) sound/soc/blackfin/bf5xx-ssm2602.c (overlap with bug fixes)
2012-05-09ASoC: wm8994: Use regmap directly for wm8994_mic_workMark Brown1-7/+9
Make it clearer what context we're operating in. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-09ASoC: wm8994: Add debounce to wm8994 mic detectionMark Brown1-7/+20
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-09ASoC: wm8994: Fix sparse warning due to use of 0 as NULLMark Brown1-1/+1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-27ASoC: wm_hubs: Factor out class W managementMark Brown1-76/+15
Since the analogue portions of the checks for class W are the same over all the devices factor out these checks into wm_hubs and while we're at it also use wm_hubs_dac_hp_direct() to enable class W optimisations on more paths. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-27ASoC: wm_hubs: Special case headphones for digital paths in more use casesMark Brown1-3/+1
The optimisations which we can do with caching the headphone DCS result in wm_hubs have only been enabled in cases where class W is enabled. However, there are more use cases which can benefit from the cache, especially with WM8994 series devices with their more advanced digital routing. Rather than keying off the class W information from the CODECs have a check in wm_hubs for a suitable path and use that to determine if we can deploy our headphone optimisations. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26ASoC: wm8994: Add trace showing wm8958_micd_set_rate()Mark Brown1-0/+4
This can be helpful to users when tuning their systems. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26ASoC: wm8994: Allow rate configuration with custom mic callbackMark Brown1-1/+2
If a driver using a custom mic detection callback has provided a table of mic detection rates via platform data then use it. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26ASoC: wm8994: Tune debounce rates for jack detect modeMark Brown1-2/+4
Use a slightly larger debounce when identifying accessory type and a slightly smaller one when detecting buttons in response to user feedback from large scale testing. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-25ASoC: wm8994: Make sure we disable FLL bypass when stopping the FLLKyung-Kwee Ryu1-1/+1
If FLL bypass is left enabled when we disable the CODEC then the output clock will be left running which consumes a small amount of additional current. Only enable bypass when there is an output. Signed-off-by: Kyung-Kwee Ryu <Kyung-Kwee.Ryu@wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-23ASoC: wm8994: Delete trailing whitespace from sound/soc/codecs/wm8994.cJesper Juhl1-7/+6
While reading through sound/soc/codecs/wm8994.c I noticed a fair amount of trailing whitespace. This patch gets rid of it. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-23ASoC: wm8994: Improve sequencing of AIF channel enablesMark Brown1-54/+222
This ensures a clean startup of the channels, without this change some use cases could result in issues in a small proportion of cases. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-04-17ASoC: wm8994: Keep AIF3 tristated when not in useMark Brown1-5/+4
Since AIF3 shares clock signals with other audio interfaces in order to ensure it doesn't drive undesirable clocks we need to tristate it. Rather than forcing the machine driver to do so have the driver do this. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-10ASoC: wm8994: Implement FLL bypass supportMark Brown1-0/+19
Later WM8994 class devices can bypass the FLL from BCLK. Do this automatically when the FLL input and output frequencies match up. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-10ASoC: wm8994: Don't test for NULL before release_firmware()Jesper Juhl1-8/+4
release_firmware() does its own NULL ptr testing, it's redundant to also test before calling it. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-04ASoC: wm8994: Don't bother updating the jackdet mode needlesslyMark Brown1-0/+3
If we're not doing jackdet it's not needed. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01ASoC: wm8994: Don't bother lowering clock dividers inside idle AIFsMark Brown1-29/+0
This increases the chances we'll manage to hit a partially configured state on restart and the power savings are extremely small. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01ASoC: wm8994: Don't allow reconfiguration of FLL when it provides SYSCLKMark Brown1-18/+17
Rather than trying to work around machine drivers which try to reprogram the FLL while it is providing SYSCLK just return an error if they try. This will avoid audio glitches during FLL reconfiguration, or at least move the introduction of the glitches to the machine driver. Since disabling the source for an active SYSCLK is not supported in the first place systems shouldn't be doing this in the first place. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-01ASoC: wm8994: Don't lock CODEC mutex to do DAPM syncMark Brown1-13/+4
DAPM now has a DAPM-level lock which it manages itself so we don't need to take the CODEC mutex to call DAPM any more. Also remove a redundant call to snd_soc_dapm_sync(), jack reporting also triggers a DAPM sync. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-30Merge tag 'sound-3.4' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound Pull sound fixes from Takashi Iwai: "A collection of small fixes for 3.4-rc1, including - mic-recording regression fix for Realtek codec - clean-up of dmaengine parameter mess - WM8894 calibration tweak - minor fixes for asihpi and some bool module parms" * tag 'sound-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: ALSA: fix isa/opti9xx module param type sound: fix oss/msnd_pinnacle module param type ALSA: asihpi - fix return type of hpios_locked_mem_alloc() ASoC: dmaengine_pcm: use dmaengine cyclic wrapper ASoC: Add extra parameter to device_prep_dma_cyclic ALSA: hda/realtek - Fix ADC assignment with a shared HP/Mic pin ASoC: wm8994: Update WM8994 DCS calibration
2012-03-22Merge tag 'regmap-3.4' of ↵Linus Torvalds1-24/+1
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap Pull regmap updates from Mark Brown: "Things are really quieting down with the regmap API, while we're still seeing a trickle of new features coming in they're getting much smaller than they were. It's also nice to have some features which support other subsystems building infrastructure on top of regmap. Highlights include: - Support for padding between the register and the value when interacting with the device, sometimes needed for fast interfaces. - Support for applying register updates to the device when restoring the register state. This is intended to be used to apply updates supplied by manufacturers for tuning the performance of the device (many of which are to undocumented registers which aren't otherwise covered). - Support for multi-register operations on cached registers. - Support for syncing only part of the register cache. - Stubs and parameter query functions intended to make it easier for other subsystems to build infrastructure on top of the regmap API. plus a few driver updates making use of the new features which it was easier to merge via this tree." * tag 'regmap-3.4' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regmap: (41 commits) regmap: Fix future missing prototype of devres_alloc() and friends regmap: Rejig struct declarations for stubbed API regmap: Fix rbtree block base in sync regcache: Make sure we sync register 0 in an rbtree cache regmap: delete unused module.h from drivers/base/regmap files regmap: Add stub for regcache_sync_region() mfd: Improve performance of later WM1811 revisions regmap: Fix x86_64 breakage regmap: Allow drivers to sync only part of the register cache regmap: Supply ranges to the sync operations regmap: Add tracepoints for cache only and cache bypass regmap: Mark the cache as clean after a successful sync regmap: Remove default cache sync implementation regmap: Skip hardware defaults for LZO caches regmap: Expose the driver name in debugfs mfd: wm8400: Convert to devm_regmap_init_i2c() mfd: wm831x: Convert to devm_regmap_init() mfd: wm8994: Convert to devm_regmap_init() mfd/ASoC: Convert WM8994 driver to use regmap patches mfd: Add __devinit and __devexit annotations in wm8994 ...
2012-03-21ASoC: wm8994: Update WM8994 DCS calibrationMark Brown1-1/+1
Based on latest production information. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-03-19ASoC: wm8994: Provide VMID mode control and fix default sequenceMark Brown1-39/+147
The optimal management of VMID depends on a number of factors which vary dynamically at runtime, for example the connection to a system docking station. In some circumstances it is desirable to keep VMID enabled all the time, in others it is desirable to aggressively power it up and down. Provide a callback allowing machine driver to configure either the normal power up/down mode (WM8994_VMID_MODE_NORMAL) or to maintain VMID even when idle (WM8994_VMID_MODE_FORCE). This callback, wm8994_vmid_mode(), should be called with the CODEC lock. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-19ASoC: wm8994: Add missing break in resumeMark Brown1-0/+1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-12ASoC: wm8994: Prevent ABBA deadlock with CODEC and accdet mutexesMark Brown1-35/+34
Currently we can the accdet mutex from within DAPM when updating the device state which means we take accdet then the CODEC mutex but we also do the locking the other way around when responding to the jackdet IRQ. Move all the jackdet use of the CODEC mutex out of the accdet lock to avoid this. Since all the DAPM interactions depend only on a single threaded IRQ this is still serialised. The locking improvements in 3.5 allow a better solution there. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-06ASoC: wm8994: Use audio mode for jack detection when system is activeMark Brown1-29/+48
When we are out of system sleep always use audio mode for jack detection in order to avoid potential performance issues handing off between modes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm8994: Factor out WM1811A detection mode settingMark Brown1-20/+28
Push everything through one function for active use cases, should be no practical effect. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm8994: Don't bother updating the jackdet mode needlesslyMark Brown1-0/+3
If we're not doing jackdet it's not needed. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm8994: Disable JACKDET when disabling detectonMark Brown1-0/+1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm8994: Make sure we sync DAPM on WM8958 detection mode changesMark Brown1-0/+2
Normally this will have no effect as we set detection up at system startup before DAPM syncs take effect, this will only be useful if the system enables and disables detection at runtime. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm_hubs: Disable cache of the DC servo calibration for WM1811Mark Brown1-0/+1
The WM1811 DC servo is able to run much faster than previous devices so the benefit of skipping calibration is not useful. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm8994: Suppress noop updates of FLL KMark Brown1-1/+2
Using snd_soc_write() means we always write to the register even if it already contains the newly calculated value. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm8994: Push wm8994 private data allocation out into device probeMark Brown1-9/+13
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-01ASoC: wm8994: Disable debounce of jack detection on inserted jackMark Brown1-0/+8
Don't debounce jack detection for inserted jacks, giving improved responsiveness. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-29ASoC: wm8994: Remove stub of register access codeMark Brown1-8/+0
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-29ASoC: wm8994: Make sure we don't have MICBIAS on during jackdet modeMark Brown1-12/+13
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-22mfd/ASoC: Convert WM8994 driver to use regmap patchesMark Brown1-24/+1
Early revisions of several of the WM8994 variants have register updates to improve performance. Move these over to using the regmap patch system instead of open coding them in the audio driver. Since the regmap init is done by the MFD the code is moved there. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
2012-02-21ASoC: wm8994: Move wm_hubs callback before we start ramping VMIDMark Brown1-2/+2
Allows the generic code to set up for that. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21ASoC: wm8994: Support external capacitors on MICBIAS2 with jack detectionMark Brown1-0/+24
When an external capacitor is connected to MICBIAS2 on devices with jack detection (which is not required but may be done in some systems) then the loading may mean that better performance is obtained when the microphone bias is enabled normally rather than using the low power mode. Provide platform data allowing systems to indicate if they require this. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21ASoC: wm8994: Actively discharge idle MICBIAS with jack detectMark Brown1-0/+9
This minimises the chance of any external capacitors that are fitted being discharged into headphones as they insert. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21ASoC: wm8994: Enable headphone startup mode 1 for WM1811 and WM8958Mark Brown1-0/+2
The latest recommendation for optimal performance. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-17ASoC: wm8994: Convert to use DAI widget routing rather than streamsMark Brown1-6/+14
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2012-02-14ASoC: wm8994: Use slow start for VMIDMark Brown1-1/+1
Improves performance on power up. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-11ASoC: wm8994: Actively discharge VMID when not in useMark Brown1-0/+4
Ensure we're in a known state when we restart. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-11ASoC: wm8994: VMID management improvementsMark Brown1-6/+14
Raise the ramp time to 50ms to cover corner cases, use the startup bias generator, explicitly reset the ramp circuit when complete and reorder things all of which should improve performance somewhat for systems that are sensitive to noise from VMID. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-11ASoC: wm_hubs: Improve single ended line output enable performanceMark Brown1-0/+5
The enable of the single ended line outputs on wm_hubs devices performs better if the output is enabled prior to starting VMID. Since inactive outputs are held at VMID anyway there is little cost to doing this for unused outputs. Add callbacks into wm_hubs and keep track of which outputs are really active so we can disable them once we're active. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>