Peter Ujfalusi [Mon, 10 Sep 2012 10:46:25 +0000 (13:46 +0300)]
mfd: twl4030-audio: Add DT support
Support for loading the twl4030 audio module via devicetree.
Sub devices for codec and vibra will be created as mfd devices once the
core MFD driver is loaded when the kernel is booted with a DT blob.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Sep 2012 10:46:23 +0000 (13:46 +0300)]
mfd: twl4030-audio: Get audio MCLK via twl-core API instead of pdata
twl-core has API to get the boot time configured HFCLK rate which has the
same rate as the audio MCLK.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Sep 2012 10:46:22 +0000 (13:46 +0300)]
mfd: twl-core: Add API to query the HFCLK rate
CFG_BOOT register's HFCLK_FREQ field hold information about the used HFCLK
frequency.
Add possibility for users to get the configured rate based on this
register.
This register was configured during boot, without it the chip would not
operate correctly, so we can trust on this information.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Sep 2012 10:46:21 +0000 (13:46 +0300)]
mfd: twl4030-audio: Rearange and clean-up the probe function
To facilitate the device tree support the probe function need to be rearanged.
Small cleanup in the APLL frequency selection part as well.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Sep 2012 10:46:20 +0000 (13:46 +0300)]
mfd: twl4030-audio: Convert to use devm_kzalloc
To clean up the module probe and remove functions.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Mon, 10 Sep 2012 10:46:19 +0000 (13:46 +0300)]
mfd: twl4030-audio: Clean up MODULE_* and platform_driver part
Place the MODULE_* lines in the same block and add MODULE_DESCRIPTION.
Rearange the platform_driver structure at the same time.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:58 +0000 (15:05 +0300)]
ASoC: omap-pcm: Convert to use dmaengine
Original author: Russell King <rmk+kernel@arm.linux.org.uk>
Switch the omap-pcm to use dmaengine.
Certain features are not supported by after dmaengine conversion:
1. No period wakeup mode
DMA engine has no way to communicate this information through
standard channels.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:57 +0000 (15:05 +0300)]
ASoC: OMAP: mcbsp, mcpdm, dmic, hdmi: Set dma_data at startup time
Set the dma_data for the stream (snd_soc_dai_set_dma_data) at dai_startup
time so omap-pcm will have access to the needed information regarding to
the DMA channel earlier.
This is needed for the clean dmaengine support.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:56 +0000 (15:05 +0300)]
ASoC: omap-pcm, omap-dmic: Change the use of omap_pcm_dma_data->data_type
Instead of the OMAP DMA data type definition the data_type will be used to
specify the number of bits the DMA word should be configured or 0 in case
when based on the stream's format the omap-pcm can decide the needed DMA
word size.
This feature is needed for the omap-hdmi where the sDMA need to be
configured for 32bit word type regardless of the audio format used.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:55 +0000 (15:05 +0300)]
ASoC: OMAP: mcbsp, mcpdm, dmic: Let omap-pcm to pick the dma_type
omap-pcm can figure out the correct dma_type based on the stream's format.
In this way we can get rid of the plat/dma.h include from these drivers.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:54 +0000 (15:05 +0300)]
ASoC: omap-mcpdm: Use platform_get_resource_* to get resources
Get the needed resources in a correct way and avoid using defines for them.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:53 +0000 (15:05 +0300)]
ARM: OMAP4: hwmod_data: Add resource names to McPDM memory ranges
To help the driver to get the correct memory range to access McPDM
registers.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:52 +0000 (15:05 +0300)]
ASoC: omap-pcm: Prepare to configure the DMA data_type based on stream properties
Based on the format of the stream the omap-pcm can decide alone what data
type should be used with by the sDMA.
Keep the possibility for OMAP dai drivers to tell omap-pcm if they want to
use different data type. This is needed for the omap-hdmi for example which
needs 32bit data type even if the stream format is S16_LE.
The check if (dma_data->data_type) is safe at the moment since omap-pcm
does not support 8bit samples (OMAP_DMA_DATA_TYPE_S8 == 0x00).
The next step is to redefine the meaning of dma_data->data_type to unblock
this limitation.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:51 +0000 (15:05 +0300)]
ASoC: OMAP: Remove sync_mode from omap_pcm_dma_data struct
The omap-pcm platform driver no longer needs this parameter to select
between ELEMENT and PACKET mode. The selection is based on the configured
packet_size.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:50 +0000 (15:05 +0300)]
ASoC: omap-pcm: Select sDMA synchronization based on packet_size
Since we only have element or packet synchronization we can use the
dma_data->packet_size to select the desired mode:
if packet_size is 0 we use ELEMENT mode
if packet_size is not 0 we use PACKET mode for sDMA synchronization.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:49 +0000 (15:05 +0300)]
ASoC: omap-mcbsp: Use sDMA packet mode instead of frame mode
When McBSP is configured in threshold mode we can use sDMA packet mode in
all cases.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:48 +0000 (15:05 +0300)]
dmaengine: omap-dma: Add support to suppress interrupts in cyclic mode
When requested (DMA_PREP_INTERRUPT is cleared in flags) disable all DMA
interrupts for the channel. In this mode user space does not expect
periodic reports from kernel about the progress of the audio stream.
PulseAudio for example support this type of mode.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:47 +0000 (15:05 +0300)]
dmaengine: Pass flags via device_prep_dma_cyclic() callback
Change the parameter list of device_prep_dma_cyclic() so the DMA drivers
can receive the flags coming from clients.
This feature can be used during audio operation to disable all audio
related interrupts when the DMA_PREP_INTERRUPT is cleared from the flags.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Nicolas Ferre <nicolas.ferre@atmel.com> Acked-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:45 +0000 (15:05 +0300)]
dmaengine: omap: Add support for pause/resume in cyclic dma mode
The audio stack used omap_stop_dma/omap_start_dma to pause/resume the DMA.
This method has been used for years on OMAP based products.
We only allow pause/resume when the DMA has been configured in cyclic mode
which is used by the audio stack.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Fri, 14 Sep 2012 12:05:44 +0000 (15:05 +0300)]
dmaengine: omap: Support for element mode in cyclic DMA
When src_maxburst/dst_maxburst is set to 0 by the users of cyclic DMA
(mostly audio) indicates that we should configure the omap DMA to element
sync mode instead of packet mode.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Acked-by: Vinod Koul <vinod.koul@linux.intel.com> Tested-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Eric Millbrandt [Thu, 20 Sep 2012 14:36:44 +0000 (10:36 -0400)]
ASoC: fsl: pcm030-audio-fabric use snd_soc_register_card
Convert pcm030-audio-fabric to use the new snd_soc_register_card api
instead of the older method of registering a separate platform device.
Create the dai_link to the mpc5200_psc_ac97 platform using the device tree.
Convert the pcm030-audio-fabric driver to a platform-driver and add a
remove function.
Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Thu, 20 Sep 2012 13:32:15 +0000 (16:32 +0300)]
ASoC: twl6040: Convert to use DAI DAPM widgets
Use DAPM mapping for stream events and give unique names for the streams.
This change also fixes the following warning:
twl6040-codec twl6040-codec: Failed to create Capture debugfs file
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Thu, 20 Sep 2012 13:32:02 +0000 (16:32 +0300)]
ASoC: twl4030: Convert to use DAI DAPM widgets
Use DAPM mapping for stream events and give unique names for the streams.
This change also fixes the following warning:
twl4030-codec twl4030-codec: Failed to create Capture debugfs file
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Timur Tabi [Thu, 20 Sep 2012 18:57:27 +0000 (13:57 -0500)]
ASoC: wm8960: remove 'dres' field from platform data structure
The 'dres' field (discharge resistance for headphone outputs) is no longer
used in the driver, so remove it.
It was used in the original version of the driver when entering standby
from off, but we stopped using it when we switched from having a single
startup sequence to having separate cap and capless sequences.
Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Thu, 13 Sep 2012 03:46:58 +0000 (11:46 +0800)]
ASoC: wm8960: Support shared LRCLK
If the LRCLK is shared and the WM8960 is clock master then we should
enable the LRCM bit to tell the device that it should drive LRCLK when
either ADC or DAC is enabled rather than separately driving the two
LRCLKs.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Eric Millbrandt [Thu, 13 Sep 2012 21:43:12 +0000 (17:43 -0400)]
ASoC: fsl: mpc5200 add missing information to snd_soc_dai_driver
Add missing dai_driver information to avoid these runtime errors
[ 16.433788] asoc: error - multiple DAI f0002c00.i2s registered with no name
[ 16.453551] Failed to register DAI
[ 16.461222] mpc5200-psc-i2s: probe of f0002c00.i2s failed with error -22
[ 16.475242] asoc: error - multiple DAI f0002000.ac97 registered with no name
[ 16.488087] mpc5200-psc-ac97 f0002000.ac97: Failed to register DAI
[ 16.502222] mpc5200-psc-ac97: probe of f0002000.ac97 failed with error -22
Signed-off-by: Eric Millbrandt <emillbrandt@dekaresearch.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: Avoid recalculating the bitmask for SOC_ENUM controls
For ENUM controls the bitmask is calculated based on the number of items.
Currently this is done each time the control is accessed. And while the
performance impact of this should be negligible we can easily do better. The
roundup_pow_of_two macro performs the same calculation which is currently done
manually, but it is also possible to use this macro with compile time constants
and so it can be used to initialize static data. So we can use it to initialize
the mask field of a ENUM control during its declaration.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Timur Tabi [Fri, 14 Sep 2012 21:14:36 +0000 (16:14 -0500)]
ASoC: fsl: remove unnecessary call to dma_unmap_single
Remove a call to dma_unmap_single() from the PowerPC ASoC DMA driver. The
buffer is allocated and not actually mapped, so the unmap call doesn't
make sense. It was probably left over from some early version of the driver.
This bug was unnoticed for so long because the DMA mapping functions normally
don't do anything on PowerPC.
Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Timur Tabi [Fri, 14 Sep 2012 21:14:34 +0000 (16:14 -0500)]
ASoC: fsl: use snd_soc_register_card to register the card
Use snd_soc_register_card() instead of platform_device_alloc("soc-audio")
to register the sound card from the machine drivers. The use of
platform_device_alloc is deprecated.
Although several other drivers still use platform_device_alloc(), the
Freescale drivers were not using it to pass driver data. Instead of fixing
the driver data usage, it's better to replace the deprecated code.
Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
ASoC: mx27vis: retrieve gpio numbers from platform_data
Rather than including mach/iomux-mx27.h to define gpio numbers and set
up the pins, the patch moves all these into machine code and has the
gpio numbers passed to driver via platform_data. As the result, we
can remove the mach/iomux-mx27.h inclusion from driver.
Signed-off-by: Shawn Guo <shawn.guo@linaro.org> Acked-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
@unchanged exists@
position r.p1,r.p2;
expression e <= r.x,x,e1;
iterator I;
statement S;
@@
if (x@p1 == NULL) { ... when != I(x,...) S
when != e = e1
when != e += e1
when != e -= e1
when != ++e
when != --e
when != e++
when != e--
when != &e
kfree@p2(x); ... return ...; }
@ok depends on unchanged exists@
position any r.p1;
position r.p2;
expression x;
@@
... when != true x@p1 == NULL
kfree@p2(x);
@depends on !ok && unchanged@
position r.p2;
expression x;
@@
*kfree@p2(x);
// </smpl>
Signed-off-by: Peter Senna Tschudin <peter.senna@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Wed, 12 Sep 2012 04:21:52 +0000 (12:21 +0800)]
ASoC: core: Mark regmap CODEC register maps as dirty when suspending
The core has for a long time had support for marking the register maps of
devices dirty when suspending so that they are resynced on resume. Also
implement this feature for CODECs using regmap.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
Mark Brown [Mon, 10 Sep 2012 04:53:12 +0000 (12:53 +0800)]
ASoC: cs4270: Move regulator acquisition to I2C probe()
This is better style since it has us obtaining all resources before we
try the ASoC probe. This change also fixes a potential issue where we
don't enable the regulators before trying to confirm the device ID which
could cause a failure during probe in some system configurations.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Timur Tabi <timur@freescale.com>
Mark Brown [Mon, 10 Sep 2012 02:59:56 +0000 (10:59 +0800)]
ASoC: sta32x: Convert to regmap
Long term all drivers should be using regmap directly. This is more
idiomatic and moves us towards the removal of the ASoC level cache
code.
The initialiasation of reserved register bits in probe() is slightly odd
as the defaults being written don't appear to match the silicon defaults
but the new code should have the same effect as the old code.
The watchdog code will now unconditionally do a mute and unmute when
resyncing but since we only sync when we are very sure there is something
to sync this should have no impact.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Johannes Stezenbach <js@sig21.net>
Mark Brown [Mon, 10 Sep 2012 02:59:51 +0000 (10:59 +0800)]
ASoC: sta32x: Move regulator acquisition to I2C probe
This is better style as it ensures we don't try to do the ASoC probe
without required resources. Also convert to devm_ while we're at it,
saving a bit of code, and fix a leak of enable on error.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Johannes Stezenbach <js@sig21.net>
The bug this patch is meant to solve doesn't occur in Visstrim_M10 boards.
Furthermore, after applying this patch sound in Visstrim_M10 is played
at slower rates.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Mark Brown [Sat, 1 Sep 2012 00:38:32 +0000 (17:38 -0700)]
ASoC: dapm: Ensure bypass paths are suspended and resumed
Since bypass paths aren't part of DAPM streams and we may not have any
DAPM streams there may not be anything that triggers a DAPM sync for
them. Mark all input and output widgets as dirty and then sync to do so
at the end of suspend and resume.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Liam Girdwood <lrg@ti.com>
ASoC: Davinci: McASP: add support new McASP IP Variant
The OMAP2+ variant of McASP is different from Davinci variant w.r.to
some register offset.
Changes
- Add new MCASP_VERSION_3 to identify new variant. New DT compatible
"ti,omap2-mcasp-audio" to identify version 3 controller.
- The register offsets are handled depending on the version.
Note:
DMA parameters (dma fifo offset) are not updated and will be done later.
Signed-off-by: Hebbar, Gururaja <gururaja.hebbar@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
+ sound/soc/codecs/wm0010.c:850:7-27: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT
--
+ sound/soc/codecs/wm0010.c:660:1-7: preceding lock on line 359
vim +850 sound/soc/codecs/wm0010.c
847 trigger = IRQF_TRIGGER_FALLING;
848 trigger |= IRQF_ONESHOT;
849
> 850 ret = request_threaded_irq(irq, NULL, wm0010_irq, trigger,
851 "wm0010", wm0010);
852 if (ret)
853 dev_err(wm0010->dev, "Failed to request IRQ %d: %d\n",
Please consider folding the attached diff :-)
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Peter Ujfalusi [Thu, 30 Aug 2012 14:06:15 +0000 (17:06 +0300)]
ASoC: omap-mcbsp: Fix compilation error due to leftover code
Part of commit (which patches sound/soc/omap/mcbsp.c file): 8fef626 ARM/ASoC: omap-mcbsp: Remove CLKR/FSR mux configuration code
since the tree where it has been applied did not had the earlier patch: d0db84e ASoC: omap-mcbsp: Fix 6pin mux configuration
which changed code around omap_mcbsp_6pin_src_mux().
Because of the missing part from 8fef626 the sound/soc/omap/mcbsp.c does
not compile in linux-next.
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>