History log of /sound/soc/fsl/fsl_ssi.c
Revision Date Author Comments
289c76ba6ee33daff3217881f0f4a63743ad41ab 14-Nov-2011 Timur Tabi <timur@freescale.com> ASoC: fsl_ssi: properly initialize the sysfs attribute object

commit 0f768a7235d3dfb6f4833030a95a06419df089cb upstream.

Commit 6992f533 ("sysfs: Use one lockdep class per sysfs attribute")
requires 'struct attribute' objects to be initialized with sysfs_attr_init().

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
f07eb223a081b278be02a58394cb5fd66f1a1bbd 23-Feb-2011 Grant Likely <grant.likely@secretlab.ca> dt/sound: Eliminate users of of_platform_{,un}register_driver

Get rid of users of of_platform_driver in drivers/sound. The
of_platform_{,un}register_driver functions are going away, so the
users need to be converted to using the platform_bus_type directly.

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
38fec7272bc033b75a0eb8976c56c2024d371b7d 19-Aug-2010 Timur Tabi <timur@freescale.com> ASoC: mpc8610: replace of_device with platform_device

'struct of_device' no longer exists, and its functionality has been merged
into platform_device. Update the MPC8610 HPCD audio drivers (fsl_ssi, fsl_dma,
and mpc8610_hpcd) accordingly.

Also add a #include for slab.h, which is now needed for kmalloc and kfree.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
8e9d869028f3ce13631af5ef41910ad8d8e6c246 06-Aug-2010 Timur Tabi <timur@freescale.com> asoc/multi-component: fsl: add support for variable SSI FIFO depth

Add code that programs the DMA and SSI controllers differently based on the
FIFO depth of the SSI.

The SSI devices on the MPC8610 and the P1022 are identical in every way except
one: the transmit and receive FIFO depth. On the MPC8610, the depth is eight.
On the P1022, it's fifteen. The device tree nodes for the SSI include a
"fsl,fifo-depth" property that specifies the FIFO depth.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
ff71334a46844d0ae6ff0055c549790bcd27bb10 05-Aug-2010 Timur Tabi <timur@freescale.com> asoc/multi-component: fsl: add support for disabled SSI nodes

Add support for adding "status = disabled" to an SSI node to incidate that it
is not wired on the board. This replaces the not-so-intuitive previous method
of omitting a codec-handle property.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
87a0632b29410bab5c1783d7eb979c8d942d4209 04-Aug-2010 Timur Tabi <timur@freescale.com> asoc/multi-component: fsl: fix exit and error paths in DMA and SSI drivers

The error handling code in the OF probe function of the SSI driver is not
freeing all resources correctly.

Since the machine driver no longer calls the DMA driver to provide information
about the SSI, we don't need to keep a list of DMA objects any more. In
addition, the fsl_soc_dma_remove() function is incorrectly removing *all*
DMA objects when it should only remove one.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
6e6f66226f0092a39526f8d6f02ebb447d995be2 22-Jul-2010 Timur Tabi <timur@freescale.com> powerpc: rename immap_86xx.h to fsl_guts.h, and add 85xx support

The immap_86xx.h header file only defines one data structure: the "global
utilities" register set found on Freescale PowerPC SOCs. Rename this file
to fsl_guts.h to reflect its true purpose, and extend it to cover the "GUTS"
register set on 85xx chips.

Signed-off-by: Timur Tabi <timur@freescale.com>
Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
f0fba2ad1b6b53d5360125c41953b7afcd6deff0 17-Mar-2010 Liam Girdwood <lrg@slimlogic.co.uk> ASoC: multi-component - ASoC Multi-Component Support

This patch extends the ASoC API to allow sound cards to have more than one
CODEC and more than one platform DMA controller. This is achieved by dividing
some current ASoC structures that contain both driver data and device data into
structures that only either contain device data or driver data. i.e.

struct snd_soc_codec ---> struct snd_soc_codec (device data)
+-> struct snd_soc_codec_driver (driver data)

struct snd_soc_platform ---> struct snd_soc_platform (device data)
+-> struct snd_soc_platform_driver (driver data)

struct snd_soc_dai ---> struct snd_soc_dai (device data)
+-> struct snd_soc_dai_driver (driver data)

struct snd_soc_device ---> deleted

This now allows ASoC to be more tightly aligned with the Linux driver model and
also means that every ASoC codec, platform and (platform) DAI is a kernel
device. ASoC component private data is now stored as device private data.

The ASoC sound card struct snd_soc_card has also been updated to store lists
of it's components rather than a pointer to a codec and platform. The PCM
runtime struct soc_pcm_runtime now has pointers to all its components.

This patch adds DAPM support for ASoC multi-component and removes struct
snd_soc_socdev from DAPM core. All DAPM calls are now made on a card, codec
or runtime PCM level basis rather than using snd_soc_socdev.

Other notable multi-component changes:-

* Stream operations now de-reference less structures.
* close_delayed work() now runs on a DAI basis rather than looping all DAIs
in a card.
* PM suspend()/resume() operations can now handle N CODECs and Platforms
per sound card.
* Added soc_bind_dai_link() to bind the component devices to the sound card.
* Added soc_dai_link_probe() and soc_dai_link_remove() to probe and remove
DAI link components.
* sysfs entries can now be registered per component per card.
* snd_soc_new_pcms() functionailty rolled into dai_link_probe().
* snd_soc_register_codec() now does all the codec list and mutex init.

This patch changes the probe() and remove() of the CODEC drivers as follows:-

o Make CODEC driver a platform driver
o Moved all struct snd_soc_codec list, mutex, etc initialiasation to core.
o Removed all static codec pointers (drivers now support > 1 codec dev)
o snd_soc_register_pcms() now done by core.
o snd_soc_register_dai() folded into snd_soc_register_codec().

CS4270 portions:
Acked-by: Timur Tabi <timur@freescale.com>

Some TLV320aic23 and Cirrus platform fixes.
Signed-off-by: Ryan Mallon <ryan@bluewatersys.com>

TI CODEC and OMAP fixes
Signed-off-by: Peter Ujfalusi <peter.ujfalusi@nokia.com>
Signed-off-by: Janusz Krzysztofik <jkrzyszt@tis.icnet.pl>
Signed-off-by: Jarkko Nikula <jhnikula@gmail.com>

Samsung platform and misc fixes :-
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Reviewed-by: Jassi Brar <jassi.brar@samsung.com>
Signed-off-by: Seungwhan Youn <sw.youn@samsung.com>

MPC8610 and PPC fixes.
Signed-off-by: Timur Tabi <timur@freescale.com>

i.MX fixes and some core fixes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>

J4740 platform fixes:-
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>

CC: Tony Lindgren <tony@atomide.com>
CC: Nicolas Ferre <nicolas.ferre@atmel.com>
CC: Kevin Hilman <khilman@deeprootsystems.com>
CC: Sascha Hauer <s.hauer@pengutronix.de>
CC: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
CC: Kuninori Morimoto <morimoto.kuninori@renesas.com>
CC: Daniel Gloeckner <dg@emlix.com>
CC: Manuel Lauss <mano@roarinelk.homelinux.net>
CC: Mike Frysinger <vapier.adi@gmail.com>
CC: Arnaud Patard <apatard@mandriva.com>
CC: Wan ZongShun <mcuos.com@gmail.com>

Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Liam Girdwood <lrg@slimlogic.co.uk>
5a0e3ad6af8660be21ca98a971cd00f331318c05 24-Mar-2010 Tejun Heo <tj@kernel.org> include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h

percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files. percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed. Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability. As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
only the necessary includes are there. ie. if only gfp is used,
gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
blocks and try to put the new include such that its order conforms
to its surrounding. It's put in the include block which contains
core kernel includes, in the same order that the rest are ordered -
alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
because the file doesn't have fitting include block), it prints out
an error message indicating which .h file needs to be added to the
file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
over 4000 files, deleting around 700 includes and adding ~480 gfp.h
and ~3000 slab.h inclusions. The script emitted errors for ~400
files.

2. Each error was manually checked. Some didn't need the inclusion,
some needed manual addition while adding it to implementation .h or
embedding .c file was more appropriate for others. This step added
inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
e.g. lib/decompress_*.c used malloc/free() wrappers around slab
APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
editing them as sprinkling gfp.h and slab.h inclusions around .h
files could easily lead to inclusion dependency hell. Most gfp.h
inclusion directives were ignored as stuff from gfp.h was usually
wildly available and often used in preprocessor macros. Each
slab.h inclusion directive was examined and added manually as
necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
distributed build env didn't work with gcov compiles) and a few
more options had to be turned off depending on archs to make things
build (like ipr on powerpc/64 which failed due to missing writeq).

* x86 and x86_64 UP and SMP allmodconfig and a custom test config.
* powerpc and powerpc64 SMP allmodconfig
* sparc and sparc64 SMP allmodconfig
* ia64 SMP allmodconfig
* s390 SMP allmodconfig
* alpha SMP allmodconfig
* um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
08d15f034e94251606479d7ca9070994c2e2fcf0 23-May-2009 Mark Brown <broonie@opensource.wolfsonmicro.com> ASoC: Switch FSL SSI DAI over to symmetric_rates

The effect of symmetric_constraints should provide a standard way to
enforce the use of the same sample rate for both directions.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Acked-by: Timur Tabi <timur@freescale.com>
5b740ea975c4ce3da12ac21b56f9e43354ca4327 17-May-2009 Julia Lawall <julia@diku.dk> sound: use dev_set_drvdata

Eliminate direct accesses to the driver_data field.
cf 82ab13b26f15f49be45f15ccc96bfa0b81dfd015

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
struct device *dev;
expression E;
type T;
@@

- dev->driver_data = (T)E
+ dev_set_drvdata(dev, E)

@@
struct device *dev;
type T;
@@

- (T)dev->driver_data
+ dev_get_drvdata(dev)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
d5a908b27adfd7e67b5ab98f674892badcca19c6 26-Mar-2009 Timur Tabi <timur@freescale.com> ASoC: trim SSI sysfs statistics in Freescale MPC8610 sound drivers

Optimize the display of SSI statistics in the Freescale MPC8610 sound driver
to display the status count only of the interrupts that were actually enabled.
Previously, it would display the counts of all SISR status bits, even those
that were not enabled.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
a4d11fe50c238a7da5225d1399314c3505cbd792 26-Mar-2009 Timur Tabi <timur@freescale.com> ASoC: remove trigger delay in Freescale MPC8610 sound driver

Remove the delay from the trigger function in the Freescale MPC8610 sound
driver when capture is started. This delay was used to ensure that the DMA
controller was active when ALSA call the .pointer function to request a
DMA transfer status. A better approach is for the .pointer function to detect
that DMA has not started, and return zero instead. This change eliminates
the need for the delay.

Also add some related code to check for a DMA programming error, and report
XRUN if it occurs.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
3a638ff272744247aad4a75b1fac174ac5746114 07-Mar-2009 Timur Tabi <timur@freescale.com> ASoC: Improve pause/unpause performance in Freescale 8610 drivers

Add support for true pause and unpause. Without this, mplayer will drop some
audio (less than one second, but still noticeable) when pausing playback.

Remove support for PM suspend and resume from the trigger function, since the
driver doesn't support PM anyway.

Optimize the delay after starting capture. Instead of delaying 1ms, the driver
now polls the hardware. The new delay is shorter by over 90% yet still
effective.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
a454dad19e78388d9f140ad0dfa6a849c57d385d 06-Mar-2009 Timur Tabi <timur@freescale.com> ASoC: add support for SSI asynchronous mode to the Freescale SSI drivers

Add a new device tree property for the SSI node: "fsl,ssi-asynchronous". If
defined, the SSI is programmed into asynchronous mode, otherwise it is
programmed into synchronous mode. In asynchronous mode, pin SRCK must be
connected to the same clock source as STFS, and pin SRFS must be connected to
the same signal as STFS. Asynchronous mode allows playback and capture to
use different sample sizes. It also technically allows different sample rates,
but the driver does not support that.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
6335d05548eece40092000aa91b64a50310d69d5 03-Mar-2009 Eric Miao <eric.y.miao@gmail.com> ASoC: make ops a pointer in 'struct snd_soc_dai'

Considering the fact that most cpu_dai or codec_dai are using a same
'snd_soc_dai_ops' for several similar interfaces, 'ops' would be better
made a pointer instead, to make sharing easier and code a bit cleaner.

The patch below is rather preliminary since the asoc tree is being
actively developed, and this touches almost every piece of code,
(and possibly many others in development need to be changed as
well). Building of all codecs are OK, yet to every SoC, I didn't test
that.

Signed-off-by: Eric Miao <eric.miao@marvell.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
85ef2375ef2ebbb2bf660ad3a27c644d0ebf1b1a 06-Feb-2009 Timur Tabi <timur@freescale.com> ASoC: optimize init sequence of Freescale MPC8610 sound drivers

In the Freescale MPC8610 sound drivers, relocate all code from the _prepare
functions into the corresponding _hw_params functions. These drivers assumed
that the sample size is known in the _prepare function and not in the
_hw_params function, but this is not true.

Move the code in fsl_dma_prepare() into fsl_dma_hw_param(). Create
fsl_ssi_hw_params() and move the code from fsl_ssi_prepare() into it.

Turn off snooping for DMA operations to/from I/O registers, since that's not
necessary.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
3f4b783cfdebb559814690572041a17bc9744cf3 03-Dec-2008 Mark Brown <broonie@opensource.wolfsonmicro.com> ASoC: Register platform DAIs

Register all platform DAIs with the core. In line with current behaviour
this is done at module probe time rather than when the devices are probed
(since currently that only happens as the entire ASoC card is registered
except for those drivers that currently implement some kind of hotplug).
Since the core currently ignores DAI registration this has no practical
effect.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
dee89c4d94433520e4e3977ae203d4cfbfe385fb 18-Nov-2008 Mark Brown <broonie@opensource.wolfsonmicro.com> ASoC: Merge snd_soc_ops into snd_soc_dai_ops

Liam Girdwood's ASoC v2 work avoids having two different ops structures
for DAIs by merging the members of struct snd_soc_ops into struct
snd_soc_dai_ops, allowing per DAI configuration for everything.
Backport this change.

This paves the way for future work allowing any combination of DAIs to
be connected rather than having fixed purpose CODEC and CPU DAIs and
only allowing CODEC<->CPU interconnections.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
be41e941d5f1a48bde7f44d09d56e8d2605f98e1 29-Jul-2008 Timur Tabi <timur@freescale.com> ALSA: asoc: restrict sample rate and size in Freescale MPC8610 sound drivers

The Freescale MPC8610 SSI device has the option of using one clock for both
transmit and receive (synchronous mode), or independent clocks (asynchronous).
The SSI driver, however, programs the SSI into synchronous mode and then
tries to program the clock registers independently. The result is that the wrong
sample size is usually generated during recording.

This patch fixes the discrepancy by restricting the sample rate and sample size
of the playback and capture streams. The SSI driver remembers which stream
is opened first. When a second stream is opened, that stream is constrained
to the same sample rate and size as the first stream.

A future version of this driver will lift the sample size restriction.
Supporting independent sample rates is more difficult, because only certain
codecs provide dual independent clocks.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
8cf7b2b393b26b9ba1ccbeeb271a88e51d58f3e3 07-Jul-2008 Liam Girdwood <lg@opensource.wolfsonmicro.com> ALSA: asoc: fsl - merge structs snd_soc_codec_dai and snd_soc_cpu_dai.

This patch merges struct snd_soc_codec_dai and struct
snd_soc_cpu_dai into struct snd_soc_dai for the Freescale PPC platform.

Signed-off-by: Liam Girdwood <lg@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
3a3bd960a0b7bb26604b1270a8b4cafdc5883040 09-May-2008 Anton Vorontsov <avorontsov@ru.mvista.com> [ALSA] soc - fsl_ssi.c fix "BUG: scheduling while atomic"

This patch fixes following bug caught with PREEMPT enabled:

root@b1:~# cat /dev/dsp > /dev/null
BUG: scheduling while atomic: cat/965/0x00000003
Call Trace:
[df165ce0] [c0008e84] show_stack+0x4c/0x1ac (unreliable)
[df165d20] [c001c18c] __schedule_bug+0x64/0x78
[df165d30] [c02b3344] schedule+0x2d8/0x334
[df165d70] [c02b3674] schedule_timeout+0x64/0xe4
[df165db0] [c002c05c] msleep+0x1c/0x34
[df165dc0] [c01f2fe0] fsl_ssi_trigger+0x130/0x144
[df165dd0] [c01ece54] soc_pcm_trigger+0x94/0xb8
[df165df0] [c01da764] snd_pcm_do_start+0x48/0x60
[df165e00] [c01da630] snd_pcm_action_single+0x4c/0xb4
[df165e20] [c01e0f50] snd_pcm_lib_read1+0x2a0/0x2d4
[df165e70] [c01ec274] snd_pcm_oss_read3+0xf0/0x13c
[df165eb0] [c01ec2e4] snd_pcm_oss_read2+0x24/0x4c
[df165ec0] [c01ec4ac] snd_pcm_oss_read+0x1a0/0x1f0
[df165ef0] [c0076478] vfs_read+0xb4/0x108
[df165f10] [c00768cc] sys_read+0x4c/0x90
[df165f40] [c00117a4] ret_from_syscall+0x0/0x38

Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
acf5850ea73bf82081fb65cf10dd36a9d7a890e9 18-Mar-2008 Timur Tabi <timur@freescale.com> [ALSA] Removed deprecated sound/driver.h from Freescale MPC8610 drivers

With commit 9004acc70e8c49c50c4c7b652f906f1e0ed5709d, include/sound/driver.h
is deprecated. This patch removes the #include from fsl_ssi.c and fsl_dma.c.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
17467f23395f05ba7b361f7b504fe0f1095d5bb7 11-Jan-2008 Timur Tabi <timur@freescale.com> [ALSA] Add ASoC drivers for the Freescale MPC8610 SoC

Add the ASoC drivers for the Freescale MPC8610 SoC and the MPC8610 HPCD
reference board.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>