Wolfram Sang [Tue, 2 Aug 2011 17:42:19 +0000 (19:42 +0200)]
ASoC: sgtl5000: fix cache handling
Cache handling in this driver is broken. The chip has 16-bit registers, yet the
register numbers also increase by 2 per register, i.e. there are only
even-numbered registers. The cache in this driver, though, simply increments
register numbers, so it does need some mapping as seen in
sgtl5000_restore_regs(), note the '>> 1':
That, of course, won't work with snd_soc_update_bits(). (Thus, we won't even
notice the missing register 0x1c in the default regs which shifted all follwing
registers to wrong values.) Noticed on the MX28EVK where enabling the regulators
simply locked up the chip.
Refactor the routines and use a properly sized default_regs array which matches
the register layout of the underlying chip, i.e. create a truly flat cache.
This also saves some code which should make up for the bigger array a little.
When soc-core will somewhen have another cache type which handles a step size,
this conversion will also ease the transition.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Tested-by: Dong Aisheng <b29396@freescale.com> Tested-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Thu, 28 Jul 2011 11:44:44 +0000 (12:44 +0100)]
ASoC: Disable wm_hubs periodic DC servo update
This does not function correctly in all circumstances so disable the
periodic updates unconditionally for stable; a future patch will reenable
where appropriate.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
CC [M] sound/soc/txx9/txx9aclc.o
/home/ralf/src/linux/linux-mips/sound/soc/txx9/txx9aclc.c: In function 'txx9aclc_pcm_new':
/home/ralf/src/linux/linux-mips/sound/soc/txx9/txx9aclc.c:318:3: error: 'card' undeclared (first use in this function)
/home/ralf/src/linux/linux-mips/sound/soc/txx9/txx9aclc.c:318:3: note: each undeclared identifier is reported only once for each function it appears in
make[5]: *** [sound/soc/txx9/txx9aclc.o] Error 1
Sangbeom Kim [Wed, 20 Jul 2011 08:07:12 +0000 (17:07 +0900)]
ASoC: SAMSUNG: Modify I2S driver to support idma
Previously, I2S driver only can support system dma.
In this patch, i2s driver can support internal dma too.
IDMA h/w configuration is initialized on idma.c
Signed-off-by: Sangbeom Kim <sbkim73@samsung.com> Acked-by: Liam Girdwood <lrg@ti.com> Acked-by: Jassi Brar <jassisinghbrar@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
In davinci_vcif_trigger() function, a break() statement was missing
causing the davinci_vcif_stop() function to be called as a fallback
after calling davinci_vcif_start().
Signed-off-by: Rajashekhara, Sudhakar <sudhakar.raj@ti.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
According to DM365 voice codec data sheet at [1], before starting
recording or playback, ADC/DAC modules should follow a reset and
enable cycle. Writing a 1 to the ADC/DAC bit in the register resets
the module and clearing the bit to 0 will enable the module. But the
driver seems to be doing the reverse of it.
Mark Brown [Wed, 20 Jul 2011 12:50:10 +0000 (13:50 +0100)]
ASoC: Acknowledge WM8962 interrupts before acting on them
This closes the small race between a status being read in response to an
interrupt and clearing the interrupt, meaning that if the status changes
between those periods we might not get a reassertion of the interrupt.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Wolfram Sang [Sun, 17 Jul 2011 16:00:26 +0000 (18:00 +0200)]
ASoC: core: make comments fit the code
In one comment, cpu_dai was mentioned although codec_dai was used in the
code. Also, fix the name for the card dai list which has no seperation
into card_dai and codec_dai.
Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Mon, 18 Jul 2011 04:17:13 +0000 (13:17 +0900)]
ASoC: Mark cache as dirty when suspending
Since quite a few drivers are not managing to flag the cache as needing
to be resynced after suspend and it's a reasonable thing to do flag the
cache as needing sync automatically when suspending.
The expectation is that systems will mainly only keep the CODEC powered
when doing audio through the CODEC so we won't actually suspend the
device anyway; drivers which want to can override this behaviour when
they resume.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Cc: stable@kernel.org
Mark Brown [Thu, 14 Jul 2011 09:21:37 +0000 (18:21 +0900)]
ASoC: Correct WM8994 MICBIAS supply widget hookup
The WM8994 and WM8958 series of devices have two MICBIAS supplies rather
than one, the current widget actually manages the microphone detection
control register bit (which is managed separately by the relevant API).
Fix this, hooking the relevant supplies up to the MICBIAS1 and MICBIAS2
widgets.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Mark Brown [Thu, 14 Jul 2011 08:11:38 +0000 (17:11 +0900)]
ASoC: Reduce power consumption for idle DAIs in WM8994
If DAIs are idle but their clocks are in use for some reason (eg, as
SYSCLK or for accessory detect) then set the clock dividers to the maximum
to reduce slightly the power consumption of the unclocked circuits.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Fri, 15 Jul 2011 18:12:18 +0000 (03:12 +0900)]
ASoC: Handle failed WM8994 FLL lock waits
Try the completion before we start the FLL so that if an interrupt was
delayed long enough for us to miss it we don't wait for the completion
it signalled.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
The WM8983 is a low power, high quality stereo CODEC
designed for portable multimedia applications. Highly flexible
analogue mixing functions enable new application features,
combining hi-fi quality audio with voice communication.
Signed-off-by: Dimitris Papastamos <dp@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: SAMSUNG: 24-bit audio playback on Exynos4210
Using 256fs or 512fs will result in distortion of 24-bit
audio samples. This is because the lrclk generated is not
proper. Using 384 fs generates proper output.
Signed-off-by: Giridhar Maruthy <giridhar.maruthy@linaro.org> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Tue, 12 Jul 2011 06:25:03 +0000 (15:25 +0900)]
ASoC: Implement DC servo completion IRQ handling for wm_hubs devices
The individual devices should set the flag dcs_done_irq in the hubs
shared data structure to indicate that they will flag the interrupt
by calling wm_hubs_dcs_done().
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Chip documentation explicitly requires that the reset values
of reserved register bits are left untouched. It is possible
there are differences between STA326 and STA328 or future
chip revisions in these bits, and clobbering them might
cause malfunction.
Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: STA32x: Add mixer controls for biquad coefficients
The STA32x has a number of preset EQ settings, but also
allows full user control of the biquad filter coeffcients
(when "Automode EQ" is set to "User").
Each biquad has five signed, 24bit, fixed-point coefficients
representing the range -1...1. The five biquad coefficients
can be uploaded in one atomic operation into on-chip
coefficient RAM.
There are also a few prescale, postscale and mixing
coefficients, in the same numeric format and range
(a negative coefficient inverts phase).
These coefficients are made available as SNDRV_CTL_ELEM_TYPE_BYTES
mixer controls.
Signed-off-by: Johannes Stezenbach <js@sig21.net> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Axel Lin [Wed, 6 Jul 2011 13:20:42 +0000 (21:20 +0800)]
ASoC: pxa2xx-pcm: remove unused variable 'dai'
Remove unused variable 'dai' to eliminate below warning.
CC sound/soc/pxa/pxa2xx-pcm.o
sound/soc/pxa/pxa2xx-pcm.c: In function 'pxa2xx_soc_pcm_new':
sound/soc/pxa/pxa2xx-pcm.c:91: warning: unused variable 'dai'
Signed-off-by: Axel Lin <axel.lin@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Stephen Warren [Tue, 5 Jul 2011 16:55:27 +0000 (10:55 -0600)]
ASoC: Tegra: Implement SPDIF CPU DAI
This is a minimal driver for the Tegra SPDIF controller.
In hardware, the SPDIF output signal is always routed to any active HDMI
display controllers, and may also be routed to external pins on Tegra
using the pinmux.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Mon, 4 Jul 2011 17:27:51 +0000 (10:27 -0700)]
ASoC: Manage WM8731 ACTIVE bit as a supply widget
Now we have supply widgets there's no need to open code the handling of
the ACTIVE bit.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Mon, 4 Jul 2011 17:27:51 +0000 (10:27 -0700)]
ASoC: Manage WM8731 ACTIVE bit as a supply widget
Now we have supply widgets there's no need to open code the handling of
the ACTIVE bit.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Tested-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Liam Girdwood <lrg@ti.com>
ASoC: Don't set invalid name string to snd_card->driver field
The snd_card->driver field contains a driver name string, and in
general it shouldn't contain space or special letters. The commit 2b39535b9e54888649923beaab443af212b6c0fd changed the string copy from
card->name, but the long name string may contain such letters, thus
it may still lead to a segfault.
A temporary fix is not to copy the long name string but just keep it
empty as the earlier version did.
Commit af46800 ("ASoC: Implement mux control sharing") revealed that
"Left Line1[L | R] Mux" and "Right Line1[L | R] Mux" widgets were pointing
to the same kcontrols and codec registers and thus soc-core falsely detected
them as shared controls. This is actually wrong since there are separate
registers in hardware that configure Line1L to RADC and Line1R to LADC cross
connects so these muxes should not be shared.
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Signed-off-by: Liam Girdwood <lrg@ti.com>
Stephen Warren [Fri, 1 Jul 2011 19:56:14 +0000 (13:56 -0600)]
ASoC: Tegra: I2S: s/clk_get_sys/clk_get/
The clock needed by the I2S driver is associated with the I2S device name
in the standard fashion. Hence, use clk_get(dev) instead of clk_get_sys(clk_name).
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Stephen Warren [Fri, 1 Jul 2011 19:56:13 +0000 (13:56 -0600)]
ASoC: Tegra: I2S: Ensure clock is enabled when writing regs
The I2S controller needs a clock to respond to register writes. Without
this, register writes will at worst hang the CPU. In practice, I've only
observed writes being dropped.
Luckily, the dropped register writes historically had no effect:
TEGRA_I2S_TIMING: The value we wrote was the reset default.
TEGRA_I2S_FIFO_SCR: The default was for the FIFOs to request more data
when one slot was empty. The requested value was for the FIFOs to request
when four slots were empty. The DMA controller in the mainline kernel is
configured to burst a single entry at a time into the FIFO, hence there
was no issue. The only negative effect was on bus efficiency losses due
to an increased number of arbitration attempts.
However, in various non-upstream changes, the DMA controller now bursts
four entries at a time into the FIFO. If there is only space for one
entry, the data is simply dropped. In practice, this resulted in 3/4 of
samples being dropped, and playback at 4x the expected rate and pitch.
By fixing the clocking issue, this is solved.
Signed-off-by: Stephen Warren <swarren@nvidia.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Mon, 13 Jun 2011 11:14:07 +0000 (12:14 +0100)]
ASoC: Fix Blackfin I2S _pointer() implementation return in bounds values
The Blackfin DMA controller can report one frame beyond the end of the
buffer in the wraparound case but ALSA requires that the pointer always
be in the buffer. Do the wraparound to handle this. A similar bug is
likely to apply to the other Blackfin PCM drivers but the code is less
obvious to inspection and I don't have a user to test.
Reported-by: Kieran O'Leary <Kieran.O'Leary@wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
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>