diff options
Diffstat (limited to 'sound/soc/davinci/davinci-mcasp.c')
-rw-r--r-- | sound/soc/davinci/davinci-mcasp.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index a5af834c8ef5..4ddc6d3b6678 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c | |||
@@ -434,17 +434,21 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
434 | mcasp_set_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE); | 434 | mcasp_set_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE); |
435 | mcasp_set_bits(base + DAVINCI_MCASP_RXFMCTL_REG, AFSRE); | 435 | mcasp_set_bits(base + DAVINCI_MCASP_RXFMCTL_REG, AFSRE); |
436 | 436 | ||
437 | mcasp_set_bits(base + DAVINCI_MCASP_PDIR_REG, (0x7 << 26)); | 437 | mcasp_set_bits(base + DAVINCI_MCASP_PDIR_REG, |
438 | ACLKX | AHCLKX | AFSX); | ||
438 | break; | 439 | break; |
439 | case SND_SOC_DAIFMT_CBM_CFS: | 440 | case SND_SOC_DAIFMT_CBM_CFS: |
440 | /* codec is clock master and frame slave */ | 441 | /* codec is clock master and frame slave */ |
441 | mcasp_set_bits(base + DAVINCI_MCASP_ACLKXCTL_REG, ACLKXE); | 442 | mcasp_clr_bits(base + DAVINCI_MCASP_ACLKXCTL_REG, ACLKXE); |
442 | mcasp_set_bits(base + DAVINCI_MCASP_TXFMCTL_REG, AFSXE); | 443 | mcasp_set_bits(base + DAVINCI_MCASP_TXFMCTL_REG, AFSXE); |
443 | 444 | ||
444 | mcasp_set_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE); | 445 | mcasp_clr_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE); |
445 | mcasp_set_bits(base + DAVINCI_MCASP_RXFMCTL_REG, AFSRE); | 446 | mcasp_set_bits(base + DAVINCI_MCASP_RXFMCTL_REG, AFSRE); |
446 | 447 | ||
447 | mcasp_set_bits(base + DAVINCI_MCASP_PDIR_REG, (0x2d << 26)); | 448 | mcasp_clr_bits(base + DAVINCI_MCASP_PDIR_REG, |
449 | ACLKX | ACLKR); | ||
450 | mcasp_set_bits(base + DAVINCI_MCASP_PDIR_REG, | ||
451 | AFSX | AFSR); | ||
448 | break; | 452 | break; |
449 | case SND_SOC_DAIFMT_CBM_CFM: | 453 | case SND_SOC_DAIFMT_CBM_CFM: |
450 | /* codec is clock and frame master */ | 454 | /* codec is clock and frame master */ |
@@ -454,7 +458,8 @@ static int davinci_mcasp_set_dai_fmt(struct snd_soc_dai *cpu_dai, | |||
454 | mcasp_clr_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE); | 458 | mcasp_clr_bits(base + DAVINCI_MCASP_ACLKRCTL_REG, ACLKRE); |
455 | mcasp_clr_bits(base + DAVINCI_MCASP_RXFMCTL_REG, AFSRE); | 459 | mcasp_clr_bits(base + DAVINCI_MCASP_RXFMCTL_REG, AFSRE); |
456 | 460 | ||
457 | mcasp_clr_bits(base + DAVINCI_MCASP_PDIR_REG, (0x3f << 26)); | 461 | mcasp_clr_bits(base + DAVINCI_MCASP_PDIR_REG, |
462 | ACLKX | AHCLKX | AFSX | ACLKR | AHCLKR | AFSR); | ||
458 | break; | 463 | break; |
459 | 464 | ||
460 | default: | 465 | default: |
@@ -644,7 +649,7 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) | |||
644 | mcasp_set_reg(dev->base + DAVINCI_MCASP_TXTDM_REG, mask); | 649 | mcasp_set_reg(dev->base + DAVINCI_MCASP_TXTDM_REG, mask); |
645 | mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXORD); | 650 | mcasp_set_bits(dev->base + DAVINCI_MCASP_TXFMT_REG, TXORD); |
646 | 651 | ||
647 | if ((dev->tdm_slots >= 2) || (dev->tdm_slots <= 32)) | 652 | if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32)) |
648 | mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, | 653 | mcasp_mod_bits(dev->base + DAVINCI_MCASP_TXFMCTL_REG, |
649 | FSXMOD(dev->tdm_slots), FSXMOD(0x1FF)); | 654 | FSXMOD(dev->tdm_slots), FSXMOD(0x1FF)); |
650 | else | 655 | else |
@@ -660,7 +665,7 @@ static void davinci_hw_param(struct davinci_audio_dev *dev, int stream) | |||
660 | AHCLKRE); | 665 | AHCLKRE); |
661 | mcasp_set_reg(dev->base + DAVINCI_MCASP_RXTDM_REG, mask); | 666 | mcasp_set_reg(dev->base + DAVINCI_MCASP_RXTDM_REG, mask); |
662 | 667 | ||
663 | if ((dev->tdm_slots >= 2) || (dev->tdm_slots <= 32)) | 668 | if ((dev->tdm_slots >= 2) && (dev->tdm_slots <= 32)) |
664 | mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG, | 669 | mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMCTL_REG, |
665 | FSRMOD(dev->tdm_slots), FSRMOD(0x1FF)); | 670 | FSRMOD(dev->tdm_slots), FSRMOD(0x1FF)); |
666 | else | 671 | else |