summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm8994.h
AgeCommit message (Collapse)Author
2021-03-11ASoC: wm8994: align function prototypePierre-Louis Bossart
cppcheck warning: sound/soc/codecs/wm8994.c:3923:26: style:inconclusive: Function 'wm8958_mic_detect' argument 3 names different: declaration 'cb' definition 'det_cb'. [funcArgNamesDifferent] wm1811_micdet_cb det_cb, void *det_cb_data, ^ sound/soc/codecs/wm8994.h:53:26: note: Function 'wm8958_mic_detect' argument 3 names different: declaration 'cb' definition 'det_cb'. wm1811_micdet_cb cb, void *det_cb_data, ^ sound/soc/codecs/wm8994.c:3923:26: note: Function 'wm8958_mic_detect' argument 3 names different: declaration 'cb' definition 'det_cb'. wm1811_micdet_cb det_cb, void *det_cb_data, ^ Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Acked-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.kernel.org/r/20210311004332.120901-8-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-10-01ASoC: wm8994: Add support for setting MCLK clock rateSylwester Nawrocki
Extend the set_sysclk() handler so we also set frequency of the MCLK1, MCLK2 clocks through clk API when those clocks are specified in DT. Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Acked-by: Krzysztof Kozlowski <krzk@kernel.org> Link: https://lore.kernel.org/r/20190920130218.32690-4-s.nawrocki@samsung.com Signed-off-by: Mark Brown <broonie@kernel.org>
2019-06-19treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 500Thomas Gleixner
Based on 2 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation this program is free software you can redistribute it and or modify it under the terms of the gnu general public license version 2 as published by the free software foundation # extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 4122 file(s). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Enrico Weigelt <info@metux.net> Reviewed-by: Kate Stewart <kstewart@linuxfoundation.org> Reviewed-by: Allison Randal <allison@lohutok.net> Cc: linux-spdx@vger.kernel.org Link: https://lkml.kernel.org/r/20190604081206.933168790@linutronix.de Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-12ASoC: wm8993/wm8994/wm8958: replace codec to componentKuninori Morimoto
Now we can replace Codec to Component. Let's do it. Becase wm8993/wm8994/wm8958 are using wm_hubs feature, we need to update these all related drivers in same time. Otherwise compile error/warning happen wm8993: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 wm8994: xxx_codec_xxx() -> xxx_component_xxx() .idle_bias_off = 0 -> .idle_bias_on = 1 .ignore_pmdown_time = 0 -> .use_pmdown_time = 1 - -> .endianness = 1 - -> .non_legacy_dai_naming = 1 Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2014-11-10ASoC: wm8958: Move DSP firmware lock to driver levelLars-Peter Clausen
The wm8958 driver uses the snd_soc_codec mutex to protect the various firmware pointers from concurrent assignment. This patch moves this lock to the driver level. This will allow us to eventually remove the snd_soc_codec mutex. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org>
2013-06-01ASoC: wm8994: Allow debounce before MICDET identificationMark Brown
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>
2013-05-29ASoC: wm8994: Defer declaration of open circuit microphonesMark Brown
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>
2013-04-09ASoC: wm8994: Remove duplicate revision cacheMark Brown
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>
2013-03-21ASoC: wm8994: Restore AIFnCLK after reducing it for low clock ratesMark Brown
This helps to ensure a smooth startup when we restore. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-12-10Merge remote-tracking branch 'asoc/topic/wm8994' into asoc-nextMark Brown
2012-12-03ASoC: wm8994: Allow microphone identification callback to be overriddenMark Brown
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: Support custom accessory identification for WM1811AMark Brown
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 Brown
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-11-24ASoC: wm8994: Use pdata cached in MFD driverMark Brown
This is better style and facilitates implementation of device tree support for the driver. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-10-24ASoC: wm8994: Only enable extra BCLK cycles when requiredMark Brown
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-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-05-09ASoC: wm8994: Add debounce to wm8994 mic detectionMark Brown
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-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-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-02-06ASoC: wm8994: Bring WM8994 accessory detection up to dateMark Brown
Make the mechanism used for WM8994 more like that for WM1811 and WM8958: provide the logic to distinguish between headphone and headset and hard code the reporting of sensible SND_JACK values. Should integration with other detection mechanisms be required we can add appropriate callbacks (though some integrations should be able to use the subsystem ones). Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-13ASoC: Remove WM8994 register cacheMark Brown
Now that the mfd is using the register map cache there's no need for the CODEC driver to do any register cache management or any funny dances to interact with the other drivers using the device so just remove the cache initialisation and volatility information. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01ASoC: Implement support for WM1811A jack detectionMark Brown
The WM1811A features an advanced low power accessory detection subsystem which allows the device to be maintained in a very low power state while the system is idle without sacrificing any accessory detection features. Implement software support for this, automatically managing the power configuration of the device depending on the detected accessory. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01ASoC: Rename WM8994 detecting flag to mic_detectingMark Brown
More specific and avoids confusion with a following change. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01ASoC: Allow more WM8958/WM1811 button levels with default handlerMark Brown
The WM8958 and WM1811 support detecting a range of buttons. Allow the user to provide platform data enabling more of these levels without having to write a custom detection handler. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-01ASoC: Don't use control_data to get struct wm8994Mark Brown
This will support refactoring to make use of the regmap API more directly in the core. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-29ASoC: Enhance default WM8958 microphone detectionMark Brown
Actively manage the detection rate for microphones with WM8958, providing improved power consumption and maximising the benefit from the hardware debounce. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-14ASoC: Disable WM8994 VMID for digital only pathsMark Brown
On WM8994 class devices only the analogue portions of the CODEC require VMID so when running digital only paths we can leave VMID disabled. On some earlier devices the FLL uses VMID so we don't use DAPM reference counting alone, we maintain an internal reference count which is also enabled and disabled by the FLL startup. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-07-14ASoC: Use WM8994 FLL lock interruptMark Brown
If we have interrupts then wait for the FLL lock interrupt rather than using dead reckoning when waiting for the FLL to start. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-03-22ASoC: Add WM8958 enhanced EQ supportMark Brown
DSP2 in the WM8958 can be used to support an upgraded EQ for use in demanding applications. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-03-22ASoC: Add WM8958 VSS supportMark Brown
With appropriate firmware the WM8958 can support Virtual Surround Sound or VSS, widening the stereo audio image for improved user experience. Enable support for this mode of operation when the appropriate firmware can be loaded at runtime. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-03-22ASoC: Refactor WM8958 DSP to support additional algorithmsMark Brown
In preparation for the addition of additional WM8958 algorithms reorganise the code to make it easier to add such support later. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-03-22ASoC: Support download of WM8958 MBC firmwareMark Brown
Allow userspace to supply an update to the ROM firmware. The firmware request is non-blocking so userspace can load the firmware at its leisure without delaying startup, the driver will begin using the firmware the next time MBC is started after it has been supplied. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-03-18ASoC: Factor WM8958 DSP2 handling into separate fileMark Brown
DSP2 on the WM8958 has a default ROM which provides a multi-band compressor for enhanced performance on mobile devices but can also support runtime download of alternative firmware. In preparation for more exploiting this functionality refactor the code to split the handling of DSP2 into a separate file. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2011-03-08ASoC: Fix section mismatch warnings in WM8994Mark Brown
Annoying as the __devinitdata is actually correct. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2010-11-27ASoC: Convert WM8994 to use soc-cache.c cache functionsMark Brown
In the process we convert the driver to read registers one at a time when initialising the cache. This has the effect of working around limitations in the sizes of I2C transactions which can be done by some CPUs. Due to the sparseness of the register map the overhead from this should be minimual unless I2C transactions are very expensive to start. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27ASoC: Add WM8958 microphone detection supportMark Brown
The WM8958 contains an advanced accessory detection feature which allows detection of up to seven different impedence levels on the microphone bias output, including detection of video outputs. Since some of the more involved accessory interfaces may involve noticable interactions with external components a simple detection scheme is provided by default with the option to provide custom handling of accessory detect. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-19ASoC: Move WM8994 read/write access data into separate fileMark Brown
Makes the WM8994 driver file itself substantially smaller. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-12ASoC: multi-component - ASoC Multi-Component SupportLiam Girdwood
This patch extends the ASoC API to allow sound cards to have more than one CODEC and more than one platform DMA controller. This is achieved by dividing some current ASoC structures that contain both driver data and device data into structures that only either contain device data or driver data. i.e. struct snd_soc_codec ---> struct snd_soc_codec (device data) +-> struct snd_soc_codec_driver (driver data) struct snd_soc_platform ---> struct snd_soc_platform (device data) +-> struct snd_soc_platform_driver (driver data) struct snd_soc_dai ---> struct snd_soc_dai (device data) +-> struct snd_soc_dai_driver (driver data) struct snd_soc_device ---> deleted This now allows ASoC to be more tightly aligned with the Linux driver model and also means that every ASoC codec, platform and (platform) DAI is a kernel device. ASoC component private data is now stored as device private data. The ASoC sound card struct snd_soc_card has also been updated to store lists of it's components rather than a pointer to a codec and platform. The PCM runtime struct soc_pcm_runtime now has pointers to all its components. This patch adds DAPM support for ASoC multi-component and removes struct snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec or runtime PCM level basis rather than using snd_soc_socdev. Other notable multi-component changes:- * Stream operations now de-reference less structures. * close_delayed work() now runs on a DAI basis rather than looping all DAIs in a card. * PM suspend()/resume() operations can now handle N CODECs and Platforms per sound card. * Added soc_bind_dai_link() to bind the component devices to the sound card. * Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove DAI link components. * sysfs entries can now be registered per component per card. * snd_soc_new_pcms() functionailty rolled into dai_link_probe(). * snd_soc_register_codec() now does all the codec list and mutex init. This patch changes the probe() and remove() of the CODEC drivers as follows:- o Make CODEC driver a platform driver o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core. o Removed all static codec pointers (drivers now support > 1 codec dev) o snd_soc_register_pcms() now done by core. o snd_soc_register_dai() folded into snd_soc_register_codec(). CS4270 portions: Acked-by: Timur Tabi <timur@freescale.com> Some TLV320aic23 and Cirrus platform fixes. Signed-off-by: Ryan Mallon <ryan@bluewatersys.com> TI CODEC and OMAP fixes Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com> Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Samsung platform and misc fixes :- Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Jassi Brar <jassi.brar@samsung.com> Signed-off-by: Seungwhan Youn <sw.youn@samsung.com> MPC8610 and PPC fixes. Signed-off-by: Timur Tabi <timur@freescale.com> i.MX fixes and some core fixes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> J4740 platform fixes:- Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> CC: Tony Lindgren <tony@atomide.com> CC: Nicolas Ferre <nicolas.ferre@atmel.com> CC: Kevin Hilman <khilman@deeprootsystems.com> CC: Sascha Hauer <s.hauer@pengutronix.de> CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp> CC: Kuninori Morimoto <morimoto.kuninori@renesas.com> CC: Daniel Gloeckner <dg@emlix.com> CC: Manuel Lauss <mano@roarinelk.homelinux.net> CC: Mike Frysinger <vapier.adi@gmail.com> CC: Arnaud Patard <apatard@mandriva.com> CC: Wan ZongShun <mcuos.com@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-09ASoC: Implement WM8994 OPCLK supportMark Brown
The WM8994 can output a clock derived from its internal SYSCLK, called OPCLK. The rate can be selected as a sysclk, with a division from the SYSCLK rate specified (multiplied by 10 since a division of 5.5 is supported) and the clock can be disabled by specifying a divisor of zero. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-21ASoC: Support FLL input clock selection on WM8994Mark Brown
The WM8994 FLL can be clocked from one of four inputs, the two MCLKs and the LRCLK and BCLK of the AIF associated with the FLL. Allow all four inputs to be used rather than defaulting to MCLK1. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-05ASoC: Implement interrupt based WM8994 microphone detectionMark Brown
Support interrupt based microphone bias detection. The WM8994 has two microphone bias supplies, with detection supported on both. Detection using GPIOs together with the standard GPIO based jack framework is already supported via the platform data for the WM8994 core driver. Note that as well as the microphone bias itself the system clock and whichever AIF clock is supplying the system clock will need to be enabled for detection to function. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-02-01ASoC: Add WM8994 CODEC driverMark Brown
The WM8994 is a highly integrated ultra-low power hi-fi audio subsystem designed for smartphones and other portable devices rich in multimedia features. It provides advanced digital mixing facilities enabling low power high quality interconnection of CPU, baseband and other audio sources through flexible digital and analogue routing, and integrates a class W headphone driver and stereo class D speaker drivers. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>