Sangbeom Kim [Mon, 20 Jun 2011 08:29:29 +0000 (17:29 +0900)]
ASoC: SAMSUNG: Add WM8994 PCM Machine driver
This patch add WM8994 PCM machine driver to support PCM audio
on SMDKV310, SMDKC210 boards.
Playback and Capture supports 8kHz sampling rates.
and It is tested on SMDKV310, SMDKC210.
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Acked-by: Jassi Brar <jaswinder.singh@linaro.org> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Daniel Mack [Wed, 22 Jun 2011 18:48:25 +0000 (20:48 +0200)]
ASoC: pxa-ssp: Correct check for stream presence
Don't rely on the codec's channels_min information to decide wheter or
not allocate a substream's DMA buffer. Rather check if the substream
itself was allocated previously.
Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Mark Brown [Wed, 22 Jun 2011 19:07:24 +0000 (20:07 +0100)]
ASoC: Add basic WM8918 support
The WM8918 is register compatible with the WM8904 with a subset of the
functionality. Add the device ID, a subsequent patch will ensure that only
the relevant functionality is exported to userspace.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Johannes Stezenbach <js@sig21.net>
[zonque@gmail.com: transform to new ASoC structure] Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Johannes Stezenbach <js@sig21.net>
[zonque@gmail.com: transform to new ASoC structure] Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Taylor Hutt [Mon, 20 Jun 2011 18:54:32 +0000 (11:54 -0700)]
ASoC: codecs: Max98095: Fix logging of hardware revision.
The base hardware revision of the Maxim 98095 part is 0x40; the code
which outputs the revision of the hardware has been updated to
properly use uppercase alphabetic values for the revision numbers.
Also, the use of a constant for the length 'max98095_dai' has been
replaced with ARRAY_SIZE().
Signed-off-by: Taylor Hutt <thutt@chromium.org> Acked-by: Peter Hsiang <peter.hsiang@maxim-ic.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Sun, 19 Jun 2011 12:49:28 +0000 (13:49 +0100)]
ASoC: Fix DAPM sequence run for per-widget I/O methods
Previously we were using the DAPM context rather than a widget as the
argument for update_bits() so we didn't need to care that our list walk
of widgets left us one beyond the end of the list. Now we're using them
for the register update we need to make sure we're pointing at an actual
widget not the list_head.
Fix originally suggested by Liam on IM.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Sat, 18 Jun 2011 14:31:38 +0000 (15:31 +0100)]
ASoC: Remove adau1701 from SND_SOC_ALL_CODECS due to Sigma dependency
The Sigma code is in drivers/firmware which is only included on a very
small subset of architectures and so ends up breaking the build on
others. There's a pending patch to make the directory build as standard
but it's not merged yet.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mike Frysinger [Fri, 17 Jun 2011 02:24:15 +0000 (22:24 -0400)]
ASoC: Blackfin: allow SPI for SSM2602 parts
This board has hardware switches for selecting SPI or I2C, so don't
require I2C for this driver.
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>
Barry Song [Wed, 15 Jun 2011 19:29:22 +0000 (15:29 -0400)]
ASoC: AD1836: rename suspend/resume funcs
Use less specific names for suspend/resume to match the probe/remove funcs
where these are now used.
Signed-off-by: Barry Song <barry.song@analog.com> Signed-off-by: Scott Jiang <scott.jiang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mike Frysinger [Wed, 15 Jun 2011 19:29:19 +0000 (15:29 -0400)]
ASoC: AD1836: drop unnecessary spi register check
The only thing the init func does is register a spi driver, so if that
fails, we return the value back up to the caller who will display an
error message for us. So drop the redundant checking/message.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Liam Girdwood [Mon, 13 Jun 2011 18:37:36 +0000 (19:37 +0100)]
ASoC: dapm - Refactor widget IO functions in preparation for platform widgets.
This time with soc_widget_update_bits reflecting recent soc_update_bits changes.
Currently widget IO is tightly coupled to the CODEC drivers. Future platform DSP
devices have mixer components that can alter power usage and hence require full
DAPM support.
This provides a generic widget IO operation wrapper in preparation for
future patches that implement platform driver DAPM.
Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Mon, 13 Jun 2011 17:44:52 +0000 (18:44 +0100)]
ASoC: Don't use codec->control_data in bulk write
In order to facilitate merging with the register map I/O replace the use
of control_data for the bulk writes with direct lookup of the client data
from the device.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Mon, 13 Jun 2011 15:42:29 +0000 (16:42 +0100)]
ASoC: Add weak routes for sidetone style paths
Normally DAPM will power up any connected audio path. This is not ideal
for sidetone paths as with sidetone paths the audio path is not wanted in
itself, it is only desired if the two paths it provides a sidetone between
are both active. If the sidetone path causes a power up then it can be
hard to minimise pops as we first power up either the sidetone or the main
output path and then power the other, with the second power up potentially
introducing a DC offset.
Address this by introducing the concept of a weak path. If a path is marked
as weak then DAPM will ignore that path when walking the graph, though all
the relevant controls are still available to the application layer to allow
these paths to be configured.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Mon, 13 Jun 2011 16:49:55 +0000 (17:49 +0100)]
ASoC: Move register I/O code into a separate file
For clarity and to help ongoing refactoring in this area create a new file
to contain the physical I/O functions, separating them out from the cache
operations.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Fri, 10 Jun 2011 18:42:56 +0000 (19:42 +0100)]
ASoC: Factor out redundant read() functions
We've got a whole bunch of functions which just call straight through to
do_hw_read(). Simplify this situation by removing them and using hw_read()
directly.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Liam Girdwood [Thu, 9 Jun 2011 16:04:39 +0000 (17:04 +0100)]
ASoC: core - PCM mutex per rtd
In preparation for the new ASoC Dynamic PCM support (AKA DSP support).
The new ASoC Dynamic PCM core allows DAIs to be dynamically re-routed
at runtime between the PCM device end (or Frontend - FE) and the physical DAI
(Backend - BE) using regular kcontrols (just like a hardware CODEC routes
audio in the analog domain). The Dynamic PCM core therefore must be
able to call PCM operations for both the Frontend and Backend(s) DAIs at
the same time.
Currently we have a global pcm_mutex that is used to serialise
the ASoC PCM operations. This patch removes the global mutex
and adds a mutex per RTD allowing the PCM operations to be reentrant and
allow control of more than one DAI at at time. e.g. a frontend PCM hw_params()
could configure multiple backend DAI hw_params() with similar or different
hw parameters at the same time.
Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Liam Girdwood [Thu, 9 Jun 2011 13:45:53 +0000 (14:45 +0100)]
ASoC: core - Separate out PCM operations into new file.
In preparation for Dynamic PCM support (AKA DSP support).
There will be future patches that add support to allow PCMs to be dynamically
routed to multiple DAIs at startup and also during stream runtime. This patch
moves the ASoC core PCM operaitions into a new file called soc-pcm.c. This will
in simplify the ASoC core features into distinct files.
Signed-off-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: snd_soc_new_{mixer,mux,pga} make sure to use right DAPM context
Currently it is possible that snd_soc_new_{mixer,mux,pga} is called with a
DAPM context not matching the widgets context. This can lead to a wrong
prefix_len calculation, which will result in undefined behaviour. To avoid
this always use the DAPM context from the widget itself.
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
Timur Tabi [Wed, 8 Jun 2011 20:02:55 +0000 (15:02 -0500)]
ASoC: p1022ds: fix incorrect referencing of device tree properties
Device tree integer properties are encoded in big-endian format, but some of
the Freescale ASoC drivers were assuming that the host is in big-endian format
as well. Although this is true, it's better to use endian-safe accessors.
Also add a check for a failed ioremap() call in the SSI driver.
Signed-off-by: Timur Tabi <timur@freescale.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Timur Tabi [Wed, 8 Jun 2011 20:02:56 +0000 (15:02 -0500)]
ASoC: fsl: fix initialization of DMA buffers
The DMA (PCM) driver used by some Freescale PowerPC supports separate DAIs
for playback and capture, so DMA buffers should be allocated only for the
initialized streams. Instead of checking for the number of active channels,
which apparently is not reliable, check to see if the actual stream object
exists.
Also provide a better name for the DMA interrupt.
Signed-off-by: Timur Tabi <timur@freescale.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 7 Jun 2011 22:16:29 +0000 (23:16 +0100)]
ASoC: Report errors when we have a WM8962 IRQ and don't get FLL lock
We really should be getting the interrupt - if we don't get one it's very
likely that the configuration is incorrect and audio will fail. Also
increase the timeout substantially in this case for safety.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Fri, 3 Jun 2011 15:36:30 +0000 (16:36 +0100)]
ASoC: Suppress restore of default register values for rbtree cache sync
Currently the rbtree code will write out the entire register map when
doing a cache sync which is wasteful and will slow things down. Check
to see if the value we're about to write is the default and don't bother
restoring it if it is, either the value will have been retained or the
device will have been reset and holds the value already.
We should really store the defaults in the nodes but this resolves the
immediate issue.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Commit f97d0c6d5f94 ("ASoC: AD1836: Add input gain control for ADC2") contained
a typo in the register name, causing a build error. 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>
Greg Dietsche [Mon, 6 Jun 2011 20:53:01 +0000 (15:53 -0500)]
ASoC: wm8940: remove unnecessary if statements
removing unnecessary if(ret) checks
This updated patch corrects a minor spelling problem in the commit message
and resolves two other (similar) issues found in wm8940.c by Jonathan Cameron.
Signed-off-by: Greg Dietsche <Gregory.Dietsche@cuw.edu> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: AD1836: Remove unused fields from private struct
The control_type field is never used, so it can be removed. The
control_data field is used to initialize the codec's control_data field,
but since this is also done by the snd-soc-cache core, the redundant
assignment can be removed and the field can be dropped.
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>
ASoC: AD1836: Add AD1835/AD1837/AD1838/AD1839 support
The AD183X codec devices are mostly register compatible and can easily be
supported by the same driver. The main difference between those devices
is the number of DACs and ADCs.
This patch adjusts the driver to allocate the controls, DAPM widgets and
routes for the DACs and ADCs dynamically based on the chip type.
The AD1836 is a bit special in that it supports different modes for its second
ADC, so it needs some special handling. Right now the driver hardcodes the mode
to the differential PGA mode.
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>
The different ADC and DAC controls follow the same scheme, so add some helper
macros for declaring them.
This should make the code a bit more readable and also decreases the code size
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>
Mark Brown [Mon, 6 Jun 2011 18:12:44 +0000 (19:12 +0100)]
ASoC: Manage Speyside system clocking only in bias management
Now that the CODEC driver supports it defer configuration of the system
clock until bias management which is a much more idiomatic place to do
system power control and makes things a lot more happy when we're using
both interfaces.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Mon, 6 Jun 2011 18:13:23 +0000 (19:13 +0100)]
ASoC: Add context parameter to card DAPM callbacks
The card callback will get called for each DAPM context in the card so it
can be useful for it to know which device is currently undergoing a
transition.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Sat, 4 Jun 2011 10:34:43 +0000 (11:34 +0100)]
ASoC: Don't bring the CODEC up to full power for supplies and biases
If the only widgets active within a CODEC are supplies and micbiases we
are not passing audio, we are probably just doing microphone detection.
This will not generally require either fully accurate reference voltages
or much power so
If this turns out to be unsuitable for some systems we can provide a
facility to override this decision.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Sat, 4 Jun 2011 10:25:10 +0000 (11:25 +0100)]
ASoC: Specify target bias state directly as a bias state
Rather than a simple flag to say if we want the DAPM context to be at full
power specify the target bias state. This should have no current effect
but is a bit more direct and so makes it easier to change our decisions
about the which bias state to go into in future.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Allow more dynamic management of the device clocking by allowing BCLK to
be calculated when we set SYSCLK. This means that if the system is idle
when hw_params() runs then we don't try to use the SYSCLK used in that case
to set up the BCLK dividers, we can instead wait until a later point such
as bias level configuration. This makes it easier to manage low power modes.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Fri, 3 Jun 2011 16:49:46 +0000 (17:49 +0100)]
ASoC: Error out when FLL lock interrupt is not delivered on WM8915
When the FLL locks on the WM8915 an interrupt is generated. For safety
error out if we don't get that interrupt when the IRQ output of the
WM8915 is hooked up. Since we *really* expect an interrupt but the
threaded IRQ handler may take a bit longer than expected to get
scheduled also dramatically increase the delay in this case.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
ASoC: atmel_ssc: Don't try to free ssc if request failed
We should only call ssc_free() when ssc_request() succeeds or bad
things will happen.
Signed-off-by: Joachim Eastwood <joachim.eastwood@jotron.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Wed, 1 Jun 2011 19:16:40 +0000 (20:16 +0100)]
ASoC: Use a lower detection rate when monitoring headphones on WM8915
We only need to increase the detection rate to maximum if we're monitoring
for button presses as the response times needed for user interaction there
are much lower.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Wed, 1 Jun 2011 18:17:02 +0000 (19:17 +0100)]
ASoC: Remove internally generated WM8915 supplies
DCVDD and MICVDD are intended to be (and almost always are) generated by
on-board LDOs which are transparently controlled by the driver so we
shouldn't really be requesting them from the regulator API. If the driver
is updated to support external supply of these then we will need to change
the way we handle this.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
e1 = clk_get@p1(...);
... when != e1 = e2
when != clk_put(e1)
when any
if (...) { ... when != clk_put(e1)
when != if (...) { ... clk_put(e1) ... }
* return@p3 ...;
} else S
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Wed, 1 Jun 2011 13:45:58 +0000 (14:45 +0100)]
ASoC: Support edge triggered IRQs for WM8915
Really this should be something the IRQ core can cope with for us but since
it doesn't currently do so (at least for threaded interrupts like this) do
so in the driver. This allows us to run with interrupt controllers that
only support edge triggered interrupts.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>