platform/kernel/linux-3.10.git
13 years agoASoC: core: Don't schedule deferred_resume_work twice
Stephen Warren [Wed, 25 May 2011 20:06:41 +0000 (14:06 -0600)]
ASoC: core: Don't schedule deferred_resume_work twice

For cards that have two or more DAIs, snd_soc_resume's loop over all
DAIs ends up calling schedule_work(deferred_resume_work) once per DAI.
Since this is the same work item each time, the 2nd and subsequent
calls return 0 (work item already queued), and trigger the dev_err
message below stating that a work item may have been lost.

Solve this by adjusting the loop to simply calculate whether to run the
resume work immediately or defer it, and then call schedule work (or not)
one time based on that.

Note: This has not been tested in mainline, but only in chromeos-2.6.38;
mainline doesn't support suspend/resume on Tegra, nor does the mainline
Tegra ASoC driver contain multiple DAIs. It has been compile-checked in
mainline.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Fix comment in cs4270 codec driver
Daniel Mack [Wed, 25 May 2011 07:53:12 +0000 (09:53 +0200)]
ASoC: Fix comment in cs4270 codec driver

The comment does not reflect reality anymore since the multi-component
monster patch landed. Things are matched by names now, and not by
exporting and referencing a struct. Fix it to avoid confusion.

Signed-off-by: Daniel Mack <zonque@gmail.com>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: davinci-pcm: comments for the conversion to BATCH mode
Ben Gardiner [Wed, 25 May 2011 13:27:22 +0000 (09:27 -0400)]
ASoC: davinci-pcm: comments for the conversion to BATCH mode

In the previous commit 'ASoC: davinci-pcm: convert to BATCH mode', the phase
offset of 2 was mentioned in the commit message but not well commented in the
source.

Add descriptive comments of the phase offset with and without ping-pong
buffers enabled.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: davinci-pcm: convert to BATCH mode
Ben Gardiner [Tue, 24 May 2011 18:50:20 +0000 (14:50 -0400)]
ASoC: davinci-pcm: convert to BATCH mode

The davinci-pcm driver's snd_pcm_ops pointer function currently calls into
the edma controller driver to read the current positions of the edma channels
to determine pos to return to the ALSA framework. In particular,
davinci_pcm_pointer() calls edma_get_position() and the latter has a comment
indicating that "Its channel should not be active when this is called" whereas
the channel is surely active when snd_pcm_ops.pointer is called.

The operation of davinci-pcm in capture and playback appears to follow close
the other pcm drivers who export SNDRV_PCM_INFO_BATCH except that davinci-pcm
does not report it's positions from pointer() using the last transferred
chunk. Instead it peeks directly into the edma controller to determine the
current position as discussed above.

Convert the davinci-pcm driver to BATCH mode: count the periods elapsed in the
prtd->period member and use its value to report the 'pos' to the alsa
framework in the davinci_pcm_pointer function.

There is a phase offset of 2 periods between the position used by dma setup
and the position reported in the pointer function. Either +2 in the dma
setup or -2 in the pointer function (with wrapping, both) accounts for this
offset -- I opted for the latter since it makes the first-time setup clearer.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Steven Faludi <stevenfaludi@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: davinci-pcm: extract period elapsed functions
Ben Gardiner [Tue, 24 May 2011 18:50:19 +0000 (14:50 -0400)]
ASoC: davinci-pcm: extract period elapsed functions

Extract functions that modify the prtd->period member in preparation for
conversion to BATCH mode playback.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Steven Faludi <stevenfaludi@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: davinci-pcm: fix audible glitch on 2nd ping-pong playback
Ben Gardiner [Tue, 24 May 2011 18:50:18 +0000 (14:50 -0400)]
ASoC: davinci-pcm: fix audible glitch on 2nd ping-pong playback

The release of the dma channels was being performed in prepare and there was a
edma_resume call for the asp-channel only being executed on START, RESUME and
PAUSE_RELEASE.

The mcasp on da850evm with ping-pong buffers enabled was exhibiting an audible
glitch on every playback after the first. It was determined through trial and
error that the following two changes fix this problem:

1) Move the edma_start calls from prepare to trigger and 2) reverse the order
of starting the asp and ram channels.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Steven Faludi <stevenfaludi@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: davinci-pcm: increase the maximum channels
Ben Gardiner [Tue, 24 May 2011 18:50:17 +0000 (14:50 -0400)]
ASoC: davinci-pcm: increase the maximum channels

Based on the registration of davinci-mcasp.1 in the davinci-evm platform
setup for da830 and dm6467, davinci-pcm can handle more than the currently
reported maximum channels of 2.

Increase the maximum channels to 384 to match the maximum reported by
davinci-mcasp.1.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Steven Faludi <stevenfaludi@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: davinci-pcm: expand the .formats
Ben Gardiner [Tue, 24 May 2011 18:50:16 +0000 (14:50 -0400)]
ASoC: davinci-pcm: expand the .formats

Based on the data_type test in ping_pong_dma_setup, davinci-pcm is capable of
handling data of width up to and including 32bits.

"
if ((data_type == 0) || (data_type > 4)) {
printk(KERN_ERR "%s: data_type=%i\n", __func__, data_type);
return -EINVAL;
}
"

Update the .format member of the snd_pcm_hardware instances it registers to
reflect this capability.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Steven Faludi <stevenfaludi@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: davinci-pcm: trivial: make ping-pong params setup symmetrical
Ben Gardiner [Tue, 24 May 2011 18:50:15 +0000 (14:50 -0400)]
ASoC: davinci-pcm: trivial: make ping-pong params setup symmetrical

The setup of the pong channel uses EDMA_CHAN_SLOT instead of & 0x3f as the
setup of the ping channel does.

Make the setup of ping and pong symmetric. There is no functional change
introduced by this patch.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: Steven Faludi <stevenfaludi@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: add fsi_hw_startup/shutdown
Kuninori Morimoto [Mon, 23 May 2011 11:46:26 +0000 (20:46 +0900)]
ASoC: sh: fsi: add fsi_hw_startup/shutdown

This patch is preparation of cleanup suspend/resume patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: cleanup suspend/resume
Kuninori Morimoto [Mon, 23 May 2011 11:46:35 +0000 (20:46 +0900)]
ASoC: sh: fsi: cleanup suspend/resume

Current FSI driver was using saved_xxx variable for suspend/resume.
OTOH, the start and stop of power/clock are controlled by
fsi_hw_startup/fsi_hw_shutdown in current FSI driver.
The all necessary registers value are set by fsi_hw_startup.

So, if fsi_hw_shutdown is called when "suspend" is generated,
and fsi_hw_startup is called at "resume",
the saved_xxx are not needed.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: remove fsi_module_init/kill
Kuninori Morimoto [Mon, 23 May 2011 11:46:30 +0000 (20:46 +0900)]
ASoC: sh: fsi: remove fsi_module_init/kill

FSIA/B ports is enabled by default when power-on,
and current FSI is supporting RuntimePM.
In addition, current fsi_module_init/kill doesn't care
simultaneous playback/recorde.
This mean FSI port control is not needed.
This patch remove fsi_module_init/kill

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: make sure fsi_stream_push/pop access by spin lock
Kuninori Morimoto [Mon, 23 May 2011 11:46:13 +0000 (20:46 +0900)]
ASoC: sh: fsi: make sure fsi_stream_push/pop access by spin lock

fsi_stream_push/pop might be called in same time.
This patch protect it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: remove pm_runtime from fsi_dai_set_fmt.
Kuninori Morimoto [Mon, 23 May 2011 11:46:07 +0000 (20:46 +0900)]
ASoC: sh: fsi: remove pm_runtime from fsi_dai_set_fmt.

pm_runtime_get/put_sync were used to access FSI register in fsi_dai_set_fmt
which is called when ALSA probe.
But this register value will disappear after pm_runtime_put_sync
if platform is supporting RuntimePM.
To solve this issue, this patch adds new variable for format,
and remove pm_runtime_get/put_sync from fsi_dai_set_fmt.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: tidyup unclear variable naming
Kuninori Morimoto [Mon, 23 May 2011 11:46:03 +0000 (20:46 +0900)]
ASoC: sh: fsi: tidyup unclear variable naming

Some variables on this driver were a unclear naming,
and were different unit (byte, frame, sample).
And some functions had wrong name
(ex. it returned "sample width" but name was "fsi_get_frame_width").
This patch tidy-up this issue, and the minimum unit become "sample".
Special thanks to Takashi YOSHII.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: irq control moves to fsi_port_start/stop
Kuninori Morimoto [Mon, 23 May 2011 11:46:23 +0000 (20:46 +0900)]
ASoC: sh: fsi: irq control moves to fsi_port_start/stop

Using fsi_irq_enable/disable in fsi_port_start/stop is very natural.
This patch is preparation of cleanup suspend/resume patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: add fsi_set_master_clk
Kuninori Morimoto [Mon, 23 May 2011 11:46:18 +0000 (20:46 +0900)]
ASoC: sh: fsi: add fsi_set_master_clk

Current FSI driver is using set_rate call back function which is for
master mode.
By this patch, it is used from fsi_set_master_clk.
This patch is preparation of cleanup suspend/resume patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: tidyup parameter of fsi_stream_push
Kuninori Morimoto [Mon, 23 May 2011 11:45:57 +0000 (20:45 +0900)]
ASoC: sh: fsi: tidyup parameter of fsi_stream_push

It is possible to create buff_len and period_len
from substream->runtime.
This patch is preparation of tidyup unclear variable naming patch.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Convert 16x16 write to use cpu_to_be16()
Mark Brown [Tue, 10 May 2011 23:02:35 +0000 (01:02 +0200)]
ASoC: Convert 16x16 write to use cpu_to_be16()

Make it clear what we're doing.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: soc-cache: Cache a pointer to the last accessed rbnode
Dimitris Papastamos [Thu, 19 May 2011 12:45:30 +0000 (13:45 +0100)]
ASoC: soc-cache: Cache a pointer to the last accessed rbnode

Whenever we are doing a read or a write through the rbtree code, we'll
cache a pointer to the rbnode.  To avoid looking up the register
everytime we do a read or a write, we first check if it can be found in
the cached register block, otherwise we traverse the rbtree and finally
cache the rbnode for future use.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: soc-cache: Block based rbtree compression
Dimitris Papastamos [Thu, 19 May 2011 12:45:29 +0000 (13:45 +0100)]
ASoC: soc-cache: Block based rbtree compression

This patch prepares the ground for the actual rbtree optimization patch
which will save a pointer to the last accessed rbnode that was used
in either the read() or write() functions.

Each rbnode manages a variable length block of registers.  There can be no
two nodes with overlapping blocks.  Each block has a base register and a
currently top register, all the other registers, if any, lie in between these
two and in ascending order.

The reasoning behind the construction of this rbtree is simple.  In the
snd_soc_rbtree_cache_init() function, we iterate over the register defaults
provided by the driver.  For each register value that is non-zero we
insert it in the rbtree.  In order to determine in which rbnode we need
to add the register, we first look if there is another register already
added that is adjacent to the one we are about to add.  If that is the case
we append it in that rbnode block, otherwise we create a new rbnode
with a single register in its block and add it to the tree.

In the next patch, where a cached rbnode is used by both the write() and the
read() functions, we also check if the register we are about to add is in the
cached rbnode (the least recently accessed one) and if so we append it in that
rbnode block.

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-2.6.39' into for-2.6.40
Mark Brown [Tue, 10 May 2011 13:58:17 +0000 (15:58 +0200)]
Merge branch 'for-2.6.39' into for-2.6.40

13 years agoASoC: WM8903: Fix Digital Capture Volume range
Stephen Warren [Mon, 9 May 2011 22:32:03 +0000 (16:32 -0600)]
ASoC: WM8903: Fix Digital Capture Volume range

Increase the range of the Digital Capture Volume control to be 120 steps.
Each step is 0.75dB, and the range starts at -72dB, giving a max setting
of 18dB, which matches the latest datasheet, to the precision of the step
size.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie...
Takashi Iwai [Tue, 10 May 2011 07:24:50 +0000 (09:24 +0200)]
Merge branch 'for-2.6.40' of git://git./linux/kernel/git/broonie/sound-2.6 into topic/asoc

13 years agoMerge branch 'for-2.6.40' of git://git.kernel.org/pub/scm/linux/kernel/git/lrg/asoc...
Takashi Iwai [Tue, 10 May 2011 07:20:19 +0000 (09:20 +0200)]
Merge branch 'for-2.6.40' of git://git./linux/kernel/git/lrg/asoc-2.6 into topic/asoc

13 years agoASoC: SSM2602: Provide dB ranges for the volume controls
Lars-Peter Clausen [Sun, 8 May 2011 16:24:46 +0000 (09:24 -0700)]
ASoC: SSM2602: Provide dB ranges for the volume controls

Also fix the maximum value for the capture volume control.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SSM2602: Model power supply for the digital core as a DAPM widget
Lars-Peter Clausen [Sun, 8 May 2011 16:24:45 +0000 (09:24 -0700)]
ASoC: SSM2602: Model power supply for the digital core as a DAPM widget

Model the power supply for the digital core as a DAPM_SUPPLY widget. This allows
to cleanup the code a bit.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SSM2602: Add entry for the ssm2603 to the device id table
Lars-Peter Clausen [Sun, 8 May 2011 16:24:44 +0000 (09:24 -0700)]
ASoC: SSM2602: Add entry for the ssm2603 to the device id table

The SSM2603 is mostly register compatible with the SSM2602 and can be supported
by the current driver without any changes.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SSM2602: Add SSM2604 support
Lars-Peter Clausen [Sun, 8 May 2011 16:24:43 +0000 (09:24 -0700)]
ASoC: SSM2602: Add SSM2604 support

The SSM2604 is basically a lightweight variant of the SSM2602 with a compatible
register layout. Thus we can easily support both devices by the same driver,
by providing a slightly set of controls, widgets and routes.

Compared to the SSM2602 the SSM2604 has no microphone input and no headphone
output.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SSM2602: Do not power the codec up in probe
Lars-Peter Clausen [Sun, 8 May 2011 16:24:42 +0000 (09:24 -0700)]
ASoC: SSM2602: Do not power the codec up in probe

It is not required to have the codec powered at this stage and DAPM will power
the ADC and DAC down again after probe has run anyway.
Thus we avoid some unnecessary writes by this change.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SSM2602: Fix default register cache
Lars-Peter Clausen [Sun, 8 May 2011 16:24:41 +0000 (09:24 -0700)]
ASoC: SSM2602: Fix default register cache

Some of the values in the default register cache did not represent the codecs
state after reset. This patch fixes it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-2.6.39' into for-2.6.40
Mark Brown [Sun, 8 May 2011 14:33:41 +0000 (15:33 +0100)]
Merge branch 'for-2.6.39' into for-2.6.40

13 years agoASoC: UDA134x: Remove POWER_OFF_ON_STANDBY define.
Marek Belisko [Tue, 3 May 2011 12:46:32 +0000 (14:46 +0200)]
ASoC: UDA134x: Remove POWER_OFF_ON_STANDBY define.

Define POWER_OFF_ON_STANDBY cause trobles when trying to get some
sound from codec because code for bias setup was not compiled
(define wasn't defined). This define was removed in commit:
cc3202f5 but again introduced by commit: f0fba2ad1 which then
completely break codec functionality so remove it again.

Signed-off-by: Marek Belisko <marek.belisko@open-nandra.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
13 years agoASoC: SSM2602: Remove unused struct and define
Lars-Peter Clausen [Thu, 5 May 2011 14:59:13 +0000 (16:59 +0200)]
ASoC: SSM2602: Remove unused struct and define

Those are leftovers from a pre-multicomponent era.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SSM2602: Remove duplicate control
Lars-Peter Clausen [Thu, 5 May 2011 14:59:11 +0000 (16:59 +0200)]
ASoC: SSM2602: Remove duplicate control

There are currently two controls which allow selecting the capture source, one
as a normal control, the other as part of a DAPM_MUX widget.
Remove the normal control.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SSM2602: Cleanup coeff handling
Lars-Peter Clausen [Thu, 5 May 2011 14:59:10 +0000 (16:59 +0200)]
ASoC: SSM2602: Cleanup coeff handling

Drop unused field from the coeff struct, precalculate the srate register at
compile-time and cleanup up the naming.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-2.6.39' into for-2.6.40
Mark Brown [Sun, 8 May 2011 13:43:18 +0000 (14:43 +0100)]
Merge branch 'for-2.6.39' into for-2.6.40

13 years agoASoC: SSM2602: Fix reg_cache_size
Lars-Peter Clausen [Thu, 5 May 2011 14:59:14 +0000 (16:59 +0200)]
ASoC: SSM2602: Fix reg_cache_size

reg_cache_size is supposed to be the number of elements in the register cache,
not the size in bytes.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: SSM2602: Fix 'Mic Boost2' control
Lars-Peter Clausen [Thu, 5 May 2011 14:59:16 +0000 (16:59 +0200)]
ASoC: SSM2602: Fix 'Mic Boost2' control

The 'Mic Boost2' control's shift was off by one and thus was not working.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@kernel.org
13 years agoASoC: SSM2602: Properly annotate i2c probe and remove functions
Lars-Peter Clausen [Thu, 5 May 2011 14:59:12 +0000 (16:59 +0200)]
ASoC: SSM2602: Properly annotate i2c probe and remove functions

Annotate the i2c probe and remove functions with __devinit and __devexit.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: soc-cache: Allow codec->cache_bypass to be used with snd_soc_hw_bulk_write_raw()
Dimitris Papastamos [Thu, 5 May 2011 13:18:11 +0000 (14:18 +0100)]
ASoC: soc-cache: Allow codec->cache_bypass to be used with snd_soc_hw_bulk_write_raw()

If we specifically want to write a block of data to the hw bypassing the
cache, then allow this to happen inside snd_soc_hw_bulk_write_raw().

Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Create codec DAPM widgets before calling the codecs probe function
Lars-Peter Clausen [Thu, 5 May 2011 14:59:09 +0000 (16:59 +0200)]
ASoC: Create codec DAPM widgets before calling the codecs probe function

This allows to create DAPM routes depending on those widgets in the
codecs probe function.  This is helpful when supporting similar codecs
with minor differences in the DAPM routing with the same driver.

Something similar has already been done for cards in commit
a841ebb9 (ASoC: Create card DAPM widgets early so they can be used in
callbacks).

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-2.6.39' into for-2.6.40
Mark Brown [Tue, 3 May 2011 22:30:36 +0000 (23:30 +0100)]
Merge branch 'for-2.6.39' into for-2.6.40

13 years agoASoC: sst_platform: add hw_free callback to fix resource leak
xingchao [Wed, 27 Apr 2011 20:58:54 +0000 (16:58 -0400)]
ASoC: sst_platform: add hw_free callback to fix resource leak

Signed-off-by: xingchao <xingchao.wang@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Remove outdated FIXME from WM8915
Mark Brown [Tue, 3 May 2011 18:31:20 +0000 (19:31 +0100)]
ASoC: Remove outdated FIXME from WM8915

Actually the current code is perfectly sensible given the hardware.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Use shared controls for input signal path in WM8915
Mark Brown [Tue, 3 May 2011 18:29:52 +0000 (19:29 +0100)]
ASoC: Use shared controls for input signal path in WM8915

Gives finer grained power management.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoMerge branch 'topic/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai...
Mark Brown [Tue, 3 May 2011 22:28:51 +0000 (23:28 +0100)]
Merge branch 'topic/asoc' of git://git./linux/kernel/git/tiwai/sound-2.6 into for-2.6.40

13 years agoASoC: Don't crash on PM operations
Mark Brown [Tue, 3 May 2011 17:25:34 +0000 (18:25 +0100)]
ASoC: Don't crash on PM operations

The move over to exposing snd_soc_register_card() let the initialisation
of the driver data we use to find the card in PM operations go AWOL. Fix
this by setting the driver data when we register the card.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Implement mux control sharing
Stephen Warren [Thu, 28 Apr 2011 23:38:01 +0000 (17:38 -0600)]
ASoC: Implement mux control sharing

Control sharing is enabled when two widgets include pointers to the
same kcontrol_new in their definition. Specifically:

static const struct snd_kcontrol_new adcinput_mux =
SOC_DAPM_ENUM("ADC Input", adcinput_enum);

static const struct snd_soc_dapm_widget wm8903_dapm_widgets[] = {
  SND_SOC_DAPM_MUX("Left ADC Input", SND_SOC_NOPM, 0, 0, &adcinput_mux),
  SND_SOC_DAPM_MUX("Right ADC Input", SND_SOC_NOPM, 0, 0, &adcinput_mux),
};

This is useful when a single register bit or field affects multiple
muxes at once. The common case is to have separate control bits or
fields for each mux (channel). An alternative way of looking at this
is that the mux is a stereo (or even n-channel) mux, rather than
independant mono muxes.

Without this change, a separate kcontrol will be created for each
DAPM_MUX. This has the following disadvantages:

* Confuses the user/programmer with redundant controls that don't
  map to separate hardware.

* When one of the controls is changed, ASoC fails to update the DAPM
  logic for paths solely affected by the other controls impacted by
  the same register bits. This causes some paths not to be correctly
  powered up or down. Prior to this change, to work around this, the
  user or programmer had to manually toggle all duplicate controls away
  from the intended setting, and then back to it.

Control sharing implies that the control is named based on the
kcontrol_new itself, not any of the widgets that are affected by it.

Control sharing is implemented by: When creating kcontrols, if a
kcontrol does not yet exist for a particular kcontrol_new, then a new
kcontrol is created with a list of widgets containing just a single
entry. This is the normal case. However, if a kcontrol does already
exists for the given kcontrol_new, the current widget is simply added
to that kcontrol's list of affected widgets.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Store a list of widgets in a DAPM mux/mixer kcontrol
Stephen Warren [Thu, 28 Apr 2011 23:38:00 +0000 (17:38 -0600)]
ASoC: Store a list of widgets in a DAPM mux/mixer kcontrol

A future change will allow multiple widgets to be affected by the same
control. For example, a single register bit that controls separate muxes
in both the L and R audio paths.

This change updates the code that handles relevant controls to be able
to iterate over a list of affected widgets. Note that only the put
functions need significant modification to implement the iteration; the
get functions do not need to iterate, nor unify the results, since all
affected widgets reference the same kcontrol.

When creating the list of widgets, always create a 1-sized list, since
the control sharing is not implemented in this change.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Add w->kcontrols, and populate it
Stephen Warren [Thu, 28 Apr 2011 23:37:59 +0000 (17:37 -0600)]
ASoC: Add w->kcontrols, and populate it

Future changes will need reference to the kcontrol created for a given
kcontrol_new. Store the created kcontrol values now.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: s/w->kcontrols/w->kcontrol_news/g
Stephen Warren [Thu, 28 Apr 2011 23:37:58 +0000 (17:37 -0600)]
ASoC: s/w->kcontrols/w->kcontrol_news/g

A future change will modify struct snd_soc_dapm_widget to store the
actual kcontrol pointers for each kcontrol_new in a field named
kcontrols. Rename the existing kcontrols field to enable this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoMerge branch 'for-2.6.39' into for-2.6.40
Mark Brown [Tue, 3 May 2011 18:07:45 +0000 (19:07 +0100)]
Merge branch 'for-2.6.39' into for-2.6.40

13 years agoASoC: JZ4740: Fix i2s shutdown
Lars-Peter Clausen [Sat, 30 Apr 2011 20:28:20 +0000 (22:28 +0200)]
ASoC: JZ4740: Fix i2s shutdown

The i2s shutdown callback has the check whether it should be disabled reversed.
Currently it is disabled if another stream is still active, but kept enabled if
the last stream is closed. This patch fixes it.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Remove DAPM debugfs entries before freeing widgets
Lars-Peter Clausen [Sat, 30 Apr 2011 17:45:50 +0000 (19:45 +0200)]
ASoC: Remove DAPM debugfs entries before freeing widgets

Remove the DAPM debugfs entries before freeing the context's widgets, otherwise a
use after free situation might occur.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Move DAPM widget debugfs entry creation to snd_soc_dapm_new_widgets
Lars-Peter Clausen [Sat, 30 Apr 2011 17:45:49 +0000 (19:45 +0200)]
ASoC: Move DAPM widget debugfs entry creation to snd_soc_dapm_new_widgets

Currently debugfs entries for a DAPM widgets are only added in
snd_soc_dapm_debugfs_init. If a widget is added later (for example in the
dai_link's probe callback) it will not show up in debugfs.
This patch moves the creation of the widget debugfs entry to
snd_soc_dapm_new_widgets where it will be added after the widget has been
properly instantiated.

As a side-effect this will also reduce the number of times the DAPM widget list
is iterated during a card's instantiation.

Since it is possible that snd_soc_dapm_new_widgets is invoked form the codecs or
cards probe callbacks, the creation of the debugfs dapm directory has to be
moved before these are called.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Move DAPM debugfs directory creation to snd_soc_dapm_debugfs_init
Lars-Peter Clausen [Sat, 30 Apr 2011 17:45:48 +0000 (19:45 +0200)]
ASoC: Move DAPM debugfs directory creation to snd_soc_dapm_debugfs_init

Move the creation of the DAPM debugfs directory to snd_soc_dapm_debugfs_init
instead of having the same duplicated code in both codec and card DAPM setup.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Free the card's DAPM context
Lars-Peter Clausen [Sat, 30 Apr 2011 17:45:47 +0000 (19:45 +0200)]
ASoC: Free the card's DAPM context

Free the card's DAPM context when the card is removed.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: tegra: TrimSlice machine support
Mike Rapoport [Tue, 26 Apr 2011 08:52:42 +0000 (11:52 +0300)]
ASoC: tegra: TrimSlice machine support

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Declare const properly for enum texts
Takashi Iwai [Tue, 3 May 2011 10:50:29 +0000 (12:50 +0200)]
ASoC: Declare const properly for enum texts

The enum texts are supposed to be const char * const [].  Without the
second const, it gets compile warnings like
    sound/soc/codecs/max98095.c:607:2: warning: initialization discards qualifiers from pointer target type

Signed-off-by: Takashi Iwai <tiwai@suse.de>
13 years agoASoC: Don't specify the DMA driver for Goni baseband link
Mark Brown [Wed, 27 Apr 2011 17:25:34 +0000 (18:25 +0100)]
ASoC: Don't specify the DMA driver for Goni baseband link

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Don't specify the DMA driver for OpenMoko baseband link
Mark Brown [Wed, 27 Apr 2011 17:17:27 +0000 (18:17 +0100)]
ASoC: Don't specify the DMA driver for OpenMoko baseband link

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoMerge branch 'for-2.6.39' into for-2.6.40
Mark Brown [Thu, 28 Apr 2011 11:10:25 +0000 (12:10 +0100)]
Merge branch 'for-2.6.39' into for-2.6.40

13 years agoASoC: Fix CODEC DAI names for Goni
Mark Brown [Wed, 27 Apr 2011 17:24:35 +0000 (18:24 +0100)]
ASoC: Fix CODEC DAI names for Goni

Immediately after sending the last fix I realised that the CODEC DAI names
also don't correspond to the WM8994 driver. Update the DAI names to match.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Fix CODEC name in Goni
Mark Brown [Wed, 27 Apr 2011 17:19:17 +0000 (18:19 +0100)]
ASoC: Fix CODEC name in Goni

This was typoed at some point in the multi-component merge, though the
driver was added along with that.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Work around allmodconfig failure
Mark Brown [Thu, 28 Apr 2011 09:57:54 +0000 (10:57 +0100)]
ASoC: Work around allmodconfig failure

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Implement WM8962 ADC high pass filter configuration
Mark Brown [Tue, 26 Apr 2011 15:04:37 +0000 (16:04 +0100)]
ASoC: Implement WM8962 ADC high pass filter configuration

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Add dapm_find_widget helper
Lars-Peter Clausen [Wed, 27 Apr 2011 16:34:31 +0000 (18:34 +0200)]
ASoC: Add dapm_find_widget helper

This patch adds a helper function for searching DAPM widgets by name.
This allows to streamline functions which operate on widgets by name.
It also allows to get rid of copy'n'pasted code which was added to fallback to
widgets from other contexts if the widget was not found in the current context.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Don't specify the DMA driver for Speyside baseband link
Mark Brown [Wed, 27 Apr 2011 17:17:01 +0000 (18:17 +0100)]
ASoC: Don't specify the DMA driver for Speyside baseband link

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Add more natural support for no-DMA DAIs
Mark Brown [Wed, 27 Apr 2011 17:16:32 +0000 (18:16 +0100)]
ASoC: Add more natural support for no-DMA DAIs

Since we can now support multiple platforms allow machines to not specify
a platform in a DAI link. Since the rest of the code requires that we have
a struct device for all objects we do this by substituting in a dummy
device that we register automatically.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Allow platform drivers to have no ops structure
Mark Brown [Wed, 27 Apr 2011 17:58:17 +0000 (18:58 +0100)]
ASoC: Allow platform drivers to have no ops structure

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Jassi Brar <jassisinghbrar@gmail.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Don't warn if the WM8962 SYSCLK FLL setting doesn't match reality
Mark Brown [Mon, 25 Apr 2011 17:27:35 +0000 (18:27 +0100)]
ASoC: Don't warn if the WM8962 SYSCLK FLL setting doesn't match reality

When bringing up audio low power modes boards may configure SYSCLK before
they actually start the FLL as we do much of the clocking setup prior to
the power up sequence.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Implement WM8962 DMIC support
Mark Brown [Mon, 25 Apr 2011 19:14:21 +0000 (20:14 +0100)]
ASoC: Implement WM8962 DMIC support

DMIC support is automatically disabled when none of the GPIOs are set up
to bring out the DMICCLK and DMICDAT pins at startup.

Note that there's no support for controlling DMIC routing except the power
control so the board DAPM configuration will need to manage DMIC enable and
disable if analogue mics (eg, a headset) also exist.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Define constants for WM8962 GPIO functions
Mark Brown [Mon, 25 Apr 2011 19:01:42 +0000 (20:01 +0100)]
ASoC: Define constants for WM8962 GPIO functions

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Move WM8962 FLL configuration to CODEC
Mark Brown [Mon, 25 Apr 2011 17:44:01 +0000 (18:44 +0100)]
ASoC: Move WM8962 FLL configuration to CODEC

There's only one DAI anyway.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Support FLL lock interrupt on WM8962
Mark Brown [Mon, 25 Apr 2011 16:53:43 +0000 (17:53 +0100)]
ASoC: Support FLL lock interrupt on WM8962

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoASoC: Support 24.576MHz MCLKs in WM8915
Mark Brown [Thu, 21 Apr 2011 13:16:14 +0000 (14:16 +0100)]
ASoC: Support 24.576MHz MCLKs in WM8915

We can safely divide these down to within the supported SYSCLK range.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoMerge branch 'for-2.6.39' into for-2.6.40
Mark Brown [Tue, 26 Apr 2011 10:46:47 +0000 (11:46 +0100)]
Merge branch 'for-2.6.39' into for-2.6.40

13 years agodavinci-mcasp: fix _CBM_CFS pin directions
Ben Gardiner [Thu, 21 Apr 2011 18:19:04 +0000 (14:19 -0400)]
davinci-mcasp: fix _CBM_CFS pin directions

The current davinci_mcasp_set_dai_fmt() sets bits ACLKX and ACLKR in the PDIR
register for the codec clock-master/frame-slave mode; however, this results in
the ACLKX and ACLKR pins being outputs according to SPRUFM1 [1]  which
conflicts with "codec is clock master."

Similarly to the previous patch in this series, "fix _CBM_CFS hw_params" --
For codec clock-master/frame-slave mode (_CMB_CFS), clear bits ACLKX and ACLKR
in the PDIR register to set the pins as inputs and hence allow externally
sourced bit-clocks.

[1] http://www.ti.com/litv/pdf/sprufm1

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: James Nuss <jamesnuss@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agodavinci-mcasp: fix _CBM_CFS hw_params
Ben Gardiner [Thu, 21 Apr 2011 18:19:03 +0000 (14:19 -0400)]
davinci-mcasp: fix _CBM_CFS hw_params

The current davinci_mcasp_set_dai_fmt() sets bits ACLKXE and ACLKRE (CLKXM
and CLKRM as they are reffered to in SPRUFM1 [1]) for codec clock-slave/
frame-slave mode (_CBS_CFS) which selects internally generated bit-clock and
frame-sync signals; however, it does the same thing again for codec
clock-master/frame-slave mode (_CBM_CFS) in the very next case statement which
is incorrectly selecting internally generated bit-clocks in this mode.

For codec clock-master/frame-slave mode (_CBM_CFS), clear bits ACLKXE and
ACLKRE to select externally-generated bit-clocks.

[1] http://www.ti.com/litv/pdf/sprufm1

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: James Nuss <jamesnuss@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agodavinci-mcasp: use bitfield definitions for PDIR
Ben Gardiner [Thu, 21 Apr 2011 18:19:02 +0000 (14:19 -0400)]
davinci-mcasp: use bitfield definitions for PDIR

The current driver creates value for set/clr of PDIR using (x<<26) instead
of the #defines that are convieniently made available.

Update the driver to use the bitfield definitions of PDIR. There is no
functional change introduced by this patch.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: James Nuss <jamesnuss@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: davinci-mcasp: correct tdm_slots limit
Ben Gardiner [Thu, 21 Apr 2011 18:19:01 +0000 (14:19 -0400)]
ASoC: davinci-mcasp: correct tdm_slots limit

The current check for the number of tdm-slots specified by platform data is
always true (x >= 2 || x <= 32); therefore the else branch that warns of an
incorrect number of slots can never be taken.

Check that the number of tdm slots specified by platform data is between 2
and 32, inclusive.

Signed-off-by: Ben Gardiner <bengardiner@nanometrics.ca>
Reviewed-by: James Nuss <jamesnuss@nanometrics.ca>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: Add module/port clock control function
Kuninori Morimoto [Thu, 21 Apr 2011 01:33:52 +0000 (10:33 +0900)]
ASoC: sh: fsi: Add module/port clock control function

The FIFO of each port were always working though it was not used
in current FSI driver.
This patch add module/port clock control function for fixing it.
This patch is also caring suspend/resume.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <simon@horms.net>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: add dev_pm_ops :: suspend/resume
Kuninori Morimoto [Thu, 21 Apr 2011 01:33:47 +0000 (10:33 +0900)]
ASoC: sh: fsi: add dev_pm_ops :: suspend/resume

Current FSI driver sets important settings when probing.
And it are not set again as long as driver is not bind again.
This mean FSI driver will lost it from register
if suspend/resume are happen.
This patch save important settings for suspend/resume.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <simon@horms.net>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: sh: fsi: add fsi_is_clk_master function
Kuninori Morimoto [Thu, 21 Apr 2011 01:33:36 +0000 (10:33 +0900)]
ASoC: sh: fsi: add fsi_is_clk_master function

If FSI port is clock master, it use set_rate function
which is callback from platform,
and it is not necessary to call it if FSI port is clock slave.
Current FSI driver called this callback if platform provide it.
This patch modify it.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <simon@horms.net>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Remove default settings from Tegra Kconfig
Mark Brown [Thu, 21 Apr 2011 11:01:49 +0000 (12:01 +0100)]
ASoC: Remove default settings from Tegra Kconfig

There needs to be a strong reason for overriding the Kconfig default.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Liam Girdwood <lrg@ti.com>
13 years agoMerge branch 'tegra' into for-2.6.40
Mark Brown [Thu, 21 Apr 2011 11:00:27 +0000 (12:00 +0100)]
Merge branch 'tegra' into for-2.6.40

Fix up merge with Harmony driver rename.

Conflicts:
sound/soc/tegra/Kconfig

13 years agoARM: Tegra: select MACH_HAS_SND_SOC_TEGRA_WM8903
Stephen Warren [Tue, 19 Apr 2011 16:18:01 +0000 (10:18 -0600)]
ARM: Tegra: select MACH_HAS_SND_SOC_TEGRA_WM8903

CONFIG_SND_SOC_TEGRA_WM8903 is useful for many Tegra boards. To avoid the
ASoC tegra/Kconfig enumerating them all, instead have the Tegra machine
Kconfig select MACH_HAS_SND_SOC_TEGRA_WM8903 where appropriate, and have
SND_SOC_TEGRA_WM8903 depend on this.

[Redid ASoC diff so it applies. -- broonie]

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: WM8903: Implement DMIC support
Stephen Warren [Tue, 19 Apr 2011 02:58:11 +0000 (20:58 -0600)]
ASoC: WM8903: Implement DMIC support

In addition to the currently supported analog capture path, the WM8903
also supports digital mics.

The analog and digital capture paths are exclusive; a mux is present to
select the capture source.

Logically, the mux exists to select the decimator's input, from either
the ADC or DMIC block outputs. However, the ADC power domain also
includes the DMIC interface. Consequently, this change represents the
mux as existing immediately before the ADC, and selecting between the
Input PGA and DMIC block outputs.

An alternative might be to represent the mux in its correct location,
and associate the ADC power enable controls with both the real ADC, and
a fake ADC for the DMIC?

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Add EQ and filter to max98095 CODEC driver
Peter Hsiang [Wed, 20 Apr 2011 01:20:40 +0000 (18:20 -0700)]
ASoC: Add EQ and filter to max98095 CODEC driver

This patch adds the equalizer and biquad filter controls.

Signed-off-by: Peter Hsiang <peter.hsiang@maxim-ic.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Tegra: wm8903: s/code/data/ for control/widget/maps
Stephen Warren [Tue, 19 Apr 2011 21:25:12 +0000 (15:25 -0600)]
ASoC: Tegra: wm8903: s/code/data/ for control/widget/maps

Replace calls to a variety of registration functions by updating
struct snd_soc_card snd_soc_tegra_wm8903 to directly point at the
various control/widget/map tables instead. The ASoC core now
performs any required registration based on these data fields.

(Applying Mark's TrimSlice review comments to the existing driver)

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: fix two ident style problems
Lu Guanqun [Wed, 20 Apr 2011 08:00:51 +0000 (16:00 +0800)]
ASoC: fix two ident style problems

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: simple style fix
Lu Guanqun [Wed, 20 Apr 2011 08:00:46 +0000 (16:00 +0800)]
ASoC: simple style fix

replace the tab with spaces,
make it align with other paragraphs

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: remove unused comment
Lu Guanqun [Wed, 20 Apr 2011 08:00:42 +0000 (16:00 +0800)]
ASoC: remove unused comment

`type` parameter is not longer used in `snd_soc_codec_set_cache_io`,
so remove this line.

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: fix a simple coding style issue
Lu Guanqun [Wed, 20 Apr 2011 08:00:36 +0000 (16:00 +0800)]
ASoC: fix a simple coding style issue

Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: snd_soc_dapm_get_pin_status: Match other contexts too
Stephen Warren [Tue, 19 Apr 2011 21:25:11 +0000 (15:25 -0600)]
ASoC: snd_soc_dapm_get_pin_status: Match other contexts too

Not all widgets on a card are within the codec's DAPM context. Fix
snd_soc_dapm_get_pin_status to search all contexts when looking for a
widget.

This change is required when modifying tegra_wm8903 to use
snd_soc_card.widgets rather than calling snd_soc_dapm_new_controls; the
former adds the widgets to the card's DAPM context, whereas tegra_wm8903
uses the codec's DAPM context when calling snd_soc_dapm_new_controls.

By code inspection, I suspect this also applies to Samsung Speyside.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Tegra: Retrieve card from DAPM context not codec
Stephen Warren [Tue, 19 Apr 2011 21:25:10 +0000 (15:25 -0600)]
ASoC: Tegra: Retrieve card from DAPM context not codec

Card widgets are created in the card's DAPM context, not any codec's DAPM
context. Hence, w->codec==NULL. Instead, find the card from the widget
through the DAPM context of the widget, not the codec of the widget.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Tegra: Don't return mclk_changed from utils_set_rate
Stephen Warren [Tue, 19 Apr 2011 21:25:09 +0000 (15:25 -0600)]
ASoC: Tegra: Don't return mclk_changed from utils_set_rate

Only the clock programming code needs to know whether the clocks changed,
and that is encapsulated within tegra_asoc_utils_set_rate(). The machine
driver's call to snd_soc_dai_set_sysclk(codec_dai, ...) is safe
irrespective of whether the clocks changed.

(Applying Mark's TrimSlice review comments to the existing driver)

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Tegra: wm8903: Remove redundant drvdata clears
Stephen Warren [Tue, 19 Apr 2011 21:25:08 +0000 (15:25 -0600)]
ASoC: Tegra: wm8903: Remove redundant drvdata clears

When the driver is not initialized/registered, nothing should be touching
these fields anyway, so there's no point clearing them out.

(Applying Mark's TrimSlice review comments to the existing driver)

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
13 years agoASoC: Tegra: wm8903 probe: Don't call machine_is_*()
Stephen Warren [Tue, 19 Apr 2011 21:25:07 +0000 (15:25 -0600)]
ASoC: Tegra: wm8903 probe: Don't call machine_is_*()

This machine driver is a platform driver, and hence will only be
instantiated on the correct machines. Hence, there is no need to
check the current machine during probe.

(Applying Mark's TrimSlice review comments to the existing driver)

Signed-off-by: Stephen Warren <swarren@nvidia.com>
Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>