This minimises the chance of any external capacitors that are fitted
being discharged into headphones as they insert.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Raise the ramp time to 50ms to cover corner cases, use the startup bias
generator, explicitly reset the ramp circuit when complete and reorder
things all of which should improve performance somewhat for systems that
are sensitive to noise from VMID.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
.. the number of the half-beast?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.18 (GNU/Linux)
iQEcBAABAgAGBQJPMzv8AAoJEHm+PkMAQRiGgeYIAJxxGCxSMLRIiPaGRmQbWifs
eE3z6AUWitGfYvhmYdWVz+C/aa4pPCVWr3bAFxUQhu+ESmiFIiqiefvlTRf5f84e
pcoJFobkFfhtK4gLvUr75WxXDFq/1HhKqW1OLzIW4gQsnhMdjGJ3lLK6ZoRYH8h4
cGoN3DRII9mVLFcB2sgbeRvbQBA/O4n0aOQ2ryZkCcPQQMIKhR/rUEEV2pe/ovHE
rumQgI3PVey816P4e5YnOvrEAllFZlaZ/F0ClJgNdfeQCVTZx9KNRbiNxHi6fcC5
6Zgg7e5EvQTAy7QqQZ0hmS4k4CFmnswX3Nm+ZabRNqBdLSjPEDD9hk1o1dodYCg=
=BBLC
-----END PGP SIGNATURE-----
Merge tag 'v3.3-rc3' as we've got several bugfixes in there which are
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
The VMID ramp rate is supposed to be 0x3, not 11b. Fix that.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
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>
Otherwise we might get an error if the GPIO is configured as an input
since that makes the register volatile and a suspended device can't be
read from.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
This is the default state that the runtime PM infrastructure expects so
instead just kick the runtime PM core to suspend us if we're not doing
anything (as is default).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
In cases where we should enter STANDBY DAPM will power us up, otherwise
there is no need to power up and we can remain in OFF.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
We can enable VMID independently of the bias in some use cases so we need
to ensure that the core device is powered up.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
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>
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>
Now we've switched over to regmap the ASoC level cache sync will be
ineffectual and potentially harmful as there is no longer an ASoC level
cache.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Report any accessory with a low impedance as a headphone, previously
anything other than a short or microphone would not be reported at all.
The most likely reason is a microphone with incorrect polarity.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
Just go directly to the regmap API, saving code and making integration
that bit more direct.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Since they don't actually have power bits but do have events associated
with them it's important that we bootstrap their state properly which
making them virtual does.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The existence of this parameter is purely historical. None of the CODEC drivers
uses it and we always pass in the same value anyway, so it should be safe to
remove it.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Still have a manual free in there for some realloc()ed memory as there's
no devm version of that.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Allow systems to override the default microphone detection rates using
platform data in case the settings are not suitable (eg, due to an
unusually noisy jack).
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
We don't need to rerun DAPM if the clock source is the same but we do
need to adjust the microphone detection rate in case we are moving from
an audio to a non-audio rate.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
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>
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>
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>
When we don't have any active audio we can put the microphone biases into
bypass mode to save power at the expense of performance.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Ensure SYSCLK is enabled while running accessory detection on WM8958.
It is always required so there is no sense in requiring machine drivers
to individually do this.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Commit 1ee46ebd("ASoC: Make the DAI ops constant in the DAI structure")
introduced the possibility to have constant DAI ops structures, yet this is
barley used in both existing drivers and also new drivers being submitted,
although none of them modifies its DAI ops structure. The later is not
surprising since existing drivers are often used as templates for new drivers.
So this patch just constifies all existing snd_soc_dai_ops structs to eliminate
the issue altogether.
The patch was generated with the following coccinelle semantic patch:
// <smpl>
@@
identifier ops;
@@
-struct snd_soc_dai_ops ops =
+const struct snd_soc_dai_ops ops =
{ ... };
// </smpl>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Occasionally we may see an accessory reported before we have a stable
impedance for the accessory. If this happens then reread the status in
order to ensure that the handler can take the appropriate action for the
status change.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The field is no longer initialised so this will crash if running on
wm8958.
Reported-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The field is no longer initialised so this will crash if running on
wm8958.
Reported-by: Thomas Abraham <thomas.abraham@linaro.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org