Commit graph

67 commits

Author SHA1 Message Date
Bill Pemberton 7a79e94e97 ASoC: codecs: remove __dev* attributes
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-10 00:31:51 +09:00
Mark Brown 822b4b8d63 ASoC: dapm: Add flags to regulator supplies
This will be used to enable additional control of the regulators.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2012-09-08 08:47:28 +08:00
Mark Brown ec8ffe1868 ASoC: wm8996: Move register default configuration to I2C probe
This gets the registers set up as early as possible, mainly useful for the
GPIOs to ensure that they're in the correct mode.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25 09:55:02 +01:00
Mark Brown d4b3d0fbb7 ASoC: wm8996: Inline wm8996_reset() and optimise cache-only usage
There is only one caller and this allows us to cleanly leave the CODEC
with the internal LDO powered down which is the default state we're
looking for and means that we can robustly disable the register cache
only when we either disable the LDO or power down the external
regulators.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25 09:55:01 +01:00
Mark Brown 625c4888ff ASoC: wm8996: Move regulator notifier callbacks into I2C level
Now that we're using regmap the cache is available here.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-25 09:55:00 +01:00
Mark Brown d1e16c1a61 Linux 3.5-rc4
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJP53AxAAoJEHm+PkMAQRiGs2QH/RaqkXz96fwjhDcyiKpDqA3c
 kGuS5mz5cOhnqKSmR88HFm6pwuhLux/qSJzeAmoQy1MC8a0ACx7AnANW0lfN3/qe
 /HGYz8h60yCL/fhn8/bUYtdt9xsoDqoDcq/ooFl9mcsJGWbC6WeMSZU5dAUYqviE
 qFrp5zjY07FG53CRGT0hFpezQNwNL+VLH30CF9LD+fJLPVEYum2zBNGXWM42rcw5
 fxzGL/6SO8YqA/Upic1ht6HAd6s5LOrlST7qvnyXUMvRXN5z/Y92ueYJZefkS1Om
 ohuLIKM2bv9/dJS67H8N2baSKGCzBdfSe5/5WaHdLYW9MiVju0wRl6HPJtAMrkk=
 =H8t8
 -----END PGP SIGNATURE-----

Merge tag 'v3.5-rc4' into for-3.6

Linux 3.5-rc4 contains some bug fixes which overlap with new features.
2012-06-25 09:52:59 +01:00
Mark Brown af691fb62c ASoC: wm8996: Convert to devm_regmap_init_i2c()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11 20:22:26 +08:00
Mark Brown 66c2b7377a ASoC: wm8996: Remove write sequencer registers from the defaults table
They aren't marked as readable and the feature is never used so they'll
never get referenced.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11 20:22:12 +08:00
Mark Brown 9c699e0a95 ASoC: wm8996: Mark the CODEC as cache only when powering off on boot
Otherwise we might try to write to a powered off device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11 20:20:51 +08:00
Mark Brown db13340983 ASoC: wm8996: Move reset before the initial regulator disable
If we don't have control over the LDO but do have control over the other
regulators then we may end up trying to write to a powered off device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11 20:20:38 +08:00
Mark Brown 90ba6859ce ASoC: wm8996: Remove spurious regulator_bulk_free()
We're using demv_regulator_bulk_get() so don't need to manually free and
this is in the CODEC driver not the I2C driver anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-11 20:20:22 +08:00
Mark Brown 656baaebf9 ASoC: codecs: Refresh copyrights for Wolfson drivers
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-06-03 13:06:37 +01:00
Mark Brown 501bf0354d ASoC: wm8996: Put the microphone biases into bypass mode when idle
When we're not actively doing audio we don't need the microphone biases
to be regulated, noise is not important when we are not looking at the
audio signal. Save some power by putting the MICBIAS regulators into
bypass mode when not doing audio.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-04-26 18:06:56 +01:00
Mark Brown 4eb98f45b7 ASoC: wm8996: Add 44.1kHz support
The WM8996 specification has been updated to specify 44.1kHz as a supported
sample rate. Update the driver to accept this configuration.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-14 20:37:29 +00:00
Mark Brown 5b59648393 ASoC: wm8996: Remove separate output stage enable step
Marginally improve performance during startup.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-08 18:24:27 +00:00
Mark Brown da7f910bd0 ASoC: wm8996: Remove some volatile regisers from the defaults table
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-03-08 18:24:22 +00:00
Mark Brown 6449c9f858 ASoC: wm8996: Remove stub register cache
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-29 23:35:21 +00:00
Mark Brown 1dd4c8e42a ASoC: wm8996: Fix /RESET bounce ordering
We want to leave the device out of rather than in reset.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-29 23:35:17 +00:00
Mark Brown 1ec1cdfbb3 ASoC: wm8996: Convert to use DAPM routes for stream connections
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21 19:37:46 +00:00
Mark Brown 29e3cc1597 ASoC: wm8996: Implement DRC coefficient configuration
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-21 19:34:49 +00:00
Mark Brown d5a7f23f9c ASoC: wm8996: Make sure we bounce /RESET to reset
While it matches the current code only bringing the device out of reset
isn't actually doing what the function says so make sure we set the GPIO
high before we pull it low.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-17 13:50:51 -08:00
Mark Brown 8005f394ab ASoC: wm8996: Convert to module_i2c_driver()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-17 08:15:40 -08:00
Axel Lin 905b41956c ASoC: Show device id in the debug message
Show the id we read when the id mismatch is detected.
This is useful for debugging.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-15 22:19:55 -08:00
Mark Brown a08a499aa3 Linux 3.3-rc3
.. 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
2012-02-09 12:00:22 +00:00
Liam Girdwood 022658beab ASoC: core: Add support for DAI and machine kcontrols.
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-04 12:40:11 +00:00
Mark Brown 24e0c57b8e ASoC: wm8996: Use devm_regulator_bulk_get()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-01 10:17:34 +00:00
Mark Brown 4a086e4cc4 ASoC: wm8996: Switch to using common code for managing CPVDD supply
Nice code saving.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-02-01 10:17:24 +00:00
Mark Brown 177f72fd10 Linux 3.3-rc2
.. several days delayed. No reason, I just didn't think of it.
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.18 (GNU/Linux)
 
 iQEcBAABAgAGBQJPKF4KAAoJEHm+PkMAQRiGw/YH+wXg2DpZUuHeBK52zMGlJBPc
 DzX11/Uan3Y07gM0JbDzuVxwjX4vdxR2bV6r1qsLP8JEUnE8jyFC32DBGi5WAht7
 F4KU/Uov2Ds5/wzvY4Iuo01C+JftQHXuy/Sbhck1d0LI0yjLejRaw+zuJv0x2/eS
 7YqV+KTGE1lDuJs/Gyq1Vqr1g9831AuS1tv/g3gaqBuN6TcPBFCocaVxzwrUc+y6
 94h26XbbOhQRIz38oqUkiqAGnvYS61ocyBcEiRHf0dXkNSDIINqlgukvd7YTXouA
 jj/w/DWpMRcQuYAgqkrurr9+yWC9hVQcsvvQ5sAQnIPcxoR868sg1pO8Oheq+1g=
 =kUzV
 -----END PGP SIGNATURE-----

Merge tag 'v3.3-rc2' into for-3.4

A reasonable amount of new development is causing fiddly merge conflicts
between different resource management changes (mostly fixing bugs in
resource management due to noticing things while doing enhancements in
the same area).

Linux 3.3-rc2

.. several days delayed. No reason, I just didn't think of it.
2012-02-01 10:08:15 +00:00
Axel Lin eb3032f8b9 ASoC: Set idle_bias_off flag in snd_soc_codec_driver
Since commit 33c5f969 "ASoC: Allow idle_bias_off to be specified in CODEC
drivers", now we can set idle_bias_off flag in struct snd_soc_codec_driver
for devices can unconditionally support idle_bias_off.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-27 11:22:05 +00:00
Mark Brown d7b3557077 ASoC: wm8996: Handle failures to determine accessory polarity
If we get an indeterminate impedance with both headset polarities then
give up and report the accessory as a headphone rather than continually
retrying.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-26 18:40:55 +00:00
Mark Brown 1b76d2ee40 ASoC: wm8996: Mark register cache as dirty when regulators are disabled
Otherwise we won't resync later.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-25 21:17:28 +00:00
Mark Brown a14304edcd ASoC: wm8996: Call _POST_PMU callback for CPVDD
We should be allowing a 5ms delay after the charge pump is started in
order to ensure it has finished ramping.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2012-01-22 16:14:06 +00:00
Mark Brown a4b5233792 ASoC: 24 bits are significant on the WM8996 audio interfaces
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-01-20 13:58:30 +00:00
Mark Brown fed2200711 ASoC: Disable register synchronisation for low frequency WM8996 SYSCLK
With a low frequency SYSCLK and a fast I2C clock register synchronisation
may occasionally take too long to take effect, causing I/O issues. Disable
synchronisation in order to avoid any issues.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2012-01-20 13:54:34 +00:00
Mark Brown 1b39bf3468 ASoC: Enable ASoC register map dump for some regmap CODECs
It's still useful to be able to poke around in the register map at
runtime.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-30 01:59:39 +00:00
Mark Brown 45ba82d817 ASoC: Tune the accessory detection rates for WM8996
Use longer intervals when the microphone is not inserted to increase
robustness against leisurely insertion.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-12-14 19:35:14 +08:00
Mark Brown f04b8d6ece Merge branch 'for-3.2' into for-3.3 2011-12-11 03:01:33 +08:00
Mark Brown 37d5993c5c ASoC: Fix WM8996 24.576MHz clock operation
Record the clock after the divider as that is what all SYSCLK users see.
Without this the other clock configuration in the device comes out at
half rate.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-12-11 03:01:09 +08:00
Mark Brown a290986b2a ASoC: Convert wm8996 to use devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-27 16:04:08 +00:00
Lars-Peter Clausen 85e7652d89 ASoC: Constify snd_soc_dai_ops structs
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>
2011-11-23 10:40:46 +00:00
Mark Brown b2d1e23373 ASoC: Convert WM8996 gpiolib to regmap
Actually pretty straightforward.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-08 14:13:25 +00:00
Mark Brown ee5f387226 ASoC: Move most WM8996 resource acquisition to I2C probe
Now that the WM8996 driver is using the regmap API for register I/O we no
longer need the ASoC card to be active in order to interact with the chip.
In order to be more idiomatic for Linux move most of the existing probe()
function out into the I2C probe() function prior to registration with ASoC.

The IRQ and GPIO init will be moved separately as these are slightly more
involved.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-08 14:13:12 +00:00
Mark Brown 7917274682 ASoC: Convert WM8996 to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-11-08 14:08:34 +00:00
Axel Lin 753ddf5215 ASoC: wm8996: Avoid a redundant i2c_get_clientdata call in wm8996_i2c_remove
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-24 14:09:33 +02:00
Axel Lin 3205e6629b ASoC: wm8996: Fix wrong mask for setting WM8996_AIF_CLOCKING_2
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-22 10:34:59 +01:00
Axel Lin ff39dbe935 ASoC: wm8996: Use SND_SOC_DAPM_AIF_OUT for AIF2 Capture
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2011-10-20 15:03:23 +01:00
Axel Lin 43419b80fa ASoC: Remove needless codec->dapm.bias_level assignment to SND_SOC_BIAS_OFF
This assignment is done by the snd_soc_register_codec so there is no need
to redo it in probe function of a codec driver.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-10-03 14:15:22 +01:00
Karl Tsou bcec267a17 ASoC: Add DRC control for WM8996
Signed-off-by: Karl Tsou <karl@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2011-09-27 19:02:45 +01:00
Mark Brown ded71dcb77 ASoC: Refcount WM8996 bandgap from FLL too
For digital only paths we need to make sure the bandgap is enabled prior
to starting the FLL which isn't tied into DAPM.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-20 12:56:53 +01:00
Mark Brown c9d023adb6 ASoC: Fix unused variable warning in WM8996
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
2011-09-20 12:56:36 +01:00