summaryrefslogtreecommitdiff
path: root/sound/soc/codecs/wm_hubs.c
AgeCommit message (Collapse)Author
2017-02-27scripts/spelling.txt: add "unneded" pattern and fix typo instancesMasahiro Yamada
Fix typos and add the following to the scripts/spelling.txt: unneded||unneeded Link: http://lkml.kernel.org/r/1481573103-11329-15-git-send-email-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2015-08-05ASoC: wm_hubs: Replace TLV_DB_RANGE_HEAD with DECLARE_TLV_DB_RANGELars-Peter Clausen
DECLARE_TLV_DB_RANGE() has the advantage over using TLV_DB_RANGE_HEAD() that it automatically calculates the number of items in the TLV and is hence less prone to manual error. Generate using the following coccinelle script // <smpl> @@ declarer name DECLARE_TLV_DB_RANGE; identifier tlv; constant x; @@ -unsigned int tlv[] = { - TLV_DB_RANGE_HEAD(x), +DECLARE_TLV_DB_RANGE(tlv, ... -}; +); // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@kernel.org>
2015-06-01ASoC: wm_hubs: Replace direct snd_soc_codec dapm field accessLars-Peter Clausen
The dapm field of the snd_soc_codec struct is eventually going to be removed, in preparation for this replace all manual access to codec->dapm with snd_soc_codec_get_dapm(). 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>
2015-01-14ASoC: wm_hubs: Replace w->codec snd_soc_dapm_to_codec(w->dapm)Lars-Peter Clausen
The codec field of the snd_soc_widget struct is eventually going to be removed, use snd_soc_dapm_to_codec(w->dapm) instead. 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>
2014-06-27ASoC: wm_hubs: Remove redundant OOM messageSachin Kamat
Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-04-14ASoC: Add snd_soc_kcontrol_codec() helper functionLars-Peter Clausen
For CODEC controls snd_kcontrol_chip() currently returns a pointer to the CODEC that registered the control. With the upcoming consolidation of platform and CODEC controls this will change. Prepare for this by introducing the snd_soc_kcontrol_codec() helper function that will hide the implementation details of how the CODEC for a control can be obtained. This will allow us to change this easily in the future. The patch also updates all CODEC drivers to use the new helper function. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23ASoC: wm_hubs: Use SOC_ENUM_SINGLE_DECL()Takashi Iwai
Just replace with the helper macro. No functional change at all. Signed-off-by: Takashi Iwai <tiwai@suse.de> Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com> Acked-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-11-07ASoC: wm_hubs: Replace BUG() with WARN()Takashi Iwai
BUG() used in the driver is just to spit the stack trace on buggy points, not really needed to stop the whole operation. For that purpose, it'd be more convenient to use WARN() instead with more error information. Cc: patches@opensource.wolfsonmicro.com Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-10-30ASoC: wm_hubs: Add missing break in hp_supply_event()Takashi Iwai
Spotted by coverity CID 115170. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
2013-07-29ASoC: dapm: Add a helper to get the CODEC for DAPM kcontrolLars-Peter Clausen
We use the same 3 lines to get the CODEC for a kcontrol in a quite a few places. This patch puts them into a common helper function. Having this encapsulated in a helper function will also make it more easier to eventually change the data layout of the kcontrol's private data. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-06-19ASoC: wm_hubs: Use SOC_SINGLE_EXT() instead of open-coding itLars-Peter Clausen
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@linaro.org>
2013-03-12ASoC: wm_hubs: Silence reg_r and reg_l 'may be used uninitialized' warningsTim Gardner
Return an error from wm_hubs_read_dc_servo() if hubs->dcs_readback_mode is not correctly initialized. You might as well bail out since nothing is likely to work correctly afterwards. sound/soc/codecs/wm_hubs.c:321:11: warning: 'reg_r' may be used uninitialized in this function [-Wuninitialized] sound/soc/codecs/wm_hubs.c:251:13: note: 'reg_r' was declared here sound/soc/codecs/wm_hubs.c:322:11: warning: 'reg_l' may be used uninitialized in this function [-Wuninitialized] sound/soc/codecs/wm_hubs.c:251:6: note: 'reg_l' was declared here gcc version 4.6.3 Signed-off-by: Tim Gardner <tim.gardner@canonical.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-28ASoC: wm_hubs: Ensure volume updates are handled during class W startupMark Brown
In some circumstances we may need to flush volume updates to the device after switching to class W mode. Do this unconditionally to ensure that these situations are handled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
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-22ASoC: wm_hubs: Add trace showing semantics of the DCS updateMark Brown
Aids diagnostics. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-22ASoC: wm_hubs: Use explicit casts for converting to signedMark Brown
Should be no behaviour change. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-03ASoC: wm_hubs: Rename calibrate_dc_servo()Mark Brown
Really we're enabling it here and the name will become very confusing shortly. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-08-03ASoC: wm_hubs: Factor out DC servo readback codeMark Brown
It's currently only used in one place but another user will be added shortly and there's an argument it's clearer anyway. Also add support for readback in mode 1, though it's not currently used. 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-06-03ASoC: codecs: Refresh copyrights for Wolfson driversMark Brown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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-01ASoC: wm_hubs: Cache multiple DCS offsetsMark Brown
Rather than invalidating the cached DCS value every time the headphone gain changes store multiple values, indexed by gain. This allows the optimisation we get from the cache to take effect more often. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-27ASoC: wm_hubs: Enable class W for output mixer pathsMark Brown
Class W can be used for any path where only data from the DAC is routed to the headphones. Currently we only enable it when the direct DAC to headphone path is used but it can also be enabled for paths that go via the output mixer providing the DAC is the only input to the output mixer. Implement support for this, including updates to the class W status when the output mixer configuration is changed. This also allows us to enable the DC servo optimisations for DAC to headphone paths where the output mixer is used. In general the direct DAC path is still preferred as this will offer better performance on most wm_hubs devices but these additional paths can simplify use case management. 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-23ASoC: wm_hubs: Make sure we don't disable differential line outputsMark Brown
While we need to clean up unused single ended line outputs we don't want to do this if the outputs are in differential mode. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-19ASoC: wm_hubs: Don't actively manage LINEOUT_VMID_BUFMark Brown
It can just be enabled all the time with no impact. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-04ASoC: wm_hubs: Disable cache of the DC servo calibration for WM1811Mark Brown
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-02-29ASoC: wm_hubs: Bomb out if we can't read back the DC servo resultMark Brown
Should have no practical impact but it's safer than trying to soldier on. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21ASoC: wm_hubs: Convert headphone driver to output driver widgetMark Brown
Mostly for neatness, though it may help with sequencing in some situations. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-11ASoC: wm_hubs: Clamp inputs to VMID while we rampMark Brown
Reduces the amount of time taken to stabilise them. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-11ASoC: wm_hubs: Improve single ended line output enable performanceMark Brown
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>
2012-02-09Merge tag 'v3.3-rc3' as we've got several bugfixes in there which areMark Brown
colliding annoyingly with development. Linux 3.3-rc3 .. the number of the half-beast? Conflicts: sound/soc/codecs/wm5100.c sound/soc/codecs/wm8994.c
2012-02-07ASoC: wm_hubs: Convert most output drivers to OUT_DRV widgetsMark Brown
No practical impact but now we have the control type we may as well use it for the slightly nicer sequencing. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-04ASoC: core: Add support for DAI and machine kcontrols.Liam Girdwood
Currently ASoC can only add kcontrols using codec and platform component device handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for SoC card machine drivers too. This allows the kcontrol to have a direct handle to the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily get it's private data. This change makes snd_soc_add_controls() static and wraps it in the folowing calls (card and dai are new) :- snd_soc_add_card_controls() snd_soc_add_codec_controls() snd_soc_add_dai_controls() snd_soc_add_platform_controls() This patch also does a lot of small mechanical changes in individual codec drivers to replace snd_soc_add_controls() with snd_soc_add_codec_controls(). It also updates the McBSP DAI driver to use snd_soc_add_dai_controls(). Finally, it updates the existing machine drivers that register controls to either :- 1) Use snd_soc_add_card_controls() where no direct codec control is required. 2) Use snd_soc_add_codec_controls() where there is direct codec control. In the case of 1) above we also update the machine drivers to get the correct component data pointers from the kcontrol (rather than getting the machine pointer via the codec pointer). Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-01ASoC: wm_hubs: Correct line input to line output 2 pathsMark Brown
The second line output mixer has the controls for the line input bypasses in the opposite order. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-01-31ASoC: wm_hubs: Push check for idle_bias_off out into driversMark Brown
For later wm_hubs devices we have much less need to keep the biases up even when using single ended line outputs so flag idle_bias_off for everything except the WM8993 and WM8994. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-31ASoC: wm_hubs: Fix routing of input PGAs to line output mixerMark Brown
IN1L/R is routed to both line output mixers, we don't route IN1 to LINEOUT1 and IN2 to LINEOUT2. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-01-27ASoC: wm_hubs: fix wrong bits for LINEOUT2 N/P mixerUK KIM
Signed-off-by: UK KIM <w0806.kim@samsung.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2012-01-26ASoC: wm_hubs: Enable line out VMID buffer for single ended line outputsMark Brown
For optimal performance the single ended line outputs require that the line output VMID buffer be enabled. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2011-12-02ASoC: Convert WM8994 MICBIASes to supply widgetsMark Brown
There are some in tree systems using the driver but none use the MICBIAS widgets. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-27ASoC: Remove unneeded platform_device.h inclusions from CODECsMark Brown
They've not been needed for a long time if they were ever required. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-21Merge branch 'for-3.2' into for-3.3Mark Brown
2011-11-20ASoC: wm_hubs: fix DB_RANGE sizeClemens Ladisch
Give the correct number of entries to TLV_DB_RANGE_HEAD to prevent reading more data than actually is in the array. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2011-11-04ASoC: Disable thermal shutdown when not using speakers in wm_hubsMark Brown
The thermal shutdown support in wm_hubs devices is tied to the speaker drivers (which are the only high power subsystems within the device). Ensure minimal current usage when the thermal shutdown support is not required by disabling the circuit when the speaker drivers are powered down. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-06ASoC: Replace remaining use of *_volsw_2r with *_volswPeter Ujfalusi
The snd_soc_*_volsw_2r functionality has been merged to *volsw callbacks. Few places still used the get, or put variant of volsw_2r, replace those with the corresponding *_volsw. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-05ASoC: Consolidate use of controls with custom get/put functionPeter Ujfalusi
Use the macros for controls require custom get/put function. This is to make sure that the soc_mixer_control is used consistently among the drivers. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Cc: Arun KS <arunks@mistralsolutions.com> Cc: Misael Lopez Cruz <misael.lopez@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-08-14ASoC: Add VMID widget for wm_hubs devicesMark Brown
Currently this does not actually do anything, it is being introduced in order to facilitate additional power optimisations for current generation devices. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
2011-08-08Merge branch 'for-3.1' into for-3.2Mark Brown
Conflict due to the fix for the register map failure - taken the for-3.1 version. Conflicts: sound/soc/codecs/sgtl5000.c
2011-08-01ASoC: Support separate left and right channel dcs_codes valuesMark Brown
Some devices can have performance optimized by setting different offsets for left and right channels. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>