Skip to content

Commit

Permalink
ASoC: spear_pcm: Update to new pcm_new() API
Browse files Browse the repository at this point in the history
Commit 552d1ef ("ASoC: core - Optimise and refactor pcm_new() to pass only
rtd") updated the pcm_new() callback to take the rtd as the only parameter. The
spear PCM driver (which was merged much later) still uses the old API. This
patch updates the driver to the new API.

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Rajeev Kumar <rajeev-dlh.kumar@st.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: stable@vger.kernel.org
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Mar 20, 2013
1 parent a937536 commit 59d9cc2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions sound/soc/spear/spear_pcm.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,26 +149,26 @@ static void spear_pcm_free(struct snd_pcm *pcm)

static u64 spear_pcm_dmamask = DMA_BIT_MASK(32);

static int spear_pcm_new(struct snd_card *card,
struct snd_soc_dai *dai, struct snd_pcm *pcm)
static int spear_pcm_new(struct snd_soc_pcm_runtime *rtd)
{
struct snd_card *card = rtd->card->snd_card;
int ret;

if (!card->dev->dma_mask)
card->dev->dma_mask = &spear_pcm_dmamask;
if (!card->dev->coherent_dma_mask)
card->dev->coherent_dma_mask = DMA_BIT_MASK(32);

if (dai->driver->playback.channels_min) {
ret = spear_pcm_preallocate_dma_buffer(pcm,
if (rtd->cpu_dai->driver->playback.channels_min) {
ret = spear_pcm_preallocate_dma_buffer(rtd->pcm,
SNDRV_PCM_STREAM_PLAYBACK,
spear_pcm_hardware.buffer_bytes_max);
if (ret)
return ret;
}

if (dai->driver->capture.channels_min) {
ret = spear_pcm_preallocate_dma_buffer(pcm,
if (rtd->cpu_dai->driver->capture.channels_min) {
ret = spear_pcm_preallocate_dma_buffer(rtd->pcm,
SNDRV_PCM_STREAM_CAPTURE,
spear_pcm_hardware.buffer_bytes_max);
if (ret)
Expand Down

0 comments on commit 59d9cc2

Please sign in to comment.