Commit graph

1163 commits

Author SHA1 Message Date
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
Axel Lin c555b028f1 ASoC: wm8727: add a missing return in wm8727_platform_probe
otherwise the error path will always be executed.

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:18 +01:00
Peter Ujfalusi 27eeb1feed ASoC: TWL4030: DAC power optimization
Restructure the DAPM connections in order to enable
only the needed DAC (out of four in twl4030 series).
I need to keep the 'AIF Enable' supply connected to
the L2/R2 digital path, since the digital loopback
needs AIF and APLL running.
If no valid route available, than none of the DAC will
be powered, but the AIF and APLL is going to be enabled.
Furthermore, if only one audio path have valid route,
than only the corresponding DAC will be powered.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsomicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-13 11:30:12 +01:00
Peter Ujfalusi 8b0d31532e ASoC: TWL4030: Fix for digital loopback gain range
When the gain is configured using dB value it was
not possible to use -24dB since the loopback got
muted instead of -24dB.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Acked-by: Mark Brown <broonie@opensource.wolfsomicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-13 11:30:05 +01:00
Mark Brown 66b47fdb85 ASoC: Implement WM8994 OPCLK support
The WM8994 can output a clock derived from its internal SYSCLK, called
OPCLK.  The rate can be selected as a sysclk, with a division from the
SYSCLK rate specified (multiplied by 10 since a division of 5.5 is
supported) and the clock can be disabled by specifying a divisor of
zero.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-09 08:50:12 +09:00
Mark Brown e88ff1e6db ASoC: Include WM8994 GPIO and interrupt registers in codec_reg
Very handy for debug.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-09 01:37:06 +09:00
Mark Brown db059c0f6e ASoC: Automatically manage ALC coefficients for WM8960
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-06 08:46:10 +09:00
Mark Brown afd6d36a0d ASoC: Automatically manage DAC deemphasis rate for WM8960
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-05 23:41:18 +09:00
Mark Brown 4faaa8d968 ASoC: Remove current WM8960 deemphasis control
It will be replaced with automatic deemphasis rate configuration but since
we have an enumeration table in this driver this is done in a separate
commit to make the renumbering of the enumeration items clear.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-07-05 23:37:17 +09:00
Maurus Cuelenaere 0d9c15e45b ASoC: codec: Add WM8987 device id to WM8750 driver
The WM8987 codec is register compatible with the WM8750, so just add it to the
SPI and I²C device table.

Signed-off-by: Maurus Cuelenaere <mcuelenaere@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-04 18:02:07 +09:00
Kuninori Morimoto a300de3cff ASoC: ak4642: Add Digital Playback Volume control
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-07-01 17:08:47 +01:00
Vladimir Zapolskiy 338de9d9da ASoC: uda134x: correct bias level setup for codecs family
For UDA1341 codec power control is managed in STATUS1 register, and
for all other codecs in DATA011 register.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-06-30 14:46:56 +01:00
Vladimir Zapolskiy ed632ad3b8 ASoC: uda134x: add DATA011 register found in codecs family
In UDA1340, UDA1344 and UDA1345 codecs there is one more functional
register in part of DATA0 tranfser. For UDA1341 this register
coincides with EA register.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-06-30 14:46:56 +01:00
Mark Brown af51b5c0f0 Merge remote branch 'takashi/topic/asoc' into for-2.6.36 2010-06-30 14:46:53 +01:00
Vladimir Zapolskiy e4295b40ee ASoC: uda134x: fix bias level setup on initialization
On initialization ADC/DAC are enabled only for UDA1341, that's why
bias_level shall be set to off explicitly, otherwise dapm is
misinformed about bias_level on startup.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-06-25 12:29:02 +01:00
Vladimir Zapolskiy cc3202f5da ASoC: uda134x: replace a macro with a value in platform struct.
This change wipes out a hardcoded macro, which enables codec bias
level control. Now is_powered_on_standby value shall be used instead.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-06-25 12:29:01 +01:00
Takashi Iwai e827e32efc Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2010-06-24 11:11:41 +02:00
Eric Bénard 3d5a451623 codecs/tlv320aic23: fix bias management for suspend/resume
in tlv320aic23_set_bias_level, for the case SND_SOC_BIAS_ON, the
comment says "vref/mid, osc on, dac unmute" but the code doesn't
clear the corresponding bits, thus when resuming, several bits are
not cleared preventing the codec from working.

in tlv320aic23_suspend, clearing the active register is not needed
as it will be done by tlv320aic23_set_bias_level, when setting
bias to SND_SOC_BIAS_OFF

Signed-off-by: Eric Bénard <eric@eukrea.com>
Cc: broonie@opensource.wolfsonmicro.com
Cc: anuj.aggarwal@ti.com
Cc: lrg@slimlogic.co.uk
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-06-23 11:28:53 +01:00
Lars-Peter Clausen 3b097d64ea ASoC: Add JZ4740 codec driver
This patch adds support for the JZ4740 internal codec.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-06-23 00:10:45 +01:00
Mark Brown b45416656f ASoC: Fix sorting of DA7210 entries in Kconfig
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-06-20 14:05:46 +01:00
Mark Brown e71fa37042 ASoC: Default WM2000 ANC and speaker to enabled
The most useful configuration for the WM2000 is to enable the ANC so turn
that on by default, and since we're not reflecting chip default state also
enable the speaker output by default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-06-15 15:14:00 +01:00
Kuninori Morimoto 1a01eff1b2 ASoC: header cleanup for da7210
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-06-15 11:30:38 +01:00
Kuninori Morimoto 3367e452d9 ASoC: header cleanup for ak4642
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-06-15 11:30:37 +01:00
Peter Ujfalusi 9d7db2b2cb ASoC: tlv320dac33: Add support for changing upper threshold
Upper threshold is used in mode7 of DAC33.
Instead of hard wired UTHR, add control to change the upper threshold
value.
Changing upper threshold is not allowed when the playback is already
running, since wrongly timed change in the UTHR can cause problems
with the codec.
With this control the length of the burst in mode7 can be changed.

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-06-07 10:43:35 +01:00
Takashi Iwai 1fab79b8a1 Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into topic/asoc 2010-05-31 18:13:20 +02:00
Takashi Iwai c876ae3eb2 Merge branch 'for-2.6.36' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2010-05-31 18:12:41 +02:00
Mark Brown 37a5ddf450 ASoC: Fix S/PDIF build
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-31 13:47:26 +01:00
apatard@mandriva.com 72ed5a8c9b ASoC: Add driver for cs42l51
This patch is adding a ASoC driver for the cs42l51 from Cirrus Logic.
Master mode and spi mode are not supported.

Signed-off-by: Arnaud Patard <apatard@mandriva.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.ul>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-31 12:20:02 +01:00
Seungwhan Youn 3a642915ad ASoC: spdif: Add codec driver to use spdif stand-alone
This patch adds spdif dummy codec driver for using spdif-dit as
a stand-alone. Until this, spdif-dit can be used only with other
codecs like tlv320aci3x in davinci platform.

Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-31 12:08:33 +01:00
Peter Ujfalusi a3a29b55c7 ASoC: TWL4030: Add functionalty to reset the registers
Machine driver can instruct the codec driver to reset the
chip registers to their default values at probe time.

If machine driver does not provide setup data, then the
registers are going to be reseted to their defaults, to
be safe.

If the developer on the platform confirms that the register
reset is not needed, than it can be skipped, saving ~20ms
time in probe.

As safety measure do the register reset at remove time also.

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-05-31 11:08:59 +01:00
Peter Ujfalusi 2046f175bc ASoC: TWL4030: Use BIAS_OFF instead of BIAS_STANDBY, when not in use
Restructure the codec power code in order to be able to hit
off when the codec is not in use.

Since the audio registers are accessible while the codec is powered
down, there is no need for additional safety mechanism.

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-05-31 11:08:58 +01:00
Peter Ujfalusi 3c36cc688e ASoC: TWL4030: Correct the ARXR2_APGA_CTL chip default
It seams at least on twl5031 that the ARXR2_APGA_CTL register
does not have the same default value as it is written in
the TRM.
Since the codec part of the PM chip has not been actually
changed according to TI, assuming, that all version has
the same problem, so writing there the TRM value.

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-05-31 11:08:58 +01:00
Peter Ujfalusi 9fdcc0f72a ASoC: TWL4030: Helper to check chip default registers
Since the twl4030 codec driver supports different version
of the PM chip, a helper function can come handy, which
can check the driver's default versus the chip values.

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-05-31 11:08:58 +01:00
Peter Ujfalusi ee4ccac7ce ASoC: TWL4030: Optimize the power up sequence
Since the reg cache now contains the chip default values
for all registers (REG_OPTION is reset to it's default
within this patch), there is no longer need to rewrite
_all_ registers.
Initialize only few selected registers.

According to the latest information, the offset cancellation
need to be done only once, when the codec is powered on, so
there is no need for the power up wrapper.

Move all chip initialization code under chip_init, and do
it when the codec is initialized.

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-05-31 11:08:58 +01:00
Peter Ujfalusi 979bb1f4b8 ASoC: TWL4030: Make offset cancellation path configurable
Add means for machine drivers to select the path for offset
cancellation.
Reset the reg cache value to the chip reset value at the
same time.

Machine drivers can specify which path need to be used for
offset cancellation via the twl4030_setup.offset_cncl_path.
For paths use the defines from
include/linux/mfd/twl4030-codec.h:
TWL4030_OFFSET_CNCL_SEL_*

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-05-31 11:08:58 +01:00
Peter Ujfalusi cbd2db128f ASoC: TWL4030: Remove wrapper for power down
There is no need for the power down wrapper.

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-05-31 11:08:58 +01:00
Peter Ujfalusi 33f92ed4b3 ASoC: TWL4030: Revisit codec defaults
Reset most of the codec registers to their chip reset
value.

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-05-31 11:08:58 +01:00
Mark Brown e37c83c06c Merge commit 'v2.6.35-rc1' into for-2.6.36 2010-05-31 11:07:15 +01:00
Takashi Iwai 274a24c16f Merge branch 'for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into fix/asoc 2010-05-27 09:46:10 +02:00
Mark Brown f68596c6d8 ASoC: Fix dB scales for WM8990
These should be regular, not linear.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2010-05-26 08:46:53 -07:00
Mark Brown 3351e9fbb0 ASoC: Fix dB scales for WM8400
These scales should be regular, not linear.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2010-05-26 08:46:52 -07:00
Mark Brown e6a08c5a89 ASoC: Fix dB scales for WM835x
These should be regular rather than linear scales.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Cc: stable@kernel.org
2010-05-26 08:46:51 -07:00
Mark Brown 021f80cc70 ASoC: Fix dB scales for WM8990
These should be regular, not linear.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2010-05-25 15:35:21 -07:00
Mark Brown 9cd8bd8a2c ASoC: Fix dB scales for WM8400
These scales should be regular, not linear.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2010-05-25 15:35:19 -07:00
Mark Brown 52e39d22c8 ASoC: Fix dB scales for WM835x
These should be regular rather than linear scales.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
2010-05-25 15:35:18 -07:00
Mark Brown bd73fc76f7 ASoC: Remove version display from WM8990
It's not needed and the version number never gets updated anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-25 11:31:22 -07:00
Barry Song fab90aa4cf ASoC: ad193x: add set_sysclk entry to support different clock input
Signed-off-by: Barry Song <21cnbao@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-05-21 09:23:49 -07:00
Jorge Eduardo Candelaria 44ebaa5de1 ASoC: TWL6040: Fix playback with 19.2 Mhz MCLK
When using MCLK is configured for 19.2 Mhz, clock slicer should be
enabled and HPPLL should be bypassed in clock path.

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-05-21 10:47:25 +01:00
Takashi Iwai d71f4cece4 Merge branch 'topic/asoc' into for-linus
Conflicts:
	sound/soc/codecs/ad1938.c
2010-05-20 12:00:43 +02:00
Jarkko Nikula ad8332c130 ASoC: tpa6130a2: Remove CPVSS and HPVdd supplies
These pins are for decoupling capacitors for the internal charge pumps
in TPA6130A2 and TPA6140A2 and not for connecting external supply.

Thanks to Eduardo Valentin <eduardo.valentin@nokia.com> for pointing out the
issue with TPA6130A2 and Ilkka Koskinen <ilkka.koskinen@nokia.com> with
TPA6140A2.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Acked-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Reviewed-by: Ilkka Koskinen <ilkka.koskinen@nokia.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-20 10:28:39 +01:00
Jarkko Nikula 266d38c8e3 ASoC: tpa6130a2: Define output pins with SND_SOC_DAPM_OUTPUT
Codec output pin should be defined with SND_SOC_DAPM_OUTPUT as otherwise
external widgets doesn't alter the output state.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>
Cc: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-19 16:38:03 +01:00
Jorge Eduardo Candelaria 871a05a78b ASoC: TWL6040: Enable earphone path in codec
Add control to enable earphone driver in TWL6040 codec. This driver
is connected to HSDAC Left.

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-05-19 14:07:23 +01:00
Peter Ujfalusi 2d4cdd6fc9 ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF
Avoid calling the dac33_hard_power when the codec was
already in BIAS_OFF state.
This could happen in device suspend and module removal
time.

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-05-17 20:34:15 +01:00
Felipe Balbi 7fd1d74bfc ASoC: tlv320dac33: Use dev_dbg in dac33_hard_power function
Since the cases when the same power state would be set again
handled gracefully, we do not need to use dev_warn.

Signed-off-by: Felipe Balbi <felipe.balbi@nokia.com>
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-05-17 20:34:10 +01:00
Peter Ujfalusi 36aeff6146 ASoC: TWL4030: Add control for digimic Left Right swap
The codec has support for swapping the left and right
channels in the digimic interface.
New kcontrol to handle this bit.

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-05-12 09:58:26 +01:00
Mark Brown 6a2f1ee1f9 ASoC: Don't restart unconfigured WM8994 FLLs
If the FLL is not configured attempting to resume it will produce a
warning message so skip the resume.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-11 14:18:52 +01:00
Mark Brown 6adb26bd03 ASoC: Reorder power down sequence for WM hubs devices
Disable the output stage prior to the delay stage rather than the
other way around. Fixes merge issue with previous headphone output
path corrections.

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

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-11 14:18:34 +01:00
Mark Brown fd5722e5cd ASoC: Add register write logging for WM8994
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-11 14:18:18 +01:00
Mark Brown 896060c76b ASoC: Use more idiomatic driver name for WM8731
Make dev_() prints much prettier.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-10 11:04:34 +01:00
Mark Brown 06ae99888e ASoC: Refactor WM8731 regulator management into bias management
This allows more flexible integration with subsystem features.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-05-10 11:04:22 +01:00
Mark Brown 29e189c29d ASoC: Remove unneeded suspend bias managment from CODEC drivers
The core will ensure that the device is in either STANDBY or OFF bias
before suspending, restoring the bias in the driver is unneeded. Some
drivers doing slightly more roundabout things have been left alone
for now.

Tested-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-05-10 10:35:25 +01:00
Peter Ujfalusi bd843edf81 ASoC: tpa6130a2: Fix for the custom kcontrol functions
Since the functions arre only used for volume register,
change their name, and also fix them to properly
handle the cases, when via soc core the volume is
limited.

Signed-off-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-05-07 16:42:40 +01:00
Peter Ujfalusi 826e962c46 Revert "ASoC: tpa6130a2: Support for limiting gain"
This reverts commit 6f3991152f.

Since core has now support for limiting the volume on controls this
patch is not needed.  Furthermore, this patch actually prevents the core
to set new volume on the TPA.

Signed-off-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-05-07 16:42:23 +01:00
Takashi Iwai aeb29a82de Merge branch 'for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2010-05-06 17:06:27 +02:00
Peter Ujfalusi 2f005471e2 ASoC: tlv320dac33: Use codec defaults for LOM/LOP and DAC power
Do not change the codec defaults for the following registers:
0x40, 0x41: Line output gains, do not use amplification
0x42: LOM/LOP Voltage hold, and selection
0x44: LOM inversion control

It has been found, that the values configured to these registers
can cause amplification, which can make the output of DAC33
distorted.

The codec reset values are considered safe in all environmnts.

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-05-06 14:58:29 +01:00
Peter Ujfalusi 6f3991152f ASoC: tpa6130a2: Support for limiting gain
Add support for platform dependent gain limiting on the
tpa6130a2 (and tpa6140a2) Headset 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-05-06 14:58:20 +01:00
Jarkko Nikula 5193d62f18 ASoC: tlv320aic3x: Add platform data and reset gpio handling
Handle the reset GPIO within the codec driver in order to follow
the startup protocol for the tlv320aic3x codecs.

Signed-off-by: Jarkko Nikula <jhnikula@gmail.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-05-06 14:58:02 +01:00
Peter Ujfalusi e5e5b31e8c ASoC: tpa6130a2: TLV mapping for tpa6140a2
Both tpa6130a2, and tpa6140a2 is supported by the
same driver, but the gain dB scaling is different on
the amplifiers.

Provide different mixer control for the chips with correct
TLV mapping.

User space will see:
"TPA6130A2 Headphone Playback Volume" in case of 6130
"TPA6140A2 Headphone Playback Volume" in case of 6140

The way machine drivers are using this amplifier remained
the same.

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-05-04 20:55:01 +01:00
Peter Ujfalusi ad05c03b1c ASoC: tlv320dac33: Support for turning off the codec
Let the codec to hit OFF instead of STANDBY, when there is no activity.
When the codec is off, than the associated regulator can be also turned
off (if the number of users on the regulator is 0).

After initialization, the codec remains in power off, it is only turned
on for reading the ID registers (also testing the regulators).

The codec power is enabled, when the codec is moving from BIAS_OFF
to BIAS_STANDBY.
The codec is turned off, when it hits BIAS_OFF.

There are few scenarios, which has to be taken care::
1. Analog bypass caused BIAS_OFF -> BIAS_ON
   We need to power on the codec, and do the chip init, but we does not
   need to execute the playback related configuration
2. Playback caused  BIAS_OFF -> BIAS_ON
   We need to power on the codec, and do the chip init, and also we need
   to execute the playback related configuration.
3. Playback start, while Analog bypass is on (BIAS_ON -> BIAS_ON)
   We need to execute the playback related configuration. The codec is
   already on.
4. Analog bypass enable, while playback (BIAS_ON -> BIAS_ON)
   Nothing need to be done.
5. Playback start withing soc power down timeout (BIAS_ON -> BIAS_ON)
   We need to execute the playback related configuration. The codec is
   still on.

Since the power up, and the codec init is optimized, the added overhead
in stream start is minimal.

Withing this patch, the hard_power function is now only doing what it
supposed to: only handle the powers, and GPIO reset line.
The codec initialization and state restore has been moved 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-05-03 12:55:54 +01:00
Peter Ujfalusi 0b61d2b9f2 ASoC: tlv320dac33: Manage a pointer for snd_pcm_substream in private structure
As a preparation for supporting codec to be turned off,
when we are in BIAS_STANDBY.

The substream must be easily available in other places than
pcm_* callbacks.

Manage a pointer in _startup, and _shutdown for this.

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-05-03 12:55:48 +01:00
Peter Ujfalusi 239fe55c7f ASoC: tlv320dac33: Revised module loading, and DAC33 ID read
Optimize the way how tlv320dac33 is powered uppon module and
soc initialization.
Also read the DAC33 ID registers, and update the reg_cache
to reflect it.

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-05-03 12:55:48 +01:00
Peter Ujfalusi ef909d6729 ASoC: tlv320dac33: Optimize power up, and restore
On power up we only need to initialize the codec, and
restore only registers, which are not in either in DAPM
nor in the playback start sequence.
These are mostly gain related 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-05-03 12:55:48 +01:00
Peter Ujfalusi 1b7c9afbfb ASoC: TWL4030: Remove OUTL/R outputs
OUTL/R are leftovers from the original driver, and they
are no longer needed.

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-05-03 12:47:30 +01:00
Peter Ujfalusi 7b4c734eea ASoC: TWL4030: AIF/APLL fix in DAPM domain
This patch orders the APLL and AIF power sequence in
case of HiFi (audio in TWL4030 terms) playback/capture.

We also need to make sure that the AIF is running during
playback/capture, when there is no valid DAPM route
available. For this purpose I introduce these virtual
widgets:
/* To have complete playback route all the time */
DAPM_OUTPUT("Virtual HiFi OUT") /* Will keep AIF/APLL enabled */

/* To have complete capture route all the time */
DAPM_INPUT("Virtual HiFi IN") /* Will keep AIF/APLL enabled */

/* To have complete playback route for the voice module */
DAPM_OUTPUT("Virtual Voice OUT") /* Will keep APLL enabled */

The DAPM_SUPPLY widgets for APLL and AIF are placed in a way,
that during any audio activity the needed configuration of AIF
and APLL will be enabled (playback, capture, analog loopback,
digital loopback, and voice activity).

The apll reference counting code has been lifted,
and modified from Liam Girdwood's earlier patch.

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-05-03 12:47:29 +01:00
Mark Brown 39b8eab7e7 ASoC: Add WM9090 amplifier driver
The WM9090 is a high performance low power audio subsystem, including
headphone and class D speaker drivers.

Note that this driver is a standalone CODEC driver and so is only
immediately suitable for use with the WM9090 as a standalone sound card
taking line inputs, or with a DAC with no software control.  The pending
ASoC multi-CODEC support will expand the range of systems that can use
the driver, or system-specific adaptations can be made.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-30 16:12:44 +01:00
Liam Girdwood cf134d5bfb ASoC: tlv320dac33 - disable regulators at i2c remove()
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-04-28 13:27:18 +01:00
Mark Brown dde3a7e9cb ASoC: Remove redundant WM8960 SYSCLKSEL clkdiv option
The SYSCLK source is automatically managed when configuring the PLL.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-28 11:33:04 +01:00
Takashi Iwai cb7b76961f Merge branch 'for-2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc-2.6 into topic/asoc 2010-04-27 15:35:59 +02:00
Jarkko Nikula 07779fdd1a ASoC: tlv320aic3x: Add basic regulator support
This patch adds the TLV320AIC3x supplies and enables all of them for the
entire lifetime of the device.

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-04-27 11:19:23 +01:00
Jarkko Nikula db13802e51 ASoC: tlv320aic3x: Change bias management semantics
Move PLL enable from BIAS_ON state to BIAS_PREPARE to be pair with
BIAS_STANDBY where PLL is disabled. Remove also old comments about power
control.

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-04-27 11:08:06 +01:00
Jarkko Nikula d3235c4ac1 ASoC: tlv320aic3x: Remove needless power off from aic3x_set_bias_level
These ADC, DAC and output pin power off commands are needless in
aic3x_set_bias_level since they are not enabled in aic3x_init and they are
defined in aic3x_dapm_widgets so the ASoC DAPM will take care of them
anyway.

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-04-27 11:08:06 +01:00
Jarkko Nikula c6de6e0300 ASoC: tlv320aic3x: Remove unused version string
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-04-27 11:08:05 +01:00
Vladimir Zapolskiy b28528a124 ASoC: UDA134X: Add UDA1345 CODEC support
This patch adds support for Philips UDA1345 CODEC. The CODEC has only
volume control, de-emphasis, mute, DC filtering and power control features.

Signed-off-by: Vladimir Zapolskiy <vzapolskiy@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-26 15:28:18 +01:00
Mark Brown 5e5e2bef28 ASoC: Warn on low WM8994 AIFCLK
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-26 15:26:13 +01:00
Mark Brown 759512fbac ASoC: Correct inversion of speaker mixer PCM switch
Reported-by: Anti Sullin <anti.sullin@artecdesign.ee>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-26 15:24:28 +01:00
Peter Ujfalusi f57d2cfaad ASoC: tlv320dac33: FIFO caused delay reporting
Delay reporting for the three implemented DAC33 FIFO modes.
DAC33 has FIFO depth status register(s), but it can not be used, since
inside of pcm_pointer we can not send I2C commands.
Timestamp based estimation need to be used. The method of calculating
the delay depends on the active FIFO mode.

Bypass mode: FIFO is bypassed, report 0 as delay

Mode1: nSample fill mode. In this mode I need to use two timestamp
ts1: taken when the interrupt has been received
ts2: taken before writing to nSample register.

Interrupts are coming when DAC33 FIFO depth goes under alarm threshold.

Phase1: when we received the alarm threshold, but our workqueue has
        not been executed (safeguard phase). Just count the played out
        samples since ts1 and subtract it from the alarm threshold
        value.
Phase2: During nSample burst (after writing to nSample register), count
        the played out samples since ts1, count the samples received
        since ts2 (in a burst). Estimate the FIFO depth using these and
        alarm threshold value.
Phase3: Draining phase (after the burst read), count the played out
        samples since ts1. Estimate the FIFO depth using the nSample
        configuration and the alarm threshold value.

Mode7: Threshold based fill mode. In this mode one timestamp is enough.
ts1: taken when the interrupt has been received

Interrupts are coming when DAC33 FIFO depth reaches upper threshold.

Phase1: Draining phase (after the burst), counting the played out
        samples since ts1, and subtract it from the upper threshold
        value.
Phase2: During burst operation. Using the pre calculated time needed to
        play out samples from the buffer during the drain period (from
        upper to lower threshold), move the time window to cover the
        estimated time from the burst start to the current time.
        Calculate the samples played out since lower threshold and also
        the samples received during the same time.

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-04-26 15:16:39 +01:00
Peter Ujfalusi 76f471274d ASoC: tlv320dac33: Calculate the interface speed during bursts
When the DAC33 FIFO is in use the dai interface is running in
much higher speed than the sampling frequency.
Calculate the rate based on the internal base frequency and
the bclk divider.

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-04-26 15:16:33 +01:00
Peter Ujfalusi 4260393e71 ASoC: tlv320dac33: Change magic numbers used in Mode7
Upper and Lower threshold values are used as magic
numbers. Replace them with defines for later use.

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-04-26 15:16:28 +01:00
Peter Ujfalusi 55abb59c9a ASoC: tlv320dac33: Skip calculations in FIFO Bypass mode
There is no need for calculations for FIFO bypass mode.
Just in case set the nsample maximum limit, which
has been done in the calculation phase.

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-04-26 15:16:23 +01:00
Peter Ujfalusi f4d5932806 ASoC: tlv320dac33: Fix for early interrupt in FIFO Mode1
Alarm threshold interrupt is triggered right after the
playback start.
This interrupt is recieved during the first burst period,
and caused the state machine to write additional nSample
command, which has to be avoided.
To fix this issue move the DAC33 interrupt unmasking
after we configured the PREFILL register with a small
delay.

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-04-26 15:16:18 +01:00
Barry Song ba0a24e738 ASoC: ad193x: fix typo, delete redundant space
Signed-off-by: Barry Song <21cnbao@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-23 16:14:57 +01:00
Barry Song d6bdc0f7fe ASoC: ad193x: fix wrong register setting in ad193x_set_dai_fmt
Signed-off-by: Barry Song <21cnbao@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-23 16:14:02 +01:00
Mark Brown 7add84aa77 ASoC: Allow unspecified source when stopping WM8994 FLLs
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-22 02:29:01 +09:00
Mark Brown ee839a2127 ASoC: Tone down debugging for WM8994 class W
It's a little verbose during path changes.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-21 01:41:28 +09:00
Mark Brown 7d48a6acbc ASoC: Set full range of WM8994 FLL Fratio values
Use all the available Fratio values when configuring the WM8994 FLL, not
just 0 and 3, following more complete characterisation of the device
performance.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-21 01:41:27 +09:00
Mark Brown 136ff2a272 ASoC: Support FLL input clock selection on WM8994
The WM8994 FLL can be clocked from one of four inputs, the two MCLKs and
the LRCLK and BCLK of the AIF associated with the FLL. Allow all four
inputs to be used rather than defaulting to MCLK1.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2010-04-21 01:41:26 +09:00
Phil Carmody 4f6f22d7be ASoC: da7210: Fencepost error in reg cache read
An index equal to the array size may not be accessed.

Signed-off-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Acked-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-04-21 01:41:26 +09:00
Takashi Iwai d4a8ca2461 ASoC: missing conversions to snd_soc_codec_*_drvdata()
Conversions to snd_soc_codec_{get|set}_drvdata() were missing in some files
in the previous commit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-20 08:29:19 +02:00
Mark Brown b2c812e22d ASoC: Add indirection for CODEC private data
One of the features of the multi CODEC work is that it embeds a struct
device in the CODEC to provide diagnostics via a sysfs class rather than
via the device tree, at which point it's much better to use the struct
device private data rather than having two places to store it. Provide
an accessor function to allow this change to be made more easily, and
update all the CODEC drivers are updated.

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

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
2010-04-17 10:46:22 +09:00
Mark Brown 890c681275 Merge branch 'for-2.6.34' into for-2.6.35 2010-04-17 10:45:54 +09:00