summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8962.c
AgeCommit message (Collapse)Author
2011-11-11ASoC: Ensure we always delay for WM8962 FLL when starting from SYSCLKMark Brown
commit 0b7dd6ad92b6cace35dc5d06d6e236c2751c85dc upstream. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11ASoC: Ensure the WM8962 oscillator and PLLs start up disabledMark Brown
commit 2af8de8c39cf58e5a5e40a9d5d71332da98e6ba7 upstream. Since there is no current software control for these they would otherwise be left enabled, consuming power. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11ASoC: Ensure WM8962 PLL registers are resetMark Brown
commit 4f4488abc97c1c27ff029f887944e6a6da1f5733 upstream. The WM8962 has a separate software reset for the PLL registers. Ensure that these are reset also on startup. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11ASoC: Fix a bug in WM8962 DSP_A and DSP_B settingsSusan Gao
commit fbc7c62a3ff831aef24894b7982cd1adb2b7e070 upstream. Signed-off-by: Susan Gao <sgao@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmico.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-11ASoC: Remove direct register cache accesses from WM8962 driverMark Brown
commit 38f3f31a0a797bdbcc0cdb12553bbecc2f9a91c4 upstream. Also fix return values for speaker switch updates. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-09-20ASoC: Remove bitrotted wm8962_resume()Mark Brown
This functionality is now subsumed within the bias management, using the standard cache management functionality, without assuming the cache type. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-22ASoC: Clear any outstanding WM8962 FLL lock completions before waitingMark Brown
Ensure that we don't spuriously trigger early. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-14ASoC: Move WM8962 CLKREG_OVD earlierMark Brown
When the clocking registers are not overriden some of the registers are not writable. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Cc: stable@kernel.org
2011-07-20ASoC: Acknowledge WM8962 interrupts before acting on themMark Brown
This closes the small race between a status being read in response to an interrupt and clearing the interrupt, meaning that if the status changes between those periods we might not get a reassertion of the interrupt. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-08Merge branch 'for-3.0' into for-3.1Mark Brown
2011-06-08ASoC: Defer all WM8962 clocking configuration until power upMark Brown
Don't require an audio rate SYSCLK in hw_params() in order to better support microphone detection use cases. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-06-08ASoC: Implement base 5 band EQ control for WM8962Mark Brown
ReTune Mobile modes are not currently supported. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-08ASoC: Report errors when we have a WM8962 IRQ and don't get FLL lockMark Brown
We really should be getting the interrupt - if we don't get one it's very likely that the configuration is incorrect and audio will fail. Also increase the timeout substantially in this case for safety. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-08ASoC: Factor out I2C usage in WM8962 driverMark Brown
The chip can actually support SPI so we shouldn't assume we've got an I2C device even though that's the most common configuration. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-06-08ASoC: Fix WM8962 headphone volume update for use of advanced cachesMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Cc: stable@kernel.org
2011-04-27ASoC: Implement WM8962 ADC high pass filter configurationMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-04-26ASoC: Don't warn if the WM8962 SYSCLK FLL setting doesn't match realityMark Brown
When bringing up audio low power modes boards may configure SYSCLK before they actually start the FLL as we do much of the clocking setup prior to the power up sequence. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-04-26ASoC: Implement WM8962 DMIC supportMark Brown
DMIC support is automatically disabled when none of the GPIOs are set up to bring out the DMICCLK and DMICDAT pins at startup. Note that there's no support for controlling DMIC routing except the power control so the board DAPM configuration will need to manage DMIC enable and disable if analogue mics (eg, a headset) also exist. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-04-26ASoC: Move WM8962 FLL configuration to CODECMark Brown
There's only one DAI anyway. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-04-26ASoC: Support FLL lock interrupt on WM8962Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-03-31Fix common misspellingsLucas De Marchi
Fixes generated by 'codespell' and manually reviewed. Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-01-31ASoC: Accept any logical value for WM8962 GPIO set()Mark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-17ASoC: Avoid direct register cache access when setting defaultsMark Brown
Directly accessing the register cache means that we can't use anything except a flat register cache so use snd_soc_update_bits(). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-01-13ASoC: Update users of readable_register()/volatile_register()Dimitris Papastamos
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-28Merge branch 'for-2.6.37' into for-2.6.38Mark Brown
2010-12-28ASoC: codecs: wm8962: Fix register cache incoherencyLars-Peter Clausen
The multi-component patch(commit f0fba2ad1) moved the allocation of the register cache from the driver to the ASoC core. Most drivers where adjusted to this, but the wm8962 driver still uses its own register cache for its private functions, while functions from the ASoC core use the generic cache. Thus we end up with two from each other incoherent caches, which can lead to undefined behaviour. This patch fixes the issue by changing the wm8962 driver to use the generic register cache in its private functions. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org (for 2.6.37 only)
2010-12-28ASoC: One more x86 typo fixMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-27ASoC: Fix typo in x86 workaroundMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-23ASoC: ifdef out trace points from modules for x86Mark Brown
No idea why this works on ARM but not x86. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-12-22ASoC: Trace Wolfson jack detection IRQsMark Brown
Add jack detection interrupt trace to Wolfson CODEC drivers. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-08Merge branch 'for-2.6.37' into for-2.6.38Mark Brown
Conflicts: sound/soc/soc-core.c Axel's fix on two different branches.
2010-12-07ASoC: Correct WM8962 interrupt mask register readMark Brown
Fix mismerge from the out of tree BSP where this support was developed. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-22ASoC: Do not include soc-dapm.hJarkko Nikula
There is no need to include soc-dapm.h since soc.h includes it. Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-16ASoC: Fix incorrect kfree in wm8962_probe error pathAxel Lin
We allocated memory for wm8962 in wm8962_i2c_probe, and will free the memory in either wm8962_i2c_probe error path or wm8962_i2c_remove. Thus we should not call kfree(wm8962) in wm8962_probe, otherwise we have double free of wm8962. Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-12ASoC: Reset WM8962 with default ID valueMark Brown
The value makes no odds and it makes life easier with caches. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-06ASoC: Decouple DAPM from CODECsLiam Girdwood
Decoupling Dynamic Audio Power Management (DAPM) from codec devices is required when developing ASoC further. Such as for other ASoC components to have DAPM widgets or when extending DAPM to handle cross-device paths. This patch decouples DAPM related variables from struct snd_soc_codec and moves them to new struct snd_soc_dapm_context that is used to encapsulate DAPM context of a device. ASoC core and API of DAPM functions are modified to use DAPM context instead of codec. This patch does not change current functionality and a large part of changes come because of structure and internal API changes. Core implementation is from Liam Girdwood <lrg@slimlogic.co.uk> with some minor core changes, codecs and machine driver conversions from Jarkko Nikula <jhnikula@gmail.com>. Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Cc: Nicolas Ferre <nicolas.ferre@atmel.com> Cc: Manuel Lauss <manuel.lauss@googlemail.com> Cc: Mike Frysinger <vapier.adi@gmail.com> Cc: Cliff Cai <cliff.cai@analog.com> Cc: Kevin Hilman <khilman@deeprootsystems.com> Cc: Ryan Mallon <ryan@bluewatersys.com> Cc: Timur Tabi <timur@freescale.com> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Lars-Peter Clausen <lars@metafoo.de> Cc: Arnaud Patard (Rtp) <arnaud.patard@rtp-net.org> Cc: Wan ZongShun <mcuos.com@gmail.com> Cc: Eric Miao <eric.y.miao@gmail.com> Cc: Jassi Brar <jassi.brar@samsung.com> Cc: Daniel Gloeckner <dg@emlix.com> Cc: Kuninori Morimoto <morimoto.kuninori@renesas.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-05Merge branch 'for-2.6.37' into HEADMark Brown
2010-11-03ASoC: Use pm_wakeup_event() in WM8962 jack detectionMark Brown
Ensure that the system does not suspend while we process a WM8962 jack event by using pm_wakeup_event() to block the suspend while we're waiting for the jack to settle. Use a slightly longer timeout than the jack waits to allow for other stuff to take over and delays in scheduling. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03ASoC: Check return value of strict_strtoul() in WM8962Mark Brown
strict_strtoul() has been made __must_check so do so. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-13ASoC: Add WM8962 microphone bias controlMark Brown
We unconditionally require SYSCLK since while only microphone detection specifically requires SYSCLK any actual use case would enable it via some other means but microphone detection may have nothing active other than the bias itself. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-11ASoC: Compress WM8962 register access mapMark Brown
Reduce the source code size still futher by only specifying non-zero rows in the WM8962 access map. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-11ASoC: Shrink code size for WM8962 register defaults tableMark Brown
Dramatically reduce the code size for the WM8962 register defaults table by switching to explicitly initialise only defined registers, relying on static defaulting to zero for the overwelming bulk of the register map. Similar treatement for the register access table will come later and will produce a similarly dramatic code size shrink. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-02ASoC: Put WM8962 GPIO2/3 into GPIO mode when configuring platform data tooMark Brown
GPIO2 and GPIO3 on the WM8962 are MFPs and need to be put into GPIO mode before the GPIO block can be used to control them. We're already doing this when used via gpiolib, factor out the code for use when setting static configurations via platform data as well. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-02ASoC: Implement interrupt based jack detectionMark Brown
Allow microphone detection on WM8962 to be performed using the interrupt signal, allowing the detection of both microphone presence and button presses with a signal singal from the CODEC to CPU. Currently a 250ms debounce time is applied to both short circuit and presence detection, this has not been optimised. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-02ASoC: Add support for WM8962 GPIO outputsMark Brown
The WM8962 features five GPIOs, add support for controlling their output state via gpiolib. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-30ASoC: Relax restrictions on WM8962 BCLK configurationMark Brown
The restrictions on configuring BCLK are overly cautious, other constraints in the system should ensure that reconfiguration is not possible when the device is sufficiently active to be unable to support reclocking. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-30ASoC: Provide microphone bias configuration for WM8962Mark Brown
Add the widget for MICBIAS power control and allow configuration of the microphone bias setup via the platform data for the WM8962. When microphone status signals are brought out to GPIO this should be sufficient to enable microphone detection. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-29ASoC: Initial WM8962 IRQ supportMark Brown
Provide an initial hookup for interrupts on the WM8962. Currently we simply report error status via log messages if an IRQ is provided for the device. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-29ASoC: Lowercase WM8962 CODEC nameMark Brown
For consistency. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-28ASoC: Fix masking of WM8962 FLL1 registerMark Brown
When configuring the FLL we preserve the FLL enable configuration in order to allow us to reenable the FLL after configuration but we do not clear the other bits in the register, causing old configuration to be preserved. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>