Commit graph

4405 commits

Author SHA1 Message Date
Mark Brown a8035c8f04 ASoC: Shuffle WM8731 SPI and I2C device registration
This is a pure code motion patch intended to improve reviewability of a
following patch moving WM8731 to use more standard device registration.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-18 11:25:48 +00:00
Mark Brown 7ee7538041 ASoC: Rename AT91SAMG20-EK for applications
This is a bit more idiomatic and makes identifying a configuration
based on the board type work better.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-18 11:25:23 +00:00
Mark Brown 5de7f9b200 ASoC: Actively manage MCLK for AT91SAM9G20-EK
We have software control of the MCLK for the WM8731 so save a bit of
power by actively managing it within the machine driver, enabling it
only while the codec is active.

Once ASoC supports multiple boards and doesn't require the soc-audio
device the initial clock setup should be pushed down into the arch/arm
code but for now this reduces merge issues.

Tested-by: Sedji Gaouaou <sedji.gaouaou@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-18 11:25:23 +00:00
Mark Brown 40135ea071 ASoC: Check machine type before loading on AT91SAM9G20-EK
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-18 11:25:22 +00:00
Mark Brown d694354115 ASoC: Improve diagnostics for AT91SAM9G20-EK probe
We should display an error by default if we fail to register.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-18 11:25:21 +00:00
Mark Brown 22d22ee514 ASoC: Clean up WM8731 bias level configuration
The WM8731 bias level configuration function was written slightly
obscurely - streamline the code a little and refresh the comments.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-17 14:29:54 +00:00
Mark Brown 7b317b692a ASoC: Remove version display from the WM8731 driver
It makes boot a bit more noisy and I never remember to update it.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-17 14:29:54 +00:00
Paul Fertser 31b59cf9ce ASoC: Fix WM8753 DAIs unregistering
WM8753 uses a tricky way to switch DAIs "on the fly", for that it
registers 2 dummy DAIs and substitutes them depending on mixer control.

List element of registered dummy DAIs should be preserved to allow
unregistering of DAIs on module unload.

Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-17 14:29:54 +00:00
Kevin Hilman bf3dbe5c8c ASoC: Fix DaVinci module unload error
Fix for the error when the audio module is unloaded.  On unregistering
the platform_device, platform_device_release will free the platform
data.If platform data is static the kernel panics when it is freed.
Instead use the platform device helper function to add data.

This change has been tested on DM644x EVM, DM644x SFFSDR and DM355 EVM.

Signed-off-by: Chaithrika U S <chaithrika@ti.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-13 20:21:30 +00:00
Takashi Iwai f1464ede55 Merge branch 'for-2.6.30' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6 into topic/asoc 2009-02-13 15:10:35 +01:00
Mark Brown c85e5a4161 Merge branch 'for-2.6.29' into for-2.6.30 2009-02-13 14:02:08 +00:00
Mark Brown 14fa43f53f ASoC: Only register AC97 bus if it's not done already
ASoC supports both explicit codec drivers for AC97 devices and a simple
driver which uses the standard ALSA AC97 framework for codec support.
When used with the generic AC97 codec support that will provide the
ad hoc AC97 device for drivers like touchscreens to attach to so the
core shouldn't do so.

Reported-by: Manuel Lauss <mano@roarinelk.homelinux.net>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-13 13:50:22 +00:00
Timur Tabi d5e9ba1d58 ASoC: add additional controls to the CS4270 codec driver
Update the CS4270 codec driver to allow applications to use the mixer to
control Digital Loopback, Soft Ramp, Zero Cross, Popguard, and Auto-Mute.
Soft Ramp, Zero Cross, and Auto-Mute are disabled by the driver when it first
initializes the hardware, but these features either don't work or interfere
with normal ALSA behavior.  However, they can now be re-enabled by an
application if desired.

Remove CONFIG_SND_SOC_CS4270_HWMUTE and always allow ASoC to control the mute
bits.  The driver previously and erroneously assumed that these bits
control only external muting circuitry, but they also control internal
muting circuitry, so they should always be used.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-13 13:32:51 +00:00
Takashi Iwai 9e30d7718b ASoC: Fix forgotten replacements of socdev->codec
The snd_soc_codec was moved into socdev->card, but this change wasn't
applied in some places.  Fixed now.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-11 08:28:04 +01:00
Mark Brown 9e32ebdb3a Merge branch 'for-2.6.29' into for-2.6.30 2009-02-10 21:37:01 +00:00
Lopez Cruz, Misael 272edb0049 ASoC: Update SDP3430 machine driver for snd_soc_card
This patch replaces "snd_soc_machine" structure by "snd_soc_card" in
SP3430 driver. This change is needed in SDP3430 driver to reflect
changes introduced by "ASoC: Rename snd_soc_card to snd_soc_machine" patch
(875065491f).

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-10 21:36:27 +00:00
Jarkko Nikula 7565fc38cc ASoC: TLV320AIC3X: Add TLV information for volume controls
TLV320AIC3X volume controls are logarithmic. Export their dB ranges.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-09 18:27:59 +00:00
Jarkko Nikula b93f74f604 ASoC: TLV320AIC3X: Fix volume ranges
This is a minor fix but helps to define dB ranges for volume controls.

Only DAC digital volume has full register value range from 0 to 127 but
ADC PGA gain and output stage volume controls don't.

For ADC PGA, maximum value is 119 and then it saturates to the same
gain value of 59.5 dB. For output stages, value 117 corresponds to -78.3 dB
and is muted for values 118 and above.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-09 18:27:59 +00:00
Philipp Zabel 44dd2b9168 ASoC: pxa2xx-i2s: remove I2S pin setup
This removes the calls to pxa_gpio_mode from the pxa2xx-i2s driver.
Pin setup should be done during board init via pxa2xx_mfp_config
instead.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Acked-by: Eric Miao <eric.miao@marvell.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-08 20:40:26 +00:00
Roel Kluin 67137a5d46 ASoC: count reaches 10001, not 10000.
With a postfix increment count reaches 10001, not 10000.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-08 20:40:24 +00:00
Robert Jarzmik 8f0dc655f9 ASoC: Add initial support of Mitac mioa701 device SoC.
This machine driver enables sound functions on Mitac mio
a701 smartphone. Build upon ASoC v1, it handles :
 - rear speaker
 - front speaker
 - microphone
 - GSM

A global "Mio Mode" switch is not yet provided to cope with
audio path setup. As balance on audio chip line is no more
assured, an incorrect setup can produce a lot of heat and
even fry the battery behind the wm9713 and the speaker
amplifier.

It doesn't cope with :
 - headset jack
 - mio master mode
 - master volume control

This driver is backported from ASoc v2, and amputated from
scenario setups and master volume control.

[Minor mods for terminology in comments -- broonie]

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-08 20:39:46 +00:00
Mark Brown e255265b47 Merge branch 'for-2.6.29' into for-2.6.30 2009-02-06 14:19:45 +00:00
Timur Tabi 85ef2375ef ASoC: optimize init sequence of Freescale MPC8610 sound drivers
In the Freescale MPC8610 sound drivers, relocate all code from the _prepare
functions into the corresponding _hw_params functions.  These drivers assumed
that the sample size is known in the _prepare function and not in the
_hw_params function, but this is not true.

Move the code in fsl_dma_prepare() into fsl_dma_hw_param().  Create
fsl_ssi_hw_params() and move the code from fsl_ssi_prepare() into it.

Turn off snooping for DMA operations to/from I/O registers, since that's not
necessary.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-06 12:08:15 +00:00
Mike Frysinger 8836c273e4 ASoC: Blackfin: drop unnecessary dma casts
Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-06 12:07:39 +00:00
Mike Frysinger 92a950ff2b ASoC: Blackfin: cleanup sport handling in ASoC Blackfin AC97 code
- make sport number handling more dynamic as not all
  Blackfins have a linear sport map starting at 0
- indexes can be macroed away too

Signed-off-by: Mike Frysinger <vapier.adi@gmail.com>
Signed-off-by: Cliff Cai <cliff.cai@analog.com>
Signed-off-by: Bryan Wu <cooloney@kernel.org>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-06 12:07:29 +00:00
Jarkko Nikula 397d5aeeb5 ASoC: WM8990: Fix kcontrol's private value use in put callback
Function wm899x_outpga_put_volsw_vu misuses the kcontrol's private value
by still accessing it as bitfields even SOC_SINGLE_VALUE constructs it
as a pointer into struct soc_mixer_control after the commit
4eaa9819dc.

This is very similar fix than fix to TLV320AIC3X codec made by
Eero Nurkkala <ext-eero.nurkkala@nokia.com>. This fix is compile tested
only.

Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-06 11:39:28 +00:00
Eero Nurkkala 4453dba54d ASoC: TLV320AIC3X: Fix kcontrol's private value use in put callback
Function snd_soc_dapm_put_volsw_aic3x misuses the kcontrol's private value
by still accessing it as bitfields even SOC_SINGLE_VALUE constructs it
as a pointer into struct soc_mixer_control after the commit
4eaa9819dc.

This was causing arbitrary register writes when touching the controls
defined with SOC_DAPM_SINGLE_AIC3X.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-06 11:39:28 +00:00
Philipp Zabel 0664678a84 ASoC: pxa-ssp: fix SSP port request
PXA2xx/3xx SSP ports start from 1, not 0. Thus, the probe function
requested the wrong SSP port. Correcting this unveiled another bug
where ssp_init tries to request the already-requested SSP port again.
So this patch replaces the ssp_init/exit calls with their internals
from mach-pxa/ssp.c, leaving out the redundant ssp_request and the
unneeded IRQ request. Effectively, that leaves us with not much more
than enabling/disabling the SSP clock.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-04 13:17:22 +00:00
Philipp Zabel 5b2474425e ASoC: uda1380: split set_dai_fmt into _both, _playback and _capture variants
This patch splits set_dai_fmt into three variants (single interface,
dual interface playback only, dual interface capture only) so that
data input and output formats can be configured separately for dual
interface setups.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Tested-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-04 13:15:15 +00:00
Vasily Khoruzhick 111f6fbeb7 ASoC: Don't unconditionally use the PLL in UDA1380
Without this fix driver switches to WSPLL in uda1380_pcm_prepare
even if SYSCLK was chosen (uda1380_pcm_prepare modifies UDA1380_CLK
register to disable R00_DAC_CLK before flushing reg cache)

Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-03 17:12:16 +00:00
Takashi Iwai 395707212a Merge branch 'fix/asoc' into topic/asoc 2009-02-03 07:07:15 +01:00
Liam Girdwood 64ca0404ee ALSA: ASoC: email - update email addresses.
This just updates my email address on some drivers I'd forgotten in a
previous patch.

Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-02-03 07:05:23 +01:00
Timur Tabi a6c255e094 ASoC: fix message display in CS4270 codec driver
Replace printk calls with dev_xxx calls.  Set the 'dev' field of the codec
and codec_dai structures so that these calls work.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-02 21:34:06 +00:00
Timur Tabi d9fb7fbddc ASoC: fix build break in CS4270 codec driver
Fix a oversight in the CS4270 codec driver that caused a build break.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-02 21:34:05 +00:00
Mark Brown e50a7ea0eb Merge branch 'for-2.6.29' into for-2.6.30 2009-02-02 12:46:51 +00:00
Eero Nurkkala 21dff43456 OMAP: ASoC: Fix spinlock misuse in omap-pcm.c
omap_pcm_trigger is called also in interrupt context so CPU flags must
be restored when returning.

Signed-off-by: Eero Nurkkala <ext-eero.nurkkala@nokia.com>
Acked-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-02-02 12:41:25 +00:00
Grazvydas Ignotas 8f00806294 ASoC: Update OMAP3 pandora board file
Update pandora board file for recent TWL4030 codec changes.
Also move output related snd_soc_dapm_nc_pin() calls to
omap3pandora_out_init(), where they belong.

Signed-off-by: Grazvydas Ignotas <notasas@gmail.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-31 14:59:19 +00:00
Timur Tabi ff7bf02f63 ASoC: fix documentation in CS4270 codec driver
Spruce up the documentation in the CS4270 codec.  Use kerneldoc where
appropriate.  Fix incorrect comments.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-31 14:59:08 +00:00
Timur Tabi 04eb093c7c ASoC: fix initialization order of the CS4270 codec driver
ASoC codec drivers typically serve two masters: the I2C bus and ASoC itself.
When a codec driver registers with ASoC, a probe function is called.  Most
codec drivers call ASoC first, and then register with the I2C bus in the ASoC
probe function.

However, in order to support multiple codecs on one board, it's easier if the
codec driver is probed via the I2C bus first.  This is because the call to
i2c_add_driver() can result in the I2C probe function being called multiple
times - once for each codec.  In the current design, the driver registers
once with ASoC, and in the ASoC probe function, it calls i2c_add_driver().
The results in the I2C probe function being called multiple times before the
driver can register with ASoC again.

The new design has the driver call i2c_add_driver() first.  In the I2C probe
function, the driver registers with ASoC.  This allows the ASoC probe function
to be called once per I2C device.

Also add code to check if the I2C probe function is called more than once,
since that is not supported with the current ASoC design.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-30 11:58:50 +00:00
Peter Ujfalusi 7393958f63 ASoC: TWL4030: Add analog loopback support
This patch adds the analog loopback/bypass support for twl4030 codec.

Details for the implementation:
It seams that the analog loopback needs the DAC powered on on the channel,
where the loopback is selected. The switch for the DACs has been moved from
the DAPM_DAC to the "Analog XX Playback Mixer". In this way the DAC will be
powered while the audio playback is used or/and the loopback is enabled for
the channel.

The twl4030 codec powering has been reworked. Now the codec will be powered as
long as it does not receives the SND_SOC_BIAS_OFF event. The exceptions are
when the given change in the registers needs the codec power down/up cycle in
order to take effect. Otherwise the codec is on.

When the codec enters to STANDBY state and none of the loopback paths are
enabled, than the amplifiers, which are no in the DAPM path are forced to turn
off and the PLL is disabled. When playback/capture starts the disabled gains
are restored and the PLL is enabled.

When one of the loopback enabled in STANDBY mode, the disabled gains are
restored and the PLL is enabled also.

In short: the codec always goes to the lowest power state based on the
bias_level and the bypass_state.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-29 13:58:04 +00:00
Mark Brown 0bf5460de9 Merge branch 'for-2.6.29' into for-2.6.30 2009-01-29 13:57:59 +00:00
Misael Lopez Cruz ef390c0b6e ASoC: OMAP: Initialize XCCR and RCCR registers in McBSP DAI driver
This patch explicitly initializes McBSP Transmit Configuration
Control Register (XCCR) and Receive Configuration Control
Register (RCCR) to their reset values. Reset values are 26 ns
of DX delay and Transmit DMA disabled for XCCR register;
receive full cycle mode enabled and Receive DMA disabled for
RCCR register.

This patch requires a counterpart in OMAP McBSP driver before
to apply it. The required changes in McBSP were sent and approved
in linux-omap mailing list and patch is going upstream
(commit 3127f8f859 from linux-omap-2.6
tree).

Signed-off-by: Misael Lopez Cruz <x0052729@ti.com>
[ jarkko.nikula@nokia.com: Commit id for counterpart patch corrected ]
Signed-off-by: Jarkko Nikula <jarkko.nikula@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-29 13:17:45 +00:00
Mark Brown 9e70c1f099 ASoC: Fix null string usage with WM8753 DAIs
The WM8753 driver multiplexes the DAI structures it exposes to the
outside world, leaving them uninitialised until the codec probes.  Since
the DAI name is used during the registration and setup process provide a
dummy name.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-29 13:14:21 +00:00
Takashi Iwai 67fcdead3c Merge branch 'topic/snd_card_new-err' into topic/asoc
Conflicts:
	sound/soc/soc-core.c
2009-01-28 08:08:32 +01:00
Peter Ujfalusi 006f367e38 ASoC: TWL4030: Move the twl4030_power_up and _power_down function
Move the twl4030_power_up and twl4030_power_down function
earlier to facilitate the analog bypass implementation.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27 10:43:02 +00:00
Peter Ujfalusi fb2a2f8490 ASoC: TWL4030: Physical ADC and amplifier power switch change
Change the power switches for the physical ADC and for the
amplifiers for the analog capture path to map more closely
the actual path inside of the codec.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27 10:43:02 +00:00
Peter Ujfalusi aad749e51a ASoC: TWL4030: Enable Headset Left anti-pop/bias ramp only if the Headset Left is in use
The Headset Left anti-pop and bias ramp does not need to be
enabled, if the headset is not in use.
Move the code to DAPM event handler for HeadsetL.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27 10:42:40 +00:00
Peter Ujfalusi db04e2c58a ASoC: TWL4030: Code clean up for codec power up and down
Merge the codec up and down functions to a simple one.
Codec is powered down by default (reg_cache change).

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27 10:42:39 +00:00
Peter Ujfalusi 3fc93030e5 ASoC: TWL4030: Syncronize the reg_cache for ANAMICL after the offset cancelation
The offset cancelation bit in ANAMICL register is self cleanig.
Make sure that the reg_cache holds the same value as the HW
register.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27 10:42:39 +00:00
Mark Brown 6627a653bc ASoC: Push the codec runtime storage into the card structure
This is a further stage on the road to refactoring away the ASoC
platform device.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-01-27 10:30:54 +00:00