summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8994.c
AgeCommit message (Collapse)Author
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>
2012-08-17ASoC: wm8994: Add bytes controls for DRCMark Brown
If DRC coefficients are not configured via platform data then add bytes controls for them instead so they can be configured by applications. This is the normal means of controlling things like this for newer systems, we maintain compatibility with platform data to avoid disruption to existing systems. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-09ASoC: wm8994: Add missing dapm routes for WM8958 rev AChris Rattray
Signed-off-by: Chris Rattray <crattray@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-03ASoC: wm8994: enable mic and short detect debounce.Chris Rattray
Signed-off-by: Chris Rattray <crattray@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-03ASoC: wm8994: Fix some indentation issuesMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-03ASoC: wm8994: Ensure we get a notification on startup for jackdetMark Brown
Since jackdet only reports deltas it won't generate an interrupt on startup when a jack is not present. This doesn't make a difference to userspace but does mean we don't generate a notification via the internal notifier chains. Fix that by scheduling a work to poll the chip after the clock is enabled. Use an extremely large timeout since there's no urgency and we don't want to report a false negative. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-03ASoC: wm_hubs: Move CODEC stored in private data into wm_hubsMark Brown
Further wm_hubs code will use this. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-03ASoC: wm8994: Implement support for self-oscillation mode in the FLLMark Brown
The FLLs in the WM8994 series devices can be started without any reference being supplied, mainly for use in analogue bypass cases. Implement support for this mode. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-24ASoC: wm8994: Hold runtime PM reference while handling mic and jack IRQsMark Brown
Ensures that we don't interact badly with the power management framework, especially in the cases where we're doing deferred work or we're using a direct GPIO for these signals. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-23ASoC: wm8994: Ensure there are enough BCLKs for four channelsMark Brown
Otherwise if someone tries to use all four channels on AIF1 with the device in master mode we won't be able to clock out all the data. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-07-23Merge branch 'for-3.5' into for-3.6Mark Brown
2012-07-18ASoC: wm8994: Update micdet for irqdomain conversionMark Brown
The conversion of the core driver to irqdomains means that we don't need and irq_base to have working interrupts so use wm8994_request_irq() to deal with looking up the interrupt number for the micdet IRQ. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-07-03ASoC: wm8994: Don't suspend accessory detectionMark Brown
Leave it up to the machine driver to disable accessory detection if desired, the common pattern is to have accessory detection be a wake source. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25ASoC: wm8994: remove duplicate codeJaroslav Kysela
It seems that the code duplication was added at a merge operation. Signed-off-by: Jaroslav Kysela <perex@perex.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
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-05ASoC: wm8994: Apply volume updates with clocks enabledMark Brown
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 Brown
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-06-03ASoC: codecs: Refresh copyrights for Wolfson driversMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-21Merge branch 'topic/asoc' into for-linusTakashi Iwai
2012-05-15ASoC: wm8994: Fix AIF2ADC power downMark Brown
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 Brown
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 Brown
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 Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-05-09ASoC: wm8994: Fix sparse warning due to use of 0 as NULLMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-27ASoC: wm_hubs: Factor out class W managementMark Brown
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 Brown
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 Brown
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 Brown
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 Brown
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 Ryu
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 Juhl
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 Brown
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 Brown
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 Brown
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 Juhl
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 Brown
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 Brown
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 Brown
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 Brown
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 Torvalds
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-23Merge tag 'regmap-3.4' of ↵Linus Torvalds
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 Brown
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 Brown
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 Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-12ASoC: wm8994: Prevent ABBA deadlock with CODEC and accdet mutexesMark Brown
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 Brown
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 Brown
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 Brown
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 Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm8994: Make sure we sync DAPM on WM8958 detection mode changesMark Brown
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>