Commit graph

27 commits

Author SHA1 Message Date
Mark Brown 20a4e7fc7e ASoC: Handle low measured DC offsets for wm_hubs devices
The DC servo codes are actually signed numbers so need to be treated as
such.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2011-01-21 18:20:16 +00:00
Mark Brown 0afc8c733e Merge branch 'for-2.6.37' into for-2.6.38
Conflicts:
	include/linux/mfd/wm8994/pdata.h
2010-12-06 14:14:47 +00:00
Uk Kim ed8cc471d7 ASoC: Fix swap of left and right channels for WM8993/4 speaker boost gain
SPKOUTL_BOOST start from third bit, SPKOUTLR_BOOST start from 0 bit.

Signed-off-by: Uk Kim <w0806.kim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2010-12-06 12:43:13 +00:00
Mark Brown 11cef5f07b ASoC: Use DC servo startup mode when not doing DCS correction
Devices which do not have a DCS correction applied can use the explicit
DC servo startup mode for optimal startup performance. This most
immediately affects the WM8958.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:13 +00:00
Jarkko Nikula 505fb824e7 ASoC: Do not include soc-dapm.h
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-22 14:04:41 +00:00
Joe Perches ef995e3a91 ASoC: Remove unnecessary semicolons
Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-15 17:20:34 +00:00
Liam Girdwood ce6120cca2 ASoC: Decouple DAPM from CODECs
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-06 11:28:29 -04:00
Mark Brown 9e3be1edbe Merge branch 'for-2.6.37' into HEAD
WARN() fix from Joe moved.

Conflicts:
	sound/soc/codecs/wm_hubs.c
2010-11-02 09:58:49 -04:00
Joe Perches 5a0b07433d ASoC: Update WARN uses in wm_hubs
Add missing newlines.

Signed-off-by: Joe Perches <joe@perches.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-01 15:44:57 -04:00
Mark Brown fec6dd833e ASoC: Store DC offset correction for wm_hubs devices in class W mode
Providing the analogue configuration of the output path remains the same
the DC offset corrected by the DC servo will remain identical so we can
skip the callibration, reducing the startup time for the headphone output.
Implement this for the wm_hubs devices as has been done for several other
CODECs.

Don't do this if we have any analogue paths enabled since offsets may be
being introduced by the analogue paths which could vary outside the
control of the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-28 11:34:03 -07:00
Mark Brown 395e4b7362 ASoC: Explicitly disable DC servo on WM hubs headphone powerdown
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-20 09:48:07 +01:00
Mark Brown 6adb26bd03 ASoC: Reorder power down sequence for WM hubs devices
Disable the output stage prior to the delay stage rather than the
other way around. Fixes merge issue with previous headphone output
path corrections.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-11 14:18:41 +01:00
Mark Brown 3254d28500 ASoC: Add additional WM hubs DC servo trace
Log the values we're getting back from the DC servo and the values we
write to it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-11 14:18:34 +01:00
Mark Brown b2c812e22d ASoC: Add indirection for CODEC private data
One of the features of the multi CODEC work is that it embeds a struct
device in the CODEC to provide diagnostics via a sysfs class rather than
via the device tree, at which point it's much better to use the struct
device private data rather than having two places to store it. Provide
an accessor function to allow this change to be made more easily, and
update all the CODEC drivers are updated.

To ensure use of the accessor the private data structure member is
renamed, meaning that if code developed with older an older core that
still uses private_data is merged it will fail to build.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-17 10:46:22 +09:00
Mark Brown 4dcc93d0ed ASoC: Don't use DCS_DATAPATH_BUSY for WM hubs devices
The DCS_DATAPATH_BUSY bit used to monitor the completion of DC servo
operations has been deprecated and with some more recente revisions
may perform incorrectly, especially when only analogue bypass paths
are in use. Switch to using readback from the DC servo command
register instead, which is supported for all devices. Without this
unacceptably long timeouts may be observed in some circumstances.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-05 16:20:02 +01:00
Mark Brown ae9d8607fe ASoC: Don't do runtime wm_hubs DC servo updates if using offset correction
If we need to offset correct the DC servo then don't use runtime
recalibration since that is likely to introduce further offsets
which will be evident on powerdown.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-05 16:19:29 +01:00
Mark Brown 8437f7006b ASoC: Support second DC servo readback method for wm_hubs
More recent Wolfson hubs devices add the ability to read back the DC
servo calibration information from the register used to write offsets,
and later still ones remove the old readback registers. Add support
for the new scheme, and use it for WM8994 device revisions that
support it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-05 16:19:09 +01:00
Mark Brown 3fa49e3ad9 ASoC: Avoid wraparound in wm_hubs DC servo correction
If the correction wraps around then a substantial offset would be
introduced.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-05 16:17:39 +01:00
Mark Brown 6937c947d3 ASoC: Bail out of wm_hubs DC servo if calibration fails
We're keeping track of the number of times we've iterated but never
actually using this to bail out if the chip looks stuck.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-03-19 11:17:36 +00:00
Mark Brown 3ed7074c4c ASoC: Improved wm_hubs headphone handling
Perform DC servo offset calibration using a series update sequence
rather than startup update sequence, tuning the configuration of the
WM8993 DC servo to make best use of this.

Also introduce currently unused data allowing us to correct for
any systematic errors in the DC servo calibration results and an
alternative startup path for the headphone output which performs
better with some chip revisions.  The alternative setup sequence is
enabled for WM8993.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-02-01 18:35:46 +00:00
Mark Brown 821dd91ec7 ASoC: Use BIAS_OFF when idle for wm_hubs devices
This provides a small power saving when audio is inactive.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-01-21 12:05:39 +00:00
Joonyoung Shim 3482594802 ASoC: Rename controls with a / in wm_hubs
This renames from a character / to : of controls. A / occurs below error
messages.

ASoC: Failed to create IN2RP/VXRP debugfs file
ASoC: Failed to create IN2LP/VXRN debugfs file

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-12-04 10:39:03 +00:00
Mark Brown aa983d9d63 ASoC: Factor out analogue platform data from WM8993
This is also shared with newer CODECs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-30 15:51:37 +01:00
Mark Brown 2eff31e809 ASoC: Fully specify DC servo bits to update in wm_hubs
Avoids potential issues if we read back unexpected values during
a read/modify/write cycle.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-09-02 19:36:22 +01:00
Takashi Iwai c6ea2af76a ASoC: Remove unneeded inclusion of linux/regulator/consumer.h
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-24 09:41:32 +02:00
Mark Brown d1a5e44b89 ASoC: Remove duplicate ADC/DAC widgets from wm_hubs.c
These need to be in the CODEC since the DAIs supported by the CODECs
aren't static.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-18 16:04:24 +01:00
Mark Brown a2342ae325 ASoC: Factor out shared code from WM8993
The WM8993 analogue control is shared with other devices in the same
product line.  Since this is a very substantial proportion of the
driver move the definitions of these controls into a new wm_hubs module
which allows them to be shared between the two.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-08-13 22:19:31 +01:00