Commit Graph

13 Commits (28bcb112183cb822a394b155a2e7d788fe4a109a)

Author SHA1 Message Date
Anton Vorontsov 5c15a6869a ASoC: fsl_dma: Pass the proper device for dma mapping routines
The driver should pass a device that specifies internal DMA ops, but
substream->pcm is just a logical device, and thus doesn't have arch-
specific dma callbacks, therefore following bug appears:

  Freescale Synchronous Serial Interface (SSI) ASoC Driver
  ------------[ cut here ]------------
  kernel BUG at arch/powerpc/include/asm/dma-mapping.h:237!
  Oops: Exception in kernel mode, sig: 5 [#1]
  ...
  NIP [c02259c4] snd_malloc_dev_pages+0x58/0xac
  LR [c0225c74] snd_dma_alloc_pages+0xf8/0x108
  Call Trace:
  [df02bde0] [df02be2c] 0xdf02be2c (unreliable)
  [df02bdf0] [c0225c74] snd_dma_alloc_pages+0xf8/0x108
  [df02be10] [c023a100] fsl_dma_new+0x68/0x124
  [df02be20] [c02342ac] soc_new_pcm+0x1bc/0x234
  [df02bea0] [c02343dc] snd_soc_new_pcms+0xb8/0x148
  [df02bed0] [c023824c] cs4270_probe+0x34/0x124
  [df02bef0] [c0232fe8] snd_soc_instantiate_card+0x1a4/0x2f4
  [df02bf20] [c0233164] snd_soc_instantiate_cards+0x2c/0x68
  [df02bf30] [c0234704] snd_soc_register_platform+0x60/0x80
  [df02bf50] [c03d5664] fsl_soc_platform_init+0x18/0x28
  ...

This patch fixes the issue by using card's device instead.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Acked-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2009-04-06 23:35:42 +01:00
Timur Tabi a4d11fe50c 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>
2009-04-02 16:34:14 +01:00
Timur Tabi 3a638ff272 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>
2009-03-07 11:01:49 +00:00
Timur Tabi 85ef2375ef 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>
2009-02-06 12:08:15 +00:00
Takashi Iwai c9b3a40ff2 ALSA: ASoC - Fix wrong section types
The module init entries should be __init instead of __devinit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-12-10 07:47:22 +01:00
Mark Brown 958e792c7c ASoC: Register platform drivers
This is done at modprobe time, mirroring current behaviour, except for
mpc5200_psc_i2s where we do registration at the same time as we register
with soc-of-simple. Since the core currently ignores registration this
has no practical impact.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-12-09 10:49:28 +00:00
Mark Brown 875065491f ASoC: Rename snd_soc_card to snd_soc_machine
One of the issues with the ASoC v1 API which has been addressed in the
ASoC v2 work that Liam Girdwood has done is that the ALSA card provided
by ASoC is distributed around the ASoC structures. For example, machine
wide data such as the struct snd_card are maintained as part of the
CODEC data structure, preventing the use of multiple codecs. This has
been addressed by refactoring the data structures so that all the data
for the ALSA card is contained in a single structure snd_soc_card which
replaces the existing snd_soc_machine and snd_soc_device.

Begin the process of backporting this by renaming struct snd_soc_machine
to struct snd_soc_card, better reflecting its function and bringing it
closer to standard ALSA terminology.

Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2008-11-21 14:02:01 +00:00
Timur Tabi bf9c8c9dde ALSA: ASoC: fix SNDCTL_DSP_SYNC support in Freescale 8610 sound drivers
If an OSS application calls SNDCTL_DSP_SYNC, then ALSA will call the driver's
_hw_params and _prepare functions again.  On the Freescale MPC8610 DMA ASoC
driver, this caused the DMA controller to be unneccessarily re-programmed, and
apparently it doesn't like that.  The DMA will then not operate when
instructed.  This patch relocates much of the DMA programming to
fsl_dma_open(), which is called only once.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2008-08-04 12:26:23 +02:00
Timur Tabi be41e941d5 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>
2008-07-29 12:27:10 +02:00
Liam Girdwood 8cf7b2b393 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>
2008-07-10 09:32:40 +02:00
Timur Tabi acf5850ea7 [ALSA] Removed deprecated sound/driver.h from Freescale MPC8610 drivers
With commit 9004acc70e, 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>
2008-04-24 12:00:27 +02:00
Timur Tabi 4052ce4cbf [ALSA] mpc8610: Add mmap support
Enable mmap support in the MPC8610 ASoC driver.  The driver can use ALSA's
default mmap functionality, it was just not enabled previously.

Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2008-01-31 17:30:04 +01:00
Timur Tabi 17467f2339 [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>
2008-01-31 17:29:55 +01:00