Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 120251
b: refs/heads/master
c: 375e8a7
h: refs/heads/master
i:
  120249: 5284896
  120247: 33187de
v: v3
  • Loading branch information
Jarkko Nikula authored and Mark Brown committed Nov 25, 2008
1 parent 5595b42 commit d0da207
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 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: 0be43050d4da08295b985cb23347ecc1003cb8d6
refs/heads/master: 375e8a7c943d5aa8716be229e398473b23709ce9
23 changes: 14 additions & 9 deletions trunk/sound/soc/omap/omap-mcbsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
struct omap_mcbsp_data *mcbsp_data = to_mcbsp(cpu_dai->private_data);
struct omap_mcbsp_reg_cfg *regs = &mcbsp_data->regs;
int dma, bus_id = mcbsp_data->bus_id, id = cpu_dai->id;
int wlen;
int wlen, channels;
unsigned long port;

if (cpu_class_is_omap1()) {
Expand Down Expand Up @@ -232,12 +232,17 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
return 0;
}

switch (params_channels(params)) {
channels = params_channels(params);
switch (channels) {
case 2:
/* Set 1 word per (McBPSP) frame and use dual-phase frames */
regs->rcr2 |= RFRLEN2(1 - 1) | RPHASE;
/* Use dual-phase frames */
regs->rcr2 |= RPHASE;
regs->xcr2 |= XPHASE;
case 1:
/* Set 1 word per (McBSP) frame */
regs->rcr2 |= RFRLEN2(1 - 1);
regs->rcr1 |= RFRLEN1(1 - 1);
regs->xcr2 |= XFRLEN2(1 - 1) | XPHASE;
regs->xcr2 |= XFRLEN2(1 - 1);
regs->xcr1 |= XFRLEN1(1 - 1);
break;
default:
Expand Down Expand Up @@ -266,8 +271,8 @@ static int omap_mcbsp_dai_hw_params(struct snd_pcm_substream *substream,
regs->srgr1 |= FWID(wlen - 1);
break;
case SND_SOC_DAIFMT_DSP_A:
regs->srgr2 |= FPER(wlen * 2 - 1);
regs->srgr1 |= FWID(wlen * 2 - 2);
regs->srgr2 |= FPER(wlen * channels - 1);
regs->srgr1 |= FWID(wlen * channels - 2);
break;
}

Expand Down Expand Up @@ -457,13 +462,13 @@ static int omap_mcbsp_dai_set_dai_sysclk(struct snd_soc_dai *cpu_dai,
.name = "omap-mcbsp-dai-"#link_id, \
.id = (link_id), \
.playback = { \
.channels_min = 2, \
.channels_min = 1, \
.channels_max = 2, \
.rates = OMAP_MCBSP_RATES, \
.formats = SNDRV_PCM_FMTBIT_S16_LE, \
}, \
.capture = { \
.channels_min = 2, \
.channels_min = 1, \
.channels_max = 2, \
.rates = OMAP_MCBSP_RATES, \
.formats = SNDRV_PCM_FMTBIT_S16_LE, \
Expand Down

0 comments on commit d0da207

Please sign in to comment.