Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157543
b: refs/heads/master
c: af0adf3
h: refs/heads/master
i:
  157541: 4b88a9a
  157539: 8ca3eec
  157535: 60a7616
v: v3
  • Loading branch information
Troy Kisky authored and Mark Brown committed Jul 5, 2009
1 parent d1dfde2 commit 8af19a8
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 2 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: f5cfa954e6812c09e3a4b89e8009b22285b860a3
refs/heads/master: af0adf3e81dbcf782388b8a7d0d7094ef5e70f50
28 changes: 27 additions & 1 deletion trunk/sound/soc/davinci/davinci-i2s.c
Original file line number Diff line number Diff line change
Expand Up @@ -420,13 +420,29 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
return 0;
}

static int davinci_i2s_prepare(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct davinci_mcbsp_dev *dev = rtd->dai->cpu_dai->private_data;
int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
davinci_mcbsp_stop(dev, playback);
if ((dev->pcr & DAVINCI_MCBSP_PCR_FSXM) == 0) {
/* codec is master */
davinci_mcbsp_start(dev, substream);
}
return 0;
}

static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
struct snd_soc_dai *dai)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct davinci_mcbsp_dev *dev = rtd->dai->cpu_dai->private_data;
int ret = 0;
int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
if ((dev->pcr & DAVINCI_MCBSP_PCR_FSXM) == 0)
return 0; /* return if codec is master */

switch (cmd) {
case SNDRV_PCM_TRIGGER_START:
Expand All @@ -442,10 +458,18 @@ static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
default:
ret = -EINVAL;
}

return ret;
}

static void davinci_i2s_shutdown(struct snd_pcm_substream *substream,
struct snd_soc_dai *dai)
{
struct snd_soc_pcm_runtime *rtd = substream->private_data;
struct davinci_mcbsp_dev *dev = rtd->dai->cpu_dai->private_data;
int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
davinci_mcbsp_stop(dev, playback);
}

static int davinci_i2s_probe(struct platform_device *pdev,
struct snd_soc_dai *dai)
{
Expand Down Expand Up @@ -531,6 +555,8 @@ static void davinci_i2s_remove(struct platform_device *pdev,

static struct snd_soc_dai_ops davinci_i2s_dai_ops = {
.startup = davinci_i2s_startup,
.shutdown = davinci_i2s_shutdown,
.prepare = davinci_i2s_prepare,
.trigger = davinci_i2s_trigger,
.hw_params = davinci_i2s_hw_params,
.set_fmt = davinci_i2s_set_dai_fmt,
Expand Down

0 comments on commit 8af19a8

Please sign in to comment.