aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/davinci/davinci-i2s.c
diff options
context:
space:
mode:
authorTroy Kisky <troy.kisky@boundarydevices.com>2009-07-04 22:29:53 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-07-05 07:59:07 -0400
commitf9af37cc632b59c39768329797443308ad6b4137 (patch)
treed8cad1bb94d36e34cbd01022284752cff857ccff /sound/soc/davinci/davinci-i2s.c
parentc392bec716431d77e503345117a3e7ad3face677 (diff)
ASoc: DaVinci: i2s, minor cleanup
Add davinci_mcbsp_dev as argument to davinci_mcbsp_start and davinci_mcbsp_stop. Signed-off-by: Troy Kisky <troy.kisky@boundarydevices.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/davinci/davinci-i2s.c')
-rw-r--r--sound/soc/davinci/davinci-i2s.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c
index dd44167a90f0..f7d7e4c30764 100644
--- a/sound/soc/davinci/davinci-i2s.c
+++ b/sound/soc/davinci/davinci-i2s.c
@@ -130,10 +130,10 @@ static void toggle_clock(struct davinci_mcbsp_dev *dev, int playback)
130 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, dev->pcr); 130 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_PCR_REG, dev->pcr);
131} 131}
132 132
133static void davinci_mcbsp_start(struct snd_pcm_substream *substream) 133static void davinci_mcbsp_start(struct davinci_mcbsp_dev *dev,
134 struct snd_pcm_substream *substream)
134{ 135{
135 struct snd_soc_pcm_runtime *rtd = substream->private_data; 136 struct snd_soc_pcm_runtime *rtd = substream->private_data;
136 struct davinci_mcbsp_dev *dev = rtd->dai->cpu_dai->private_data;
137 struct snd_soc_device *socdev = rtd->socdev; 137 struct snd_soc_device *socdev = rtd->socdev;
138 struct snd_soc_platform *platform = socdev->card->platform; 138 struct snd_soc_platform *platform = socdev->card->platform;
139 int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK); 139 int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
@@ -202,12 +202,9 @@ static void davinci_mcbsp_start(struct snd_pcm_substream *substream)
202 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr); 202 davinci_mcbsp_write_reg(dev, DAVINCI_MCBSP_SPCR_REG, spcr);
203} 203}
204 204
205static void davinci_mcbsp_stop(struct snd_pcm_substream *substream) 205static void davinci_mcbsp_stop(struct davinci_mcbsp_dev *dev, int playback)
206{ 206{
207 struct snd_soc_pcm_runtime *rtd = substream->private_data;
208 struct davinci_mcbsp_dev *dev = rtd->dai->cpu_dai->private_data;
209 u32 spcr; 207 u32 spcr;
210 int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
211 208
212 /* Reset transmitter/receiver and sample rate/frame sync generators */ 209 /* Reset transmitter/receiver and sample rate/frame sync generators */
213 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG); 210 spcr = davinci_mcbsp_read_reg(dev, DAVINCI_MCBSP_SPCR_REG);
@@ -427,18 +424,21 @@ static int davinci_i2s_hw_params(struct snd_pcm_substream *substream,
427static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd, 424static int davinci_i2s_trigger(struct snd_pcm_substream *substream, int cmd,
428 struct snd_soc_dai *dai) 425 struct snd_soc_dai *dai)
429{ 426{
427 struct snd_soc_pcm_runtime *rtd = substream->private_data;
428 struct davinci_mcbsp_dev *dev = rtd->dai->cpu_dai->private_data;
430 int ret = 0; 429 int ret = 0;
430 int playback = (substream->stream == SNDRV_PCM_STREAM_PLAYBACK);
431 431
432 switch (cmd) { 432 switch (cmd) {
433 case SNDRV_PCM_TRIGGER_START: 433 case SNDRV_PCM_TRIGGER_START:
434 case SNDRV_PCM_TRIGGER_RESUME: 434 case SNDRV_PCM_TRIGGER_RESUME:
435 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 435 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
436 davinci_mcbsp_start(substream); 436 davinci_mcbsp_start(dev, substream);
437 break; 437 break;
438 case SNDRV_PCM_TRIGGER_STOP: 438 case SNDRV_PCM_TRIGGER_STOP:
439 case SNDRV_PCM_TRIGGER_SUSPEND: 439 case SNDRV_PCM_TRIGGER_SUSPEND:
440 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 440 case SNDRV_PCM_TRIGGER_PAUSE_PUSH:
441 davinci_mcbsp_stop(substream); 441 davinci_mcbsp_stop(dev, playback);
442 break; 442 break;
443 default: 443 default:
444 ret = -EINVAL; 444 ret = -EINVAL;