summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8994.c
AgeCommit message (Collapse)AuthorFilesLines
2012-12-10ASoC: codecs: remove __dev* attributesBill Pemberton1-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>
2012-12-10Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown1-141/+202
2012-12-03ASoC: wm8994: Allow microphone identification callback to be overriddenMark Brown1-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>
2012-12-03ASoC: wm8994: Check jack is inserted when handling mic IRQMark Brown1-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>
2012-12-03ASoC: wm8994: Support custom accessory identification for WM1811AMark Brown1-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>
2012-12-03ASoC: wm8994: Simplify button detection codeMark Brown1-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>
2012-12-03ASoC: wm8994: Stop mic detection whenever we detect an open circuitMark Brown1-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>
2012-11-28ASoC: wm8994: Use the same DCS codes for all WM1811 variantsMark Brown1-14/+2
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-11-24ASoC: wm8994: Use pdata cached in MFD driverMark Brown1-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>
2012-11-22ASoC: wm8994: Lower AIFnCLK divisor when dropping to 32kHzMark Brown1-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>
2012-11-04ALSA: Fix typo in drivers soundMasanari Iida1-1/+1
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 Brown1-1/+17
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 Brown1-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>
2012-10-15ASoC: wm8994: Tune VMID power down sequenceMark Brown1-18/+4
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-15ASoC: wm8994: Tune VMID power up sequenceMark Brown1-2/+2
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-15ASoC: wm8994: Allow a delay between jack insertion and microphone detectMark Brown1-19/+55
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 Brown1-0/+2
2012-08-23ASoC: wm8994: Update for new WM1811 variantsMark Brown1-4/+7
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 Brown1-0/+2
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 Brown1-4/+21
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 Rattray1-0/+2
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 Rattray1-0/+6
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 Brown1-2/+2
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-03ASoC: wm8994: Ensure we get a notification on startup for jackdetMark Brown1-1/+36
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 Brown1-15/+13
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 Brown1-6/+15
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 Brown1-0/+13
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 Brown1-1/+1
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 Brown1-3/+0
2012-07-18ASoC: wm8994: Update micdet for irqdomain conversionMark Brown1-3/+4
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 Brown1-37/+0
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 Kysela1-3/+0
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 Brown1-39/+66
Linux 3.5-rc4 contains some bug fixes which overlap with new features.
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-06-03ASoC: codecs: Refresh copyrights for Wolfson driversMark Brown1-1/+1
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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