Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 293406
b: refs/heads/master
c: 91a3854
h: refs/heads/master
v: v3
  • Loading branch information
Lars-Peter Clausen authored and Mark Brown committed Feb 22, 2012
1 parent bccdc4b commit 236fda5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: f7085641eeaeaab5216bab143287d2288940d9a2
refs/heads/master: 91a38540f504cdde7cb62668f7a6d52e3bd0178b
28 changes: 20 additions & 8 deletions trunk/sound/soc/imx/imx-ssi.c
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,23 @@ static int imx_ssi_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
return 0;
}

static int imx_ssi_startup(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai);
struct imx_pcm_dma_params *dma_data;

/* Tx/Rx config */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
dma_data = &ssi->dma_params_tx;
else
dma_data = &ssi->dma_params_rx;

snd_soc_dai_set_dma_data(cpu_dai, substream, dma_data);

return 0;
}

/*
* Should only be called when port is inactive (i.e. SSIEN = 0),
* although can be called multiple times by upper layers.
Expand All @@ -242,23 +259,17 @@ static int imx_ssi_hw_params(struct snd_pcm_substream *substream,
struct snd_soc_dai *cpu_dai)
{
struct imx_ssi *ssi = snd_soc_dai_get_drvdata(cpu_dai);
struct imx_pcm_dma_params *dma_data;
u32 reg, sccr;

/* Tx/Rx config */
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) {
if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK)
reg = SSI_STCCR;
dma_data = &ssi->dma_params_tx;
} else {
else
reg = SSI_SRCCR;
dma_data = &ssi->dma_params_rx;
}

if (ssi->flags & IMX_SSI_SYN)
reg = SSI_STCCR;

snd_soc_dai_set_dma_data(cpu_dai, substream, dma_data);

sccr = readl(ssi->base + reg) & ~SSI_STCCR_WL_MASK;

/* DAI data (word) size */
Expand Down Expand Up @@ -343,6 +354,7 @@ static int imx_ssi_trigger(struct snd_pcm_substream *substream, int cmd,
}

static const struct snd_soc_dai_ops imx_ssi_pcm_dai_ops = {
.startup = imx_ssi_startup,
.hw_params = imx_ssi_hw_params,
.set_fmt = imx_ssi_set_dai_fmt,
.set_clkdiv = imx_ssi_set_dai_clkdiv,
Expand Down

0 comments on commit 236fda5

Please sign in to comment.