Commit graph

322591 commits

Author SHA1 Message Date
Richard Zhao
f31e08e160 ASoC: imx-pcm-dma: open function failed when snd_dmaengine_pcm_open fail
snd_imx_open should return error code returned by snd_dmaengine_pcm_open.

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-18 22:52:43 -04:00
Richard Zhao
d37777a13b ASoC: imx-pcm-dma: check kzalloc return value in function snd_imx_open
It fixed smatch warning:
sound/soc/fsl/imx-pcm-dma.c:112 snd_imx_open() error: potential null dereference 'dma_data'.  (kzalloc returns null)

Signed-off-by: Richard Zhao <richard.zhao@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-18 22:52:42 -04:00
Lars-Peter Clausen
86767b7d5b 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>
2012-09-18 22:51:23 -04:00
Timur Tabi
4c2474c007 ASoC: wm8960: add support for big-endian audio samples
PowerPC ASoC drivers frequently use the _BE variants of the SNDRV_PCM_FORMAT
macros, so we need to look for those as well.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-18 22:32:44 -04:00
Timur Tabi
d55438beb2 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>
2012-09-18 22:32:44 -04:00
Timur Tabi
13c57e5b86 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>
2012-09-18 22:32:44 -04:00
Shawn Guo
d41789b266 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>
2012-09-17 07:35:08 -04:00
Lars-Peter Clausen
7f22fd9c03 ASoC: ad1836: Convert to direct regmap usage.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-13 18:08:21 +08:00
Lars-Peter Clausen
040242ccfc ASoC: ad193x: Use managed regmap init
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-13 18:08:21 +08:00
Peter Senna Tschudin
ab7af5c8d4 ASoC: core: Remove useless kfree
Remove useless kfree() and clean up code related to the removal.

The semantic patch that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
position p1,p2;
expression x;
@@

if (x@p1 == NULL) { ... kfree@p2(x); ... return ...; }

@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>
2012-09-13 12:30:33 +08:00
Mark Brown
da8b8e0f15 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>
2012-09-13 11:14:59 +08:00
Mark Brown
6b315958d3 ASoC: arizona: Clarify logging for FLL lock status interrupt
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 22:01:37 +08:00
Mark Brown
3ef8ac0d7b ASoC: wm8737: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 14:09:38 +08:00
Mark Brown
4f69bb31b8 ASoC: wm8737: Move regulator acquisition to device registration
This is better style as we acquire resources we will need before we go into
the ASoC card probe.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 14:09:37 +08:00
Mark Brown
d16383ef2a ASoC: wm8728: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 14:09:37 +08:00
Mark Brown
5aa5fa9fdb ASoC: wm8711: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 14:09:19 +08:00
Mark Brown
18273b05de ASoC: wm8580: Move regulator acquisition to I2C probe
Better style as we get all the resources we need prior to starting the
ASoC level probe.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 14:09:18 +08:00
Mark Brown
b689d9f996 ASoC: wm8580: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 14:09:16 +08:00
Mark Brown
e643049d30 ASoC: wm8510: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 14:09:05 +08:00
Mark Brown
046d4f02e8 ASoC: wm8991: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 09:36:50 +08:00
Mark Brown
587cbbb36e ASoC: wm8990: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 09:36:49 +08:00
Mark Brown
65fdd9bffa ASoC: wm8737: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 09:36:48 +08:00
Mark Brown
1a9585b0f7 ASoC: wm8728: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 09:36:47 +08:00
Mark Brown
e908ef40e4 ASoC: wm8711: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 09:36:45 +08:00
Mark Brown
398c02f6c2 ASoC: wm8580: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 09:36:44 +08:00
Mark Brown
3217b0f5b6 ASoC: wm8510: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-12 09:36:43 +08:00
Mark Brown
7e94ca4752 ASoC: wm8900: Fix typo of name to wm9700
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-11 11:26:05 +08:00
Mark Brown
499926246e ASoC: wm8900: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-11 11:26:05 +08:00
Mark Brown
6a58870df8 ASoC: wm8900: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-11 11:26:04 +08:00
Fabio Estevam
dbad34eac2 Revert "ASoC: AC97 doesn't use regmap by default"
Since commit 98d3088e5 (SoC: core: Fix check before defaulting to regmap)
, it is not necessary to provide codec->control_data anymore.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-11 11:26:03 +08:00
Fabio Estevam
4ac7903f1d ASoC: Revert "ASoC: ab8500: Inform SoC Core that we have our own I/O arrangements"
Since commit 98d3088e5 (SoC: core: Fix check before defaulting to regmap)
, it is not necessary to provide codec->control_data anymore.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-11 11:26:02 +08:00
Fabio Estevam
57d9a477f9 ASoC: Revert "ASoC: mc13783: Provide codec->control_data"
Since commit 98d3088e5 (SoC: core: Fix check before defaulting to regmap)
, it is not necessary to provide codec->control_data anymore.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-11 11:26:02 +08:00
Peter Ujfalusi
1867b2cdd8 ASoC: am3517evm: Remove unused cpu_dai from hw_params
cpu_dai is not in use in this function and just generates warning at
compile time.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-11 11:26:00 +08:00
Mark Brown
1ca6517566 ASoC: cs4270: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Timur Tabi <timur@freescale.com>
2012-09-11 08:16:15 +08:00
Mark Brown
b61d6d4032 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>
2012-09-11 08:16:11 +08:00
Mark Brown
19ace0e97a ASoC: cs4270: Conver to data based control init
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Timur Tabi <timur@freescale.com>
2012-09-11 08:16:03 +08:00
Mark Brown
0ebe36c6c4 ASoC: wm8960: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 19:31:08 +08:00
Bo Shen
a044b75779 ASoC: wm8904: remove redundant code
The core_intercon is added two times, remove the redundant one

Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 18:07:20 +08:00
Mark Brown
fe98c0cf40 ASoC: wm8741: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 18:04:42 +08:00
Mark Brown
d9780550a3 ASoC: wm8741: Move regulator acquisition to I2C/SPI probe()
Better style as we acquire resources before trying the ASoC card probe.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 18:04:40 +08:00
Kuninori Morimoto
6ac4262f36 ASoC: fsi: convert to devm_xxx()
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 17:27:05 +08:00
Kuninori Morimoto
dbd4e51cd1 ASoC: fsi: tidyup: remove un-necessary operation from fsi_probe()
struct fsi_master *master became member of struct fsi_priv from
71f6e0645b
(ASoC: sh_fsi: avoid using global variable)

So, master = NULL is not necessary on fsi_probe() now.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 17:27:05 +08:00
Kuninori Morimoto
c35e005f31 ASoC: fsi: fixup pm_runtime_disable() timing on fsi_probe()
pm_runtime_disable() error handling timing on fsi_probe() was wrong.
This patch fixes it up.

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 17:27:04 +08:00
Mark Brown
29fdf4fbbe 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>
2012-09-10 17:26:10 +08:00
Mark Brown
aff041af94 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>
2012-09-10 17:26:00 +08:00
Mark Brown
59ac2149ae ASoC: wm8523: Move device ID verification and reset to I2C probe
Ensure that we have confirmed that we've got the device in place before
we register with ASoC.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 17:25:47 +08:00
Mark Brown
b9288f49dc ASoC: wm8523: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 17:25:46 +08:00
Mark Brown
719b0c593c ASoC: wm8523: Move regulator acquisition to I2C probe()
This is better style since we acquire all needed resources before we try
to do the ASoC card probe.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 17:25:44 +08:00
Mark Brown
7d014db8ba ASoC: wm8523: Convert to devm_kzalloc()
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 17:25:41 +08:00
Mark Brown
2ee01ac63b ASoC: wm8983: Convert to direct regmap API usage
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2012-09-10 16:00:09 +08:00