Commit graph

1163 commits

Author SHA1 Message Date
Axel Lin 2811fe2beb ASoC: uda134x - set reg_cache_default to uda134x_reg
After checking the code in 2.6.36,
I found this is missing during multi-component conversion.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-19 11:19:38 +00:00
Mark Brown 96b101efae ASoC: Provide ADC left/right channel source selection on WM8994
Allow the application to choose if the ADC data presented on the left
and right channels is sourced from the internal left or right channel.
This allows a mono recording to be presented as stereo on the external
bus.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-19 11:17:27 +00:00
Jesse Marroquin fb762a5b37 ASoC: Add support for MAX98089 CODEC
This patch adds initial support for the MAX98089 CODEC.

Signed-off-by: Jesse Marroquin <jesse.marroquin@maxim-ic.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-18 10:56:04 +00:00
Mark Brown 3df94756fe Merge branch 'for-2.6.37' into for-2.6.38 2010-11-17 18:59:19 +00:00
Mark Brown 11e713a07e ASoC: Fix register cache setup WM8994 for multi-component
During the multi-component conversion the WM8994 register cache init
got lost.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-17 18:32:51 +00:00
Axel Lin ce0df3d79a ASoC: Fix incorrect kfree in wm8962_probe error path
We allocated memory for wm8962 in wm8962_i2c_probe,
and will free the memory in either wm8962_i2c_probe error path
or wm8962_i2c_remove.

Thus we should not call kfree(wm8962) in wm8962_probe, otherwise
we have double free of wm8962.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-16 11:24:16 +00:00
Axel Lin 01cbea3293 ASoC: Fix incorrect kfree in wm8731_probe error path
We allocated memory for wm8731 in wm8731_spi_probe / wm8731_i2c_probe,
and will free the memory in either wm8731_spi_probe / wm8731_i2c_probe
error path or wm8731_spi_remove / wm8731_i2c_remove.

Thus we should not call kfree(wm8731) in wm8731_probe, otherwise
we have double free of wm8731.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-16 11:24:04 +00:00
Axel Lin 4ab867d276 ASoC: Fix incorrect kfree in aic3x_probe error path
We allocated memory for aic3x in aic3x_i2c_probe,
and will free the memory in either aic3x_i2c_probe error path or
aic3x_i2c_remove.

Thus we should not call kfree(aic3x) in aic3x_probe, otherwise
we have double free of aic3x.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-16 11:23:50 +00:00
Axel Lin 50d0ac2e1e ASoC: Fix incorrect kfree in ad193x_probe error path
We allocated memory for ad193x in ad193x_spi_probe,
and will free the memory in either ad193x_spi_probe error path or
ad193x_spi_remove.

Thus we should not call kfree(ad193x) in ad193x_probe, otherwise
we have double free of ad193x.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-16 11:23:39 +00:00
Axel Lin af353d8a13 ASoC: Fix incorrect kfree in ad1836_probe error path
We allocated memory for ad1836 in ad1836_spi_probe,
and will free the memory in either ad1836_spi_probe error path or
ad1836_spi_remove.

Thus we should not call kfree(ad1836) in ad1836_probe, otherwise
we have double free of ad1836.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-16 11:23:24 +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
Mark Brown cb2b3cf1fe ASoC: Reset WM8962 with default ID value
The value makes no odds and it makes life easier with caches.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-12 15:33:44 +00:00
Mark Brown 00fb0d98ad Merge branch 'for-2.6.37' into for-2.6.38 2010-11-10 15:41:12 +00:00
Mark Brown 0049317edb ASoC: Ensure sane WM835x AIF configuration by default
Ensure that whatever ran before us leaves the WM835x with a sane default
audio interface configuration as we do not override the companding,
loopback or tristate settings and do not reset the chip at startup (as it
is a PMIC).

Reported-by: Keiji Mitsuhisa <Keiji.Mitsuhisa@wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-10 15:40:21 +00:00
Mark Brown c28a9926f2 ASoC: Remove broken WM8350 direction constants
The WM8350 driver was using some custom constants to interpret the direction
of the MCLK signal which had the opposite values to those used as standard
by the ASoC core, causing confusion in machine drivers such as the 1133-EV1
board.

Reported-by: Tommy Zhu <Tommy.Zhu@wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-10 15:40:06 +00:00
Jarkko Nikula 0656f6cf6c ASoC: tpa6130a2: Revisit power-up sequence
There are no known problems with current power-up sequence which first sets
the /shutdown pin high and then enables the supply. However, swap the order
so that the device is kept in shutdown/reset mode during the supply voltage
transition since slowly rising voltages can usually cause problems if the
device is not kept in reset.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-09 21:38:49 +00:00
Dimitris Papastamos 0aa34b16f9 ASoC: Remove unneeded use of address-of operator
There is no need to use '&' in this case.  Either way, if a is an array
of some type, then a == &a == &a[0].

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-08 16:51:45 +00:00
Mark Brown 989db2005c Merge branch 'for-2.6.37' into for-2.6.38 2010-11-06 11:35:44 -04:00
Dimitris Papastamos c046fd4dd6 ASoC: WM8770: Initial driver
The WM8770 is a high performance, multi-channel audio
codec.  The WM8770 is ideal for surround sound processing
applications for home hi-fi, automotive and other audio
visual equipment.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-06 11:35:39 -04:00
Jarkko Nikula 3a45b8672d ASoC: Move pop time from DAPM context to sound card
Based on discussion the dapm_pop_time in debugsfs should be per card rather
than per device. Single pop time value for entire card is cleaner when the
DAPM sequencing is extended to cross-device paths.

debugfs/asoc/{card->name}/{codec dir}/dapm_pop_time
->
debugfs/asoc/{card->name}/dapm_pop_time

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-06 11:28:35 -04: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
Dimitris Papastamos 197ebd4053 ASoC: WM8776: Removed unneeded struct member
The member reg_cache is not used at all and therefore it should be
removed.  This member was usually needed for older versions of ASoC
that did not handle caching automatically and had to be done in the
driver itself.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-06 11:11:55 -04:00
Mark Brown a8ea54da5e Merge branch 'for-2.6.37' into HEAD 2010-11-05 09:16:07 -04:00
Mark Brown 11e16eb365 ASoC: Use pm_wakeup_event() in WM8962 jack detection
Ensure that the system does not suspend while we process a WM8962 jack
event by using pm_wakeup_event() to block the suspend while we're waiting
for the jack to settle. Use a slightly longer timeout than the jack waits
to allow for other stuff to take over and delays in scheduling.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03 16:16:48 -04:00
Mark Brown 7b0f42b59a ASoC: Remove register write trace from WM8994
We now have trace in the ASoC core so we don't need to our own trace in
the driver.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03 14:28:53 -04:00
Mark Brown 74a557e27f ASoC: Check return value of strict_strtoul() in WM8962
strict_strtoul() has been made __must_check so do so.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03 12:33:15 -04:00
Jarkko Nikula 75e3f3137c ASoC: tpa6130a2: Get rid of compile warning from tpa6130a2_power
Patch "ASoC: tpa6130a2: Fix unbalanced regulator disables" introduced a
compiler warning "‘ret’ may be used uninitialized in this function".
Initialize ret to zero to get rid of it and making sure that the function
does not return any random error code when the code is falling through.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-03 15:50:46 +01:00
Jarkko Nikula 414c73abfd ASoC: tlv320aic3x: Add support to shared common reset line
This is aimed to configurations where multiple aic3x codecs share the same
reset line and are powered from same supply voltages.

Currently aic3x_probe will fail if trying to request already requested
gpio_reset and passing -1 to another aic3x instances cause that those
instances cannot release reset in aic3x_set_power. That is, another
instances can work only if primary aic3x instance is powered and reset is
released.

Solve this by implementing a list of probed instances that is used for
checking if other instance shares the same gpio_reset number. If a shared
reset line exists, then only first instance tries to request and configure
it and the last instance releases it.

Runtime modifications are not needed since aic3x_regulator_event with help
of regulator framework takes already care that reset is pulled down only
when some or all supplies are disabled meaning that all instances using them
are idle.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03 14:18:58 +00:00
Jarkko Nikula 79ee820d2a ASoC: tlv320aic3x: Use gpio_is_valid in checking for valid gpio_reset
I promised to convert this at some point.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-03 14:18:58 +00:00
Liam Girdwood 33ee617f4d Merge remote branch 'tiwai/topic/asoc' into for-2.6.38 2010-11-03 14:18:42 +00:00
Liam Girdwood 0a27f050ab Merge commit 'v2.6.37-rc1' into for-2.6.38 2010-11-03 14:18:11 +00:00
Takashi Iwai cf78c0c426 Merge branch 'for-2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into fix/asoc 2010-11-03 13:56:08 +01: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
Uwe Kleine-König b595076a18 tree-wide: fix comment/printk typos
"gadget", "through", "command", "maintain", "maintain", "controller", "address",
"between", "initiali[zs]e", "instead", "function", "select", "already",
"equal", "access", "management", "hierarchy", "registration", "interest",
"relative", "memory", "offset", "already",

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-11-01 15:38:34 -04:00
Jarkko Nikula 473f89fff7 ASoC: Fix SND_SOC_ALL_CODECS typo for alc5623
Include alc5623.c in SND_SOC_ALL_CODECS when dependencies are met.

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-01 13:58:44 -04:00
Mark Brown 6e1bd1ab1d Merge branch 'for-2.6.37' into for-2.6.38 2010-11-01 13:58:18 -04:00
Jarkko Nikula 76a6106f12 ASoC: Include cx20442 to SND_SOC_ALL_CODECS
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-01 09:22:01 -04:00
Jarkko Nikula 703dde6219 ASoC: Fix SND_SOC_ALL_CODECS typo for jz4740
Include jz4740.c to SND_SOC_ALL_CODECS when the dependencies are met.

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-01 09:21:18 -04:00
Mark Brown 6d212d8e86 ASoC: Remove volatility from WM8900 POWER1 register
Not all bits can be read back from POWER1 so avoid corruption when using
a read/modify/write cycle by marking it non-volatile - the only thing we
read back from it is the chip revision which has diagnostic value only.
We can re-add later but that's a more invasive change than is suitable
for a bugfix.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2010-11-01 09:21:08 -04:00
Jarkko Nikula 63f7526f26 ASoC: tpa6130a2: Fix unbalanced regulator disables
This driver has unbalanced regulator_disable when doing module loading and
unloading. This is because tpa6130a2_probe followed by tpa6130a2_remove
calls twice tpa6130a2_power(0). Fix this by implementing a state checking
in tpa6130a2_power.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-30 17:33:38 +01:00
Peter Ujfalusi 1bc13b2e35 ASoC: tlv320dac33: Mode1 FIFO auto configuration fix
Do not allow invalid (too big) nSample value, when FIFO Mode1
and automatic fifo configuration has been selected.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-30 17:33:38 +01:00
Peter Ujfalusi d54e1f4fdf ASoC: tlv320dac33: Limit the US_TO_SAMPLES macro
Limit the time window to maximum 1s in the macro.
The driver deals with much shorter times (<200ms).
This will fix a rare division by zero bug in Mode1.
This could happen, when the work is not executed in
time (within mode1_latency) after the interrupt.
In this case the DAC33 will not receive the needed
nSample command in time, and enters to an unknown
state, and won't recover.
In such event the time window will increase, and
eventually going to be bigger than 1s, resulting
devision by zero.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-30 17:33:38 +01:00
Peter Ujfalusi 911a0f0bfc ASoC: tlv320dac33: Error handling for broken chip
Correct/Implement handling of broken chip.
Fail the soc_prope if the communication with the chip
fails (can not read chip ID).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-30 17:33:38 +01: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
Arnaud Lacombe 0d040df998 ASoC: sound/wm9090: add missing __devexit marker
This fixes the following warning:

sound/soc/codecs/wm9090.c:668:12: warning: 'wm9090_i2c_remove' defined but not used

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-27 07:53:43 +02:00
Arnaud Lacombe f3607aef0d ASoC: sound/max98088: add missing __devexit marker
This fixes the following warning:

sound/soc/codecs/max98088.c:2054:12: warning: 'max98088_i2c_remove' defined but not used

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-27 07:53:31 +02:00
Arnaud Lacombe 836f539406 ASoC: sound/ad73311: add missing __devexit marker
This fixes the following warning:

sound/soc/codecs/ad73311.c:50:12: warning: 'ad73311_remove' defined but not used

Signed-off-by: Arnaud Lacombe <lacombar@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-27 07:53:17 +02:00
Peter Ujfalusi 7e6120c57c ASoC: TWL4030: Use usleep_range when appropriate
Change the busy loop delays with usleep_range or msleep calls.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-26 11:07:28 +01:00
Takashi Iwai b11bdb5254 Merge branch 'for-2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2010-10-23 17:01:17 +02:00
Peter Ujfalusi 84eae18c86 ASoC: tlv320dac33: Use usleep_range for delays
Switch to use the more precise usleep_range instead of
msleep().
Replace the udelay with usleep_range to remove the busy loop
waiting.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Borwn <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-23 14:43:08 +01:00
Peter Ujfalusi 872a64d7e7 ASoC: tpa6130a2: Error handling for broken chip
Correct/Implement handling of broken chip.
Fail the i2c_prope if the communication with the chip
fails.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-21 22:06:53 +01:00
Arnaud Patard (Rtp) 6f4bc952c6 ASoC: add support for alc562[123] codecs
This patch is adding support for alc562[123] codecs. It's based
on the source code available in HP source code and other places.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-21 13:51:13 -07:00
Dimitris Papastamos 4428bc0990 ASoC: max98088: Staticise m98088_eq_band
This function is not exported and it does not seem to be called from
anywhere else therefore it should be static.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-21 13:47:49 -07:00
Jassi Brar c429ffbe03 ASoC: WM8580: Remove useless assignment
The variable is not used anyway.

Signed-off-by: Jassi Brar <jassi.brar@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-19 03:07:10 -07:00
Mark Brown e86e1244a4 ASoC: Restore MAX98088 CODEC driver
This reverts commit f6765502f8 and adds
the missing include file.

Signed-off-by: Peter Hsiang <Peter.Hsiang@maxim-ic.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-18 16:46:27 -07:00
Mark Brown f6765502f8 Revert "ASoC: Add max98088 CODEC driver"
This reverts commit e65d255a5a since it
does not build.
2010-10-18 06:01:33 +01:00
Peter Hsiang e65d255a5a ASoC: Add max98088 CODEC driver
This patch adds the MAX98088 CODEC driver.

Signed-off-by: Peter Hsiang <peter.hsiang@maxim-ic.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-15 11:56:44 +01:00
Kuninori Morimoto a34712391a ASoC: ak4642: make sure name of register/value
This patch replace magic code with defined name,
and remove unnecessary settings which set default value

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-15 11:54:51 +01:00
Joe Perches c14c05c19f ASoC: Remove unused vol field from WM8994 access mask table
Remove unused vol from struct access_mask

Reduces object size ~3kb.

$ size sound/soc/codecs/wm8994.o*
   text	   data	    bss	    dec	    hex	filename
  40727	   4384	   4480	  49591	   c1b7	sound/soc/codecs/wm8994.o.new
  43879	   4384	   4480	  52743	   ce07	sound/soc/codecs/wm8994.o.old

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-10-15 11:54:25 +01:00
Peter Ujfalusi cf4bb69884 ASoC: tlv320dac33: Control for line output gain
New control to select the line output gain.
This gain control affects the linein-to-lineout and
dac-to-loneout gain differently.
Use enum type to select the desired gain combination.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-13 11:40:47 +01:00
Mark Brown 8c7f78b3c3 ASoC: Restore DAI ID specification for WM8994
WM8994 relies on the DAIs having IDs that match the AIF numbers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-13 10:37:29 +01:00
Mark Brown 821f4206c4 ASoC: Add WM8962 microphone bias control
We unconditionally require SYSCLK since while only microphone detection
specifically requires SYSCLK any actual use case would enable it via
some other means but microphone detection may have nothing active other
than the bias itself.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-13 10:36:57 +01:00
Mika Westerberg 0afe6b901e ASoC: ac97: add MODULE_ALIAS for the platform driver
So that modprobe can load the driver automatically when the platform device
appears.

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-13 10:35:30 +01:00
Mika Westerberg 7750752a22 ASoC: ac97: don't call snd_soc_new_ac97_codec at probe
It is not needed since snd_ac97_mixer() will create a new ac97 object for us.
Removing the call also fixes a memory leak since codec->ac97 is set to NULL at
the beginning of snd_ac97_mixer().

Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-13 10:35:05 +01:00
Kuninori Morimoto 1422408b34 ASoC: ak4642: simultaneous playback/recorde support
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-12 10:59:11 +01:00
Dan Carpenter fe3e2e7ff2 ASoC: checking kzalloc() for IS_ERR() instead of NULL
There is a typo here that got copy and pasted to several probe
functions.  kzalloc() returns NULL on allocation failures and not an
ERR_PTR.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Acked-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-11 12:38:21 +01:00
Mark Brown c969f19f8f ASoC: Compress WM8962 register access map
Reduce the source code size still futher by only specifying non-zero
rows in the WM8962 access map.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-11 03:52:04 -07:00
Mark Brown f57f6c046f ASoC: Shrink code size for WM8962 register defaults table
Dramatically reduce the code size for the WM8962 register defaults table
by switching to explicitly initialise only defined registers, relying on
static defaulting to zero for the overwelming bulk of the register map.

Similar treatement for the register access table will come later and will
produce a similarly dramatic code size shrink.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-11 03:50:39 -07:00
Mark Brown 5c75848a7c ASoC: Staticise CS4270 DAI
It's not needed with multi-component.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Acked-by: Timur Tabi <timur@freescale.com>
2010-10-07 13:40:44 -07:00
Mark Brown de535a5be5 ASoC: Staticise AD1980 DAI
It doesn't need to be exported with multi-component.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-07 12:56:43 -07:00
Dimitris Papastamos e595b3252f ASoC: WM8804: Retrieve the device revision and print it
Be verbose and print out the device revision.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-05 09:57:10 -07:00
Dimitris Papastamos 6c20c807cf ASoC: WM8804: Power down the PLL correctly
The PLL is disabled when the corresponding bit is set not the other
way around.  This commit depends on my other commit with Subject
"ASoC: WM8804: Refactor set_pll code to avoid GCC warnings".

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-04 08:03:11 -07:00
Dimitris Papastamos 86ce6c9a62 ASoC: WM8804: Refactor set_pll code to avoid GCC warnings
Ensure that no uninitialised variable warnings are generated by
GCC.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-04 08:03:00 -07:00
Dimitris Papastamos cb13c6b3ca ASoC: WM8804: Use a proper DAI name
Make sure the DAI name does not include a '/' since we might have
per DAI debugfs or sysfs entries in the future.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-10-02 14:24:39 -07:00
Mark Brown 8ca2aa9c59 ASoC: Put WM8962 GPIO2/3 into GPIO mode when configuring platform data too
GPIO2 and GPIO3 on the WM8962 are MFPs and need to be put into GPIO mode
before the GPIO block can be used to control them. We're already doing
this when used via gpiolib, factor out the code for use when setting static
configurations via platform data as well.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-02 14:23:57 -07:00
Mark Brown 7711308ae6 ASoC: Implement interrupt based jack detection
Allow microphone detection on WM8962 to be performed using the interrupt
signal, allowing the detection of both microphone presence and button
presses with a signal singal from the CODEC to CPU.  Currently a 250ms
debounce time is applied to both short circuit and presence detection,
this has not been optimised.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-02 14:23:26 -07:00
Mark Brown 3367b8d427 ASoC: Add support for WM8962 GPIO outputs
The WM8962 features five GPIOs, add support for controlling their output
state via gpiolib.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-10-02 14:23:04 -07:00
Mark Brown d330a080a8 ASoC: Relax restrictions on WM8962 BCLK configuration
The restrictions on configuring BCLK are overly cautious, other constraints
in the system should ensure that reconfiguration is not possible when the
device is sufficiently active to be unable to support reclocking.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-30 14:55:28 -07:00
Dimitris Papastamos 33cf45c80f ASoC: WM8804: Initial driver
The WM8804 is a high performance consumer mode S/PDIF transceiver with
support for 1 received channel and 1 transmitted channel.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-30 13:32:21 -07:00
Dimitris Papastamos 6b90b55ccc ASoC: Remove unneeded use of spi_bus_type
No need to explicitly set the bus type, spi_register_driver does
that for us.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-30 13:32:07 -07:00
Mark Brown a4f28c001d ASoC: Provide microphone bias configuration for WM8962
Add the widget for MICBIAS power control and allow configuration of the
microphone bias setup via the platform data for the WM8962. When
microphone status signals are brought out to GPIO this should be
sufficient to enable microphone detection.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-30 09:36:13 -07:00
Mark Brown dee0bb9d0f ASoC: Mark WM8962 Additional Control 4 register as volatile
There are some status bits for microphone detection in here.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-30 09:31:42 -07:00
Mark Brown 45e655047f ASoC: Initial WM8962 IRQ support
Provide an initial hookup for interrupts on the WM8962. Currently we simply
report error status via log messages if an IRQ is provided for the device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-29 00:32:36 -07:00
Mark Brown ea738bade2 ASoC: Lowercase WM8962 CODEC name
For consistency.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-29 00:31:50 -07:00
Mark Brown 6137112630 ASoC: Fix masking of WM8962 FLL1 register
When configuring the FLL we preserve the FLL enable configuration in order
to allow us to reenable the FLL after configuration but we do not clear
the other bits in the register, causing old configuration to be preserved.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-28 14:10:18 -07:00
Dimitris Papastamos d1454e6fbd ASoC: WM8985: Use the correct macro for the kcontrol defined
Since we are using custom get/put handlers
use SOC_ENUM_SINGLE_EXT_DECL instead of the original SOC_ENUM_SINGLE_DECL
macro.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-28 14:10:17 -07:00
Takashi Iwai cf1ff50116 ASoC: Fix a compile warning for printk format
sound/soc/codecs/wm8985.c: In function 'wm8985_hw_params':
  sound/soc/codecs/wm8985.c:731:2: warning: format '%d' expects type 'int', but argument 4 has type 'size_t'

Actually the variable is fine as int.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-27 08:18:13 +02:00
Dimitris Papastamos fc38a8a11d ASoC: WM8985: Remove unneeded declaration.
We are not using the private data in this function, so get rid of it.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-24 17:00:37 +01:00
Mark Brown 591796b82a ASoC: Clean up AC'97 glue driver
Remove version number and clean up some indentation.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-24 10:41:27 +01:00
Mark Brown 0704129ff4 Merge branch 'for-2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into for-2.6.37 2010-09-22 12:19:07 +01:00
Mark Brown 13f808cf8d ASoC: Fix merge issue with WM8962 control addition
Let's not add the core controls twice.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-21 10:18:02 +01:00
Mark Brown 5250a5031e ASoC: Fix WM8978/migor driver name conflict
Standardise on 'wm8978' as the name for the CODEC.

Reported-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20 20:43:12 +01:00
Jarkko Nikula 7d1be0a678 ASoC: tlv320aic3x: Let the codec hit SND_SOC_BIAS_OFF when idle
Now codec hits the SND_SOC_BIAS_OFF also when it is idle. This is also
the default state after probing and codec is left unconfigured and
unpowered by default. Initialization will happen when the bias state changes
and aic3x_set_power does power-up and cache sync.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20 18:40:47 +01:00
Jarkko Nikula 5a895f8a09 ASoC: tlv320aic3x: Use regulator notifiers for optimizing the cache sync
There is no need to reset the codec and perform cache sync if none of the
supply regulators were not disabled. Patch registers a notifier callback for
each supply and callback then sets a flag to indicate when cache sync is
required.

HW writes are also needless when codec bias is off so cache_only flag is set
independently of actual supply regulators state.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20 18:40:47 +01:00
Jarkko Nikula 6c1a7d40c2 ASoC: tlv320aic3x: Add runtime regulator control to aic3x_set_bias_level
Now all the regulators are disabled when entering into SND_SOC_BIAS_OFF
and enabled when coming back to SND_SOC_BIAS_STANDBY state. Currently this
runtime control happens only with suspend/resume as this patch does not
change the default idle behavior.

This patch manages all the regulators and reset since it seems that register
sync is needed even if only analog supplies AVDD and DRVDD are disabled.
This was noted when the system was running with idle behavior changed and
IOVDD and DVDD were on.

It is not known are all the registers needed to sync or only some subset of
them. Therefore patch plays safe and does always full shutdown/power-up.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20 18:40:46 +01:00
Jarkko Nikula 2f24111a08 ASoC: tlv320aic3x: Move regulator management from i2c to soc domain
It will be easier to keep regulator enable/disable calls in sync when dynamic
regulator management is added if regulator management is moved from
aic3x_i2c_probe/_remove to aic3x_probe/_remove.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20 18:40:46 +01:00
Liam Girdwood 826ca0bd53 Merge remote branch 'asoc/for-2.6.37' into for-2.6.37 2010-09-20 09:53:29 +01:00
Jarkko Nikula 19f7ac5038 ASoC: tlv320aic3x: Add virtual output pin Detection
Purpose of this virtual Detection pin is to keep codec bias on whenever the
GPIO or jack detection features are needed.

Jack detection needs a mic bias so machine drivers can construct a following
route for instance for keeping the path and codec bias on:

"Input Jack" -> "Mic Bias xV" -> "Detection" -> detection block inside codec.

For the GPIO the machine driver can force the pin on with
snd_soc_dapm_force_enable_pin.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-20 09:52:39 +01:00
Liam Girdwood 611ad378b3 Merge remote branch 'broonie-asoc/for-2.6.37' into for-2.6.37 2010-09-20 09:49:26 +01:00
Kuninori Morimoto 4c62ed9b55 ASoC: da7210: code clean up
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-16 14:14:57 +01:00
Kuninori Morimoto 0ce75aa4fe ASoC: ak4642: code clean up
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-16 14:14:56 +01:00
Dimitris Papastamos 6d6f8b8327 ASoC: WM8985: Initial driver
The WM8985 is a low power, high quality, feature-rich stereo
CODEC designed for portable multimedia applications that
require low power consumption and high quality audio.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-15 16:11:24 +01:00
Jarkko Nikula 9900daa81b ASoC: tlv320aic3x: Complete the soc-cache conversion
Complete the phasing out of aic3x_read_reg_cache, aic3x_write_reg_cache,
aic3x_read and aic3x_write calls.

This patch uses in aic3x_read the codec->hw_read that points to a function
implemented by soc-cache. Only use for aic3x_read is if wanting to read
volatile bits from those registers that has both read-only and read/write
bits. All other cases should use snd_soc_read.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-15 13:56:15 +01:00
Jarkko Nikula a84a441ba3 ASoC: tlv320aic3x: Switch to soc-cache helpers
Continue phasing out aic3x_read_reg_cache, aic3x_write_reg_cache, aic3x_read
and aic3x_write calls.

This patch takes the soc-cache in use and removes aic3x_read_reg_cache and
aic3x_write.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-15 13:56:15 +01:00
Jarkko Nikula e18eca4303 ASoC: tlv320aic3x: Use snd_soc_read and snd_soc_write
Start phasing out aic3x_read_reg_cache, aic3x_write_reg_cache, aic3x_read and
aic3x_write calls in order to switch to soc-cache helpers.

This patch replaces aic3x_read_reg_cache and aic3x_write with snd_soc_read
and snd_soc_write. This is basically null-op since .read and .write in
soc_codec_dev_aic3x points to aic3x_read_reg_cache and aic3x_write.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-15 13:56:15 +01:00
Arnaud Patard (Rtp) 697378972d ASoC: Change my mail address
Like other coworkers, I'm about leave Mandriva/Edge-It so I'm changing
my mail address to use my personal one.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-15 12:03:58 +01:00
Jarkko Nikula c6d5cca0a0 ASoC: Remove needless codec->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: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-15 12:03:34 +01:00
Dimitris Papastamos 6946e037ee ASoC: Fix off-by-one bug in WM8962 register cache size configuration
This is a simple off-by-one bug, the size of the register cache is
incorrectly set to the maximum register index. Fix it by adding one.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-11 10:45:00 +01:00
Matti J. Aaltonen 2c4ee9b579 ASoC: WL1273 FM Radio: Eliminate unnecessary error return value.
With this change it's not a error to call wl1273_set_audio_route
when the codec is active if the new routing value is the same
as the current active setting.

Signed-off-by: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-11 09:03:21 +01:00
Jarkko Nikula c23fd751dc ASoC: tlv320aic3x: Optimize PLL programming in aic3x_set_bias_level
There is only need to enable/disable once the PLL when the bias is going
between on, prepare, standby and off states.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-11 09:03:20 +01:00
Dimitris Papastamos e5eec34c68 ASoC: Fix incorrect register cache size configuration
The reg_cache_size is the number of elements in the register cache,
not the size of the cache itself. This is not a problem if the size
of each element of the cache is 1 byte but it matters in any other
case.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-10 22:21:23 +01:00
Axel Lin c7bad06f13 ASoC: ad1980 - set reg_cache_default to ad1980_reg
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-10 16:07:42 +01:00
Vasily Khoruzhick 8e3dce4d08 ASoC: UDA1380: Add delay between power on and reset
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-08 11:27:16 +01:00
Mark Brown df3c278eb3 ASoC: Remove export of CS4270 DAI
Not needed with multi-component.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Timur Tabi <timur@freescale.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-07 20:06:59 +01:00
Mark Brown 0daaf7e896 ASoC: Staticise WM9712 DAI list
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-06 20:43:03 +01:00
Mark Brown 5ab230a768 ASoC: Fix cut'n'paste comment in WM8994
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-06 17:44:07 +01:00
Mark Brown 2f02a59c55 Merge branch 'for-2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into for-2.6.37 2010-09-06 11:53:13 +01:00
Jiri Slaby e692937807 ASoC: wm8753, remove dead code
There is adangling code in wm8753_probe which is never executed.
Remove it.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Acked-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-06 11:41:21 +01:00
Jarkko Nikula c776357e0a ASoC: tlv320aic3x: Fix null pointer dereference when pdata is not set
Null pointer dereference will occur from *setup = pdata->setup if pdata
is not set. Fix this by moving assignments from pdata inside non-null case.

Thanks to Jiri Slaby <jirislaby@gmail.com> for noticing.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-06 11:36:22 +01:00
Kuninori Morimoto 73bb379f1a ASoC: ak4642: Revive ak4642_snd_controls
This patch revive ak4642_snd_controls which was removed on
f0fba2ad1b

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-03 10:53:16 +01:00
Ian Lartey 3079aed5f5 ASoC: Added a missing 32-bit PCM format, to the wm8994 codec.
Signed-off-by: Ian Lartey <ian@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-09-01 12:45:51 +01:00
Mark Brown f554885f92 ASoC: Implement WM8994 DAC data source muxes
Allow selection of the channel used for input to the AIFnDAC signals.
This isn't integrated into DAPM since we treat the data as a single
mono channel until just beyond this selection so it ends up having
no visible effect on the routing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-09-01 12:14:44 +01:00
Arnaud Patard (Rtp) c88e7b93a8 ASoC: OpenRD Client : Fix naming breakage due to multicomponent support
multicomponent support added/changed some device name but added some typos,
breaking existing OpenRD Client support.

Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-31 13:35:15 +01:00
Vasily Khoruzhick 8614d310a2 ASoC: uda1380: make driver more powersave-friendly
Disable some codec modules in standby mode, completely disable
codec in off mode to save some power.
Fix suspend/resume: mark mixer regs as dirty on resume to
restore mixer values, otherwise driver produces no sound
(master is muted by default).

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Acked-by: Marek Vasut <marek.vasut@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-31 13:25:17 +01:00
Jarkko Nikula 098b171823 ASoC: tlv320aic3x: Sanitize output controls
Currently output controls are not uniform. Some routes are adjusted by
mono controls that don't match to associated mixer switch, many routes are
not covered at all and stereo controls have following variants:

- L-to-L & R-to-R
- R-to-L & R-to-R
- L-to-L & R-to-L

This patch attempts to fix these issues. First, for the convenience, only
direct L-to-L, R-to-R and [L | R]-to-Mono routes are controlled by the
stereo controls. This logic is also used with the output pin mute controls
so all of them except mono output are controlled by stereo switches.

Then rest of the swapped L-to-R and R-to-L routes are controlled by the
mono controls that map to mixer switches with a same name. Mixers can then
associate these switches and volumes together.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-28 10:57:58 +01:00
Jarkko Nikula c3b79e05b4 ASoC: tlv320aic3x: Reimplement output mixers
It turned out that the output mixers and their routes were misdefined: They
are not mixing output pins to internal signals but opposite. This has worked
for direct left-to-left and right-to-right routes since for those there are
complete routes. For swapped left-to-right and right-to-left routes this is
not working since there are no routes defined between them.

Another consequence is that those misdefined mixers are incorrectly routed
to several output pins leading unnecessary pin powerings even if there is no
route active to them.

Fix these by reimplementing the output mixers and routes as they are in
hardware. For completeness add also a few missing links between internal
signals and outputs.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-28 10:57:58 +01:00
Jarkko Nikula b2eaac203a ASoC: tlv320aic3x: Sort output pin control registers in header file
Each output pin has 7 consecutive control registers in tlv320aic3x register
map. First 6 of them control the signal mixing and one is for output level
and power control.

Sort these registers as they are sorted clearly in hardware, it makes also
definitions more readable and easier to pinpoint missing register
definitions.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-28 10:57:58 +01:00
Jarkko Nikula f9bc02974d ASoC: tlv320aic3x: Fix remaining output pin switch names
Bit 3 in output pin_CTRL register mutes the whole output pin not just the
route from DAC so remove misleading DAC from control name. Currently only
"Line[L | R] Playback Switch" were correct.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-28 10:57:58 +01:00
Uwe Kleine-König 0bb5f267af ASoC: ad1980: remove unneeded function declaration
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-28 09:51:34 +01:00
Ian Lartey 3fe4a5ee9c ASoC: Complete supported clock ratios and rate constraints for wm8741
Signed-off-by: Ian Lartey <ian@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-28 09:46:42 +01:00
Ian Lartey 30e2d36885 ASoC: Make codec dai naming for WM8741 consistent
Signed-off-by: Ian Lartey <ian@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-23 13:36:47 +01:00
Mark Brown 49d7ad9d8a ASoC: Add build infrastructure for WL1273
The Makefile and Kconfig updates for WL1273 appear to have been mising
from the patch posted, add them.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-23 13:31:51 +01:00
Mark Brown 7d83d21383 ASoC: Log WM8994 separate ADC LRCLKs every time we configure
This makes it that little bit easier to spot the diagnostics in the
logs.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-23 13:31:45 +01:00
Liam Girdwood 97e15b1fcf Merge remote branch 'broonie-asoc/for-2.6.37' into for-2.6.37 2010-08-23 12:58:01 +01:00
Jarkko Nikula 37b47656ba ASoC: Fix tlv320aic3x GPIO initialization
aic3x_init does a soft reset first and thus TLV320AIC3x GPIO setup must be
done after doing the basic init. Before multi-component the init was done
at i2c probe time and GPIO setup at soc probe time.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-23 12:03:09 +01:00
Mark Brown bf557a50f5 Merge branch 'for-2.6.37' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into for-2.6.37 2010-08-20 17:19:27 +01:00
Matti J. Aaltonen 3fabe089ad ASoC: TI WL1273 FM Radio Codec.
This is an ALSA codec for the Texas Instruments WL1273 FM Radio.

Signed-off-by: Matti J. Aaltonen <matti.j.aaltonen@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-20 13:28:49 +01:00
Randolph Chung 6184f105aa ASoC: Add support for tlv320aic3007 to tlv320aic3x codec.
This patch adds support for the tlv320aic3007 codec to the tlv320aic3x
driver.

The tlv320aic3007 is similar to the aic31, but has an additional class-D
speaker amp. The speaker amp control register overlaps with the mono
output register of other codecs in this family, so we add logic to
identify the actual codec being registered to set things up accordingly.

Signed-off-by: Randolph Chung <tausq@parisc-linux.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-20 12:14:46 +01:00
Janusz Krzysztofik 5394637a24 ASoC: Use a more adequate name for the CX20442 codec DAI
In the process of unification of codec DAI names while implementing
multi-component, the CX20442 codec DAI has been renamed to "cx20442-hifi".
This new name seems not adequate for a 8kHz voice codec.

Use a better name, "cx20442-voice", as suggested by Liam Girdwood.

Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-19 15:30:43 +01:00
Randolph Chung 1401761595 ASoC: Configure symmetric rates for tlv320aic3x
The tlv320aic3x codec driver only supports symmetric rates for capture/
playback. Set the flag in the DAI accordingly.

Signed-off-by: Randolph Chung <tausq@parisc-linux.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-19 12:07:36 +01:00
Haojian Zhuang f213f4b517 ASoC: add 88pm860x codec driver
Add 88PM860x codec driver. 88PM860x codec supports two interfaces. And it
also supports headset/mic/hook/short detection.

Signed-off-by: Haojian Zhuang <haojian.zhuang@marvell.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-18 18:03:09 +01:00
Mark Brown e77125105b ASoC: Support non-crystal master clocks for WM8731
Instead of unconditionally enabling the crystal oscillator on the WM8731
only enable it when explicitly selected via set_sysclk(), allowing machine
drivers to specify that they drive a clock into MCLK alone. This avoids
any conflicts between the oscillator and the external MCLK source and saves
power for systems which do not need the oscillator.

This should also deliver a small power saving on systems using the crystal
since the oscillator will only be enabled when the ADC or DAC is active.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-18 16:52:56 +01:00
Mark Brown 366624ba7a ASoC: Remove unused WM8974 private data
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-17 12:10:18 +01:00
Mark Brown f538281c2b ASoC: Fix argument ordering for snd_soc_update_bits() in WM8580
Reported-by: Seungwhan Youn <claude.youn@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-16 20:21:45 +01:00
Mark Brown c25edef8dc ASoC: Fix WM8580 CLKSEL mask selection
The RX and TX directions were inverted.

Reported-by: Seungwhan Youn <claude.youn@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-16 20:21:34 +01:00
Mark Brown e4862f2f6f Merge branch 'for-2.6.36' into for-2.6.37
Fairly simple conflicts, the most serious ones are the i.MX ones which I
suspect now need another rename.

Conflicts:
	arch/arm/mach-mx2/clock_imx27.c
	arch/arm/mach-mx2/devices.c
	arch/arm/mach-omap2/board-rx51-peripherals.c
	arch/arm/mach-omap2/board-zoom2.c
	sound/soc/fsl/mpc5200_dma.c
	sound/soc/fsl/mpc5200_dma.h
	sound/soc/fsl/mpc8610_hpcd.c
	sound/soc/pxa/spitz.c
2010-08-16 18:42:58 +01:00
Mark Brown b2c1e07b81 ASoC: Remove DSP mode support for WM8776
This is not supported by current hardware revisions.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2010-08-16 11:46:57 +01:00
Mark Brown ec62dbd7eb Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into for-2.6.37
Trivial overlap with the removal of the local revision variable.

Conflicts:
	sound/soc/codecs/wm8994.c
2010-08-15 14:56:40 +01:00
Mark Brown 6bfb6aa91f ASoC: Automatically manage WM8580 DAC OSR
The DAC OSR should be selected based on the sample clock ratio.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-15 14:52:53 +01:00
Mark Brown dacfe9f277 ASoC: Fix inverted WM8580 capture mute control
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-15 14:52:40 +01:00
Mark Brown ba2772edbe ASoC: Implement BCLK rate selection for WM8580
Drive a minimal supported number of clocks required for the current
bit format in master mode. In slave mode this setting has no effect.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-15 14:52:29 +01:00
Mark Brown c5607d8e7a ASoC: Automatically calculate clock ratio for WM8580
Implement set_sysclk() and then rather than assuming 256fs use the
supplied value to calculate and configure the clock ratio for the
currently used sample rate. As a side effect we also end up
implementing clock selection for the ADC path.

In order to avoid confusion remove the existing set_clkdiv() based
configuration of the clock source for the DAC and update the SMDK64xx
driver (which is the only in-tree user of the CODEC).

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-15 14:52:12 +01:00
Mark Brown 8ef339df25 ASoC: Remove unused rate selection bitmasks from WM8580
In the case of the BCLK rate the defines are at best misleading anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-15 14:51:32 +01:00
Mark Brown e231cab0a4 ASoC: Convert WM8580 hw_params to use snd_soc_update_bits()
All the cool kids are using snd_soc_update_bits() these days.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-15 14:51:21 +01:00
Mark Brown b6b056911a ASoC: Only tweak WM8994 chip configuration on devices up to rev D
Any subsequent revisions will have these configuration changes applied
by default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-13 14:55:13 +01:00
Mark Brown 0c17b39394 ASoC: Optimise DSP performance for WM8994
Change the chip defaults to optimise performance of some of the DSP
functionality.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-13 14:55:01 +01:00
Mark Brown 381ac990db ASoC: Remove unused driver data from WM8961 probe
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-12 16:11:07 +01:00
Mark Brown 48bd3472d6 ASoC: Staticise WM8727 codec driver structure
Nothing should be referencing this any more.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-12 16:10:55 +01:00
Mark Brown 54d8d0aeb9 ASoC: Update WM8962 to build with multi-component
No notable changes, currently build tested only.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-12 15:02:11 +01:00
Mark Brown cf7af01aa7 Merge branch 'topic/multi-component' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into for-2.6.37 2010-08-12 14:40:28 +01:00
Peter Ujfalusi 5dcba5d674 ASoC: multi-component: TWL4030: Restore registers on removal
Add back the register restore call, when the codec driver is
removed.
This does not affect normal operation, but it is usefull when
debugging audio through the twl4030 class codecs.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-12 14:04:35 +01:00
Mark Brown 38445af3bc ASoC: Remove version display from WM8971 driver
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-12 14:00:19 +01:00
Mark Brown af3751a0bf ASoC: Remove unneeded control_data management from Wolfson drivers
Now soc-cache.c can figure out the I2C and SPI control data from the
device for the CODEC we don't need to manually assign it in drivers.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-12 14:00:19 +01:00
Mark Brown 26e277d715 ASoC: Remove version display from WM8510 driver
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-12 14:00:18 +01:00
Liam Girdwood f0fba2ad1b ASoC: multi-component - ASoC Multi-Component Support
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-08-12 14:00:00 +01:00
Sonic Zhang 2e2211a387 ASoC: add AD1980 obsolete information
This codec has been obsoleted by ADI, so add appropriate warnings to the
source tree to dissuade people from using in new designs based on driver
support.

Signed-off-by: Sonic Zhang <sonic.zhang@analog.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-10 15:43:45 +01:00
Mark Brown 6f341d1481 ASoC: Correct WM8580 Capture control names
Should use Capture rather than ADC so the UI tools can identify their
function more readily.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-10 09:58:01 +01:00
Mark Brown 4f0ed9a51b ASoC: Fix inverted mute controls for WM8580
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2010-08-10 09:56:07 +01:00
Mark Brown 9a76f1ff6e ASoC: Add initial WM8962 CODEC driver
The WM8962 is a low power, high performance stereo CODEC designed for
portable digital audio applications.

This initial driver release supports the key audio paths of the WM8962.
Extended functionality, such as microphone detection, digital microphones
and the advanced DSP signal enhancements provided by the device are not
yet supported.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-05 13:38:57 +01:00
Peter Ujfalusi bda7d2a862 ASoC: TWL4030: Capture route runtime DAPM ordering fix
Fix the ordering problem in DAPM domain, when the user
changes between digital and analog sources during active
capture (or loopback) scenario.
Before this patch, when the user changed from analog source
to digital there were a short time, when the codec enabled
analog mic bias (2.2 volts) instead of the correct digital
mic bias (1.8 volts) to the digital microphones.
This behaviour caused by the former implementation of
selecting the correct type of bias. This was done at the
POST_REG event of the DAPM_MUX_E("TXx Capture Route")
widget.
By moving the bias type selection as DAPM_SUPPLY and
connecting it to the corresponding digimic widget the
problematic situation can be avoided.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-08-04 00:42:39 +01:00
Axel Lin 116bcd9cf2 ASoC: wm9081: fix resource reclaim in wm9081_register error path
This patch fixes the error path in wm9081_register to properly free resources.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:46:41 +01:00
Axel Lin d484366bee ASoC: wm8978: fix a memory leak if a wm8978_register fail
There is a memory leak found if wm8978_register() fail.
This patch moves the buffer allocate and release
at the same level to prevent the memory leak.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:46:27 +01:00
Axel Lin 4eaac50552 ASoC: wm8974: fix a memory leak if another WM8974 is registered
wm8974 is allocated in wm8974_i2c_probe() but is not freed if wm8974_register()
return -EINVAL (if another WM8974 is registered).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:46:07 +01:00
Axel Lin 6b5d071e8b ASoC: wm8961: fix resource reclaim in wm8961_register error path
This patch fixes the error path in wm8961_register to properly free resources.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:45:52 +01:00
Axel Lin 8089a49d99 ASoC: wm8955: fix resource reclaim in wm8955_register error path
This patch fixes the error path in wm8955_register to properly free resources.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:45:37 +01:00
Axel Lin db1e18de98 ASoC: wm8940: fix a memory leak if wm8940_register return error
This patch adds checking for wm8940_register return value,
and does kfree(wm8940) if wm8940_register() fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:45:20 +01:00
Axel Lin 62f5ad6733 ASoC: wm8904: fix resource reclaim in wm8904_register error path
This patch includes below fixes:
1. wm8904 need to be kfreed in wm8904_register() error path before return.
2. fix the error path for snd_soc_register_codec() fail and
   snd_soc_register_dai() fail to properly free resources.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:45:00 +01:00
Axel Lin 2c2749de11 ASoC: wm8711: fix a memory leak if another WM8711 is registered
wm8711 is allocated in either wm8711_spi_probe() or wm8711_i2c_probe() but is
not freed if wm8711_register() return -EINVAL(if another ad1836 is registered).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:44:29 +01:00
Axel Lin ef99e9b5a1 ASoC: wm8523: fix resource reclaim in wm8523_register error path
This patch includes below fixes:
1. If another WM8523 is registered, need to kfree wm8523 before return -EINVAL.
2. If snd_soc_register_codec failed, goto error path to properly free resources.
3. Instead of using mixed in-line and goto style cleanup, use goto style error
   handling if snd_soc_register_dai failed.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:44:10 +01:00
Axel Lin 085efd28b6 ASoC: da7210: fix a memory leak if failed to initialise da7210 audio codec
da7210 should be kfreed if da7210_init() return error.
This patch also fixes the error handing in the case of snd_soc_register_dai()
fail by adding snd_soc_unregister_codec() in error path.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:43:52 +01:00
Axel Lin 7bcaad919b ASoC: ak4642: fix a memory leak if failed to initialise AK4642
ak4642 should be kfreed if ak4642_init() return error.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Reviewed-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:40:41 +01:00
Axel Lin fd3c8ac9cb ASoC: ad1836: fix a memory leak if another ad1836 is registered
ad1836 is allocated in ad1836_spi_probe() but is not freed if ad1836_register()
return -EINVAL (if another ad1836 is registered).

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Barry Song <21cnbao@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:40:26 +01:00
Ian Lartey 992bee401c ASoC: Initial WM8741 CODEC driver
The WM8741 is a very high performance stereo DAC designed for audio
applications such as professional recording systems, A/V receivers and
high specification CD, DVD and home theatre systems. The device supports
PCM data input word lengths from 16 to 32-bits and sampling rates up to
192kHz.  The WM8741 also supports DSD bit-stream data format, in both
direct DSD and PCM-converted DSD modes.

TODO: Expand wm8741_set_dai_sysclk and rate_constraint members to
allow for all supported sample rate / Master Clock frequency combinations.
Fully enable control of supplies.

Signed-off-by: Ian Lartey <ian@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-08-03 07:38:15 +01:00
Peter Ujfalusi a577b318fc ASoC: tlv320dac33: Add support for automatic FIFO configuration
Platform parameter to enable automatic FIFO configuration when
the codec is in Mode1 or Mode7 FIFO mode.
When this mode is selected, the controls for changing
nSample (in Mode1), and UTHR (in Mode7) are not added.
The driver configures the FIFO configuration based on
the stream's period size in a way, that every burst will
read period size of data from the host.
In Mode7 we need to use a formula, which gives close enough
aproximation for the burst length from the host point
of view.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-29 10:21:11 +01:00
Peter Ujfalusi f430a27f05 ASoC: tlv320dac33: Revisit the FIFO Mode1 handling
Replace the hardwired latency definition with platform data
parameter, and simplify the nSample parameter calculation.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-29 10:21:04 +01:00
Peter Ujfalusi b93cc9f19b ASoC: TWL4030: Capture route DAPM event fix
There is no need to handle POST_PMU, POST_PMD event with
the Capture Route widget.
It is enough to handle POST_REG event, since that will come
when the user changes the routing, and we will switch the needed
bits in the registers.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-27 11:43:40 +01:00
Kuninori Morimoto a7e7cd5bd7 ASoC: da7210: Add HeadPhone Playback Volume control
HeadPhone Playback Volume control register of DA7210 has
reserved area. This patch considered it as mute.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-23 10:17:47 +01:00
Takashi Iwai 49e7042799 Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2010-07-21 15:01:07 +02:00
Peter Ujfalusi 01ea6ba2bc ASoC: TWL4030: Add configurable delay after digimic enable
When digital microphones are connected to twl, delay is
needed after enabling the digimic interface of the codec.
Add new parameter for the setup data, which can be used
to pass the apropriate delay in ms after the digimic
interface has been enabled.

Without certain delay (in certain HW configuration) the
beggining of the recorded sample contains a glitch, which
is generated by the digital microphones.

Delaying the micbias1, 2 (which is the bias for the digimic0
or 1) does not help, since the glitch is coming after
switching the digimic interface.

Reversing the micbias and digimic enable order does not
work either (in that case the wait need to be added after
the micbias enabled).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-21 11:57:58 +01:00
Mark Brown d1ce6b200c ASoC: Unconditionally enable WM8994 AIF1ADC TDM mode
AIF1ADC TDM mode has no effect other than causing the ADCDAT line to
be tristated rather than driven low on clock cycles where there is no
data to be transmitted. If the clock cycle is idle then there should
be no devices using the data so tristating should have no adverse
effects.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-20 10:27:05 +01:00
Mark Brown 3b89b22358 Merge branch 'for-2.6.35' into for-2.6.36 2010-07-20 09:52:25 +01:00
Chanwoo Choi 41f9a314af ASoC: Select wm_hubs automatically for WM8994
Otherwise all machine drivers need to do so.

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>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-20 09:51:12 +01:00
Mark Brown a3257ba869 ASoC: Implement WM8994 AIF1ADC2 paths
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-20 09:48:25 +01: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 d947837410 Merge branch 'for-2.6.35' into for-2.6.36 2010-07-17 19:45:43 +01:00
Mark Brown 3c0709396d ASoC: Remove duplicate AUX definition from WM8776
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2010-07-17 19:44:40 +01:00
Jorge Eduardo Candelaria 0fad4ed7b2 ASoC: TWL6040: Correct widget handling for drivers
In order to reduce pop-noise at powering up/down of the DACs and Drivers,
these components have to be handled in a specific sequence. Headset,
Handsfree, and Earphone drivers are now registered as PGA components to
ensure DACs are enabled first.

Also, add a delay to leave time for DACs to settle before
continuing power up/down sequence.

Signed-off-by: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-17 19:27:18 +01:00
Mark Brown 03b0dc02cf Merge branch 'for-2.6.35' into for-2.6.36 2010-07-14 20:12:57 +01:00
Axel Lin cecb66fddf ASoC:: remove a redundant snd_soc_unregister_codec call in wm8988_register
snd_soc_unregister_codec is called twice if snd_soc_register_dai fail.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-14 20:12:31 +01:00