Commit graph

1163 commits

Author SHA1 Message Date
Mark Brown 59f7297014 ASoC: Split WM8731 enumeration array into individual enums
This is much more maintainable than the array.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-02 12:00:12 +00:00
Mark Brown d921184e82 ASoC: Provide WM8731 microphone boost TLV information
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-02 11:59:59 +00:00
Axel Lin fbe609e41b ASoC: Remove unused aic3x_i2c_init and aic3x_i2c_exit functions
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-02 11:50:07 +00:00
Peter Ujfalusi 39646871a4 ASoC: tpa6130a2: Replace DAPM code with direct interface
The use of DAPM widgets, and extra routing can cause ordering
problems in the system.
Machine drivers should use the exported direct interface with
SND_SOC_DAPM_HP's event callback to manage the state of the
amplifier.

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-12-02 11:50:07 +00:00
Axel Lin cca67a3668 ASoC: ak4535: Improve readability for setting mute
The mute/unmute is controled by SMUTE (Soft Mute Control bit):
        0: Normal Operation (Default)
        1: DAC outputs soft-muted

I think this change improves readability.

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-12-01 11:50:09 +00:00
Mark Brown 131d81061e ASoC: Allow user-specified WM8958 multiband compressor configurations
The paramters of the WM8958 multiband compressor can be tuned by the
user for their system using a graphical configuration tool on the host.
Allow the user to specify a set of such paramters in platform data and
select between them at runtime.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-01 11:47:29 +00:00
Mark Brown b2822a8c22 ASoC: Correct event flags for WM8958 AIF DACs
We need a post notification as we need to shut down the MBC after the
data stops flowing rather than before.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-12-01 11:46:10 +00:00
Mark Brown 97884b7a78 Merge branch 'for-2.6.37' into for-2.6.38 2010-12-01 11:34:27 +00:00
Dimitris Papastamos 2062ea522b ASoC: WM8731: Fix incorrect mask for bypass path disable
According to the datasheet the bypass path enable/disable is
bit 3 therefore we need 0x8 and not 0x4.

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-12-01 11:26:40 +00:00
Peter Ujfalusi 1bb5ec6a6a ASoC: tpa6130a2: Add stereo DAPM path
New DAPM widgets, and paths to enable both channels at the
same time (for stereo output).
With this path the switch time difference can be avoided
between left and right channels.
The original DAPM paths can be still used, if only one of
TPA's output has been connected to a speaker, but for most of
the cases, switching to the stereo path is better.

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-11-30 15:39:39 +00:00
Peter Ujfalusi 8cc14e13d1 ASoC: tpa6130a2: Use one event handler for PGA_E
Reduce the amount of duplicated code by using single
event handler for PGA_E to enable the needed channel.
Use the w->shift to pass the channel information to
the handler function.

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-11-30 15:39:39 +00:00
Peter Ujfalusi d534bacd91 ASoC: tpa6130a2: Defer SW enable from power enable
Do not enable the amplifier right after the power has been
restored to the amplifier.
The DAPM_SUPPLY widget turns on the amp early in the DAPM
power walk, and the unmuting of channel happens quite late.
Keeping the amp in SW reset state ensures better muting.
In this way the pop noise coming from other components (codec)
can be filtered out.

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-11-30 15:39:39 +00:00
Peter Ujfalusi d5876ce124 ASoC: tpa6130a2: Simplify power state management
Use simpler way to avoid setting the same power state
for the amplifier.
Simplifies the check introduced by patch:
ASoC: tpa6130a2: Fix unbalanced regulator disables

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Cc: Jarkko Nikula <jhnikula@gmail.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-30 15:39:39 +00:00
Peter Ujfalusi 3e202345ab ASoC: tlv320dac33: Avoid multiple soft power up
During playback start the codec has been already powered at
BIAS_ON event time, so there's no need to enable the codec again.

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-11-30 15:37:39 +00:00
Peter Ujfalusi 18f454047b ASoC: tlv320dac33: Do not enable the codec in init_chip
No need to enable the codec at this time.
The codec will be enabled  later by other events

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-11-30 15:37:39 +00:00
Axel Lin 551102762e ASoC: Simplify pm860x_probe error handling
Simplify pm860x_probe error handling and return actual error code we got.

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-30 11:35:07 +00:00
Mark Brown 39fb51a123 ASoC: Implement runtime PM for WM8994/58
This allows us to communicate our power management state back to the
parent device, allowing it to do a full power down when the device is
idle.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:14 +00:00
Mark Brown 2e19b0c8c2 ASoC: Enable rbtree compression for WM8994/58 register cache
The WM8994 and WM8958 register map is relatively sparse so benefits
from compression. The rbtree compression gives better results than
LZO for both memory and CPU consumption on a map as sparse as this.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:14 +00:00
Mark Brown ca9aef5072 ASoC: Convert WM8994 to use soc-cache.c cache functions
In the process we convert the driver to read registers one at a time
when initialising the cache. This has the effect of working around
limitations in the sizes of I2C transactions which can be done by some
CPUs. Due to the sparseness of the register map the overhead from this
should be minimual unless I2C transactions are very expensive to start.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-27 10:32:14 +00:00
Mark Brown 821edd2fb5 ASoC: Add WM8958 microphone detection support
The WM8958 contains an advanced accessory detection feature which allows
detection of up to seven different impedence levels on the microphone
bias output, including detection of video outputs. Since some of the
more involved accessory interfaces may involve noticable interactions
with external components a simple detection scheme is provided by
default with the option to provide custom handling of accessory detect.

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
Mark Brown d6addcc9d8 ASoC: Add WM8958 Multi-band compressor support
The WM8958 features a multi-band compressor which can be enabled on
any of the AIF inputs. The MBC allows different gains to be applied to
differnt audio bands, providing an improvement in perceived loudness
of the signal by avoiding overdriving the output transducers. This
patch enables support for the MBC.

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
Mark Brown c4431df050 ASoC: Implement support for enhanced AIF3 on WM8958
Additional audio routing options are available on the WM8958 audio
interface 3. Add support for these.

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
Mark Brown 3a42315740 ASoC: Initial WM8958 audio configuration
The WM8958 is a WM8994 derivative. This patch merely ensures that some
revision specific configuration for WM8994 is not enabled on WM8994,
additional patches will add support for the new features introduced on
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
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
Mark Brown ccf1fa403e ASoC: Remove redundant hw_write initialisation in WM8737
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-26 15:16:19 +00:00
Mark Brown fdc1f5d060 Merge branch 'for-2.6.37' into for-2.6.38 2010-11-25 21:16:52 +00:00
Axel Lin fe99b55994 ASoC: tlv320aic3x - fix variable may be used uninitialized warning
If aic3x_read failed , val is used uninitialized.
Fix it by initializing val to 0.

This patch fixes below compile warning:
sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_get_gpio':
sound/soc/codecs/tlv320aic3x.c:1183: warning: 'val' may be used uninitialized in this function
sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_headset_detected':
sound/soc/codecs/tlv320aic3x.c:1211: warning: 'val' may be used uninitialized in this function
sound/soc/codecs/tlv320aic3x.c: In function 'aic3x_button_pressed':
sound/soc/codecs/tlv320aic3x.c:1219: warning: 'val' may be used uninitialized in this function

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-25 21:15:35 +00:00
Mark Brown fcd02e261b ASoC: Add WM8737 ALC support
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-25 11:18:51 +00:00
Mark Brown ab4e57446f Merge branch 'for-2.6.37' into for-2.6.38 2010-11-24 11:57:43 +00:00
Mark Brown 2a9ae13a26 ASoC: Add initial WM8737 driver
The WM8737 is a low power, flexible stereo ADC designed for portable
applications. This driver supports most of the functionality of the
WM8737, though some features such as the ALC are not yet implemented.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-24 11:33:12 +00:00
Mark Brown a1c1f770e3 Merge branch 'topic/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into for-2.6.38 2010-11-24 11:26:39 +00:00
Axel Lin 2f7dceeda4 ASoC: wm8961 - clear WM8961_MCLKDIV bit for freq <= 16500000
MCLKDIV bit of Register 04h Clocking1:
	0 : Divide by 1
	1 : Divide by 2

Thus in the case of freq <= 16500000, we should clear MCLKDIV bit.

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>
Cc: stable@kernel.org
2010-11-24 11:22:44 +00:00
Axel Lin 08b1a38465 ASoC: wm8961 - clear WM8961_DACSLOPE bit for normal mode
DACSLOPE bit of Register 06h ADC and DAC Control 2:
        0: Normal mode
        1: Sloping stop-band mode

Thus in the case of normal mode, we should clear DACSLOPE bit.

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>
Cc: stable@kernel.org
2010-11-24 11:22:43 +00:00
Mark Brown d50a87402e Merge branch 'for-2.6.37' into for-2.6.38 2010-11-23 14:30:41 +00:00
Axel Lin 24fb2b1174 ASoC: wm8994 - fix memory leaks
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-23 14:30:12 +00:00
Axel Lin cd70978cb5 ASoC: wm8904 - fix memory leaks
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-23 14:30:00 +00:00
Axel Lin bc5954f00e ASoC: max98088 - fix a memory leak
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-23 14:29:51 +00:00
Axel Lin 7a479b0284 ASoC: Do not update the cache if write to hardware failed
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-11-23 14:29:11 +00:00
Takashi Iwai 2ab46c9390 Merge branch 'for-2.6.38' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc
Conflicts:
	sound/soc/codecs/tpa6130a2.c
2010-11-23 12:45:05 +01:00
Mark Brown cbe80def41 Merge branch 'for-2.6.37' into for-2.6.38 2010-11-22 20:33:12 +00:00
Axel Lin c7b642911e ASoC: Fix a memory leak in alc5623_i2c_probe 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-11-22 20:31:14 +00:00
Mark Brown eba19fdd81 ASoC: Restore WM8994 volatile and readable register operations
They went AWOL during the multi-component merge.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-22 20:30:04 +00:00
Mark Brown f71a4734b1 ASoC: Fix multi-component mismerge in WM8523
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-22 20:27:49 +00:00
Jarkko Nikula 0d911baebf ASoC: Do not include soc-dai.h
There is no need to include soc-dai.h since soc.h includes it. Convert
drivers to include only soc.h.

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:53 +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
Jarkko Nikula 1c8f2c4287 ASoC: Fix compile breakage in jz4740.c and smartq_wm8987.c
Commit ce6120c require that soc-dapm.h cannot be included before soc.h but
these two drivers were not checked. Fix them by including only soc.h as it
includes soc-dapm.h.

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:05 +00:00
Axel Lin 13a2e06c58 ASoC: stac9766 - set reg_cache_default to stac9766_reg
Looks like 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-22 14:03:35 +00:00
Axel Lin 5b3b0fa8fb ASoC: Move kfree(twl4030) to twl4030_soc_remove()
As we allocate memory for twl4030 in twl4030_codec_probe(),
twl4030_codec_remove() is a better place to free the memory.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-19 12:14:47 +00:00
Mark Brown 04af964f9c Merge branch 'for-2.6.37' into for-2.6.38 2010-11-19 11:45:05 +00:00
Mark Brown 7b306dae22 ASoC: Move WM8994 read/write access data into separate file
Makes the WM8994 driver file itself substantially smaller.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-11-19 11:44:41 +00:00
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