Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342919
b: refs/heads/master
c: ba764b3
h: refs/heads/master
i:
  342917: 35e1b3f
  342915: c6a70f7
  342911: 8a6ae54
v: v3
  • Loading branch information
Daniel Mack authored and Mark Brown committed Dec 7, 2012
1 parent 5974457 commit 7c772b1
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 64 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: d0c6c482f6d8c2145717ab0266c87e3e792527ef
refs/heads/master: ba764b3def0b979fd22884779f1a02f701e3af72
63 changes: 10 additions & 53 deletions trunk/sound/soc/davinci/davinci-mcasp.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,57 +619,14 @@ static int davinci_mcasp_set_sysclk(struct snd_soc_dai *dai, int clk_id,
}

static int davinci_config_channel_size(struct davinci_audio_dev *dev,
int channel_size)
int word_length)
{
u32 fmt = 0;
u32 mask, rotate;

switch (channel_size) {
case DAVINCI_AUDIO_WORD_8:
fmt = 0x03;
rotate = 6;
mask = 0x000000ff;
break;

case DAVINCI_AUDIO_WORD_12:
fmt = 0x05;
rotate = 5;
mask = 0x00000fff;
break;

case DAVINCI_AUDIO_WORD_16:
fmt = 0x07;
rotate = 4;
mask = 0x0000ffff;
break;

case DAVINCI_AUDIO_WORD_20:
fmt = 0x09;
rotate = 3;
mask = 0x000fffff;
break;

case DAVINCI_AUDIO_WORD_24:
fmt = 0x0B;
rotate = 2;
mask = 0x00ffffff;
break;

case DAVINCI_AUDIO_WORD_28:
fmt = 0x0D;
rotate = 1;
mask = 0x0fffffff;
break;

case DAVINCI_AUDIO_WORD_32:
fmt = 0x0F;
rotate = 0;
mask = 0xffffffff;
break;
u32 fmt;
u32 rotate = (32 - word_length) / 4;
u32 mask = (1ULL << word_length) - 1;

default:
return -EINVAL;
}
/* mapping of the XSSZ bit-field as described in the datasheet */
fmt = (word_length >> 1) - 1;

mcasp_mod_bits(dev->base + DAVINCI_MCASP_RXFMT_REG,
RXSSZ(fmt), RXSSZ(0x0F));
Expand Down Expand Up @@ -856,27 +813,27 @@ static int davinci_mcasp_hw_params(struct snd_pcm_substream *substream,
case SNDRV_PCM_FORMAT_U8:
case SNDRV_PCM_FORMAT_S8:
dma_params->data_type = 1;
word_length = DAVINCI_AUDIO_WORD_8;
word_length = 8;
break;

case SNDRV_PCM_FORMAT_U16_LE:
case SNDRV_PCM_FORMAT_S16_LE:
dma_params->data_type = 2;
word_length = DAVINCI_AUDIO_WORD_16;
word_length = 16;
break;

case SNDRV_PCM_FORMAT_U24_3LE:
case SNDRV_PCM_FORMAT_S24_3LE:
dma_params->data_type = 3;
word_length = DAVINCI_AUDIO_WORD_24;
word_length = 24;
break;

case SNDRV_PCM_FORMAT_U24_LE:
case SNDRV_PCM_FORMAT_S24_LE:
case SNDRV_PCM_FORMAT_U32_LE:
case SNDRV_PCM_FORMAT_S32_LE:
dma_params->data_type = 4;
word_length = DAVINCI_AUDIO_WORD_32;
word_length = 32;
break;

default:
Expand Down
10 changes: 0 additions & 10 deletions trunk/sound/soc/davinci/davinci-mcasp.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,6 @@
#define DAVINCI_MCASP_I2S_DAI 0
#define DAVINCI_MCASP_DIT_DAI 1

enum {
DAVINCI_AUDIO_WORD_8 = 0,
DAVINCI_AUDIO_WORD_12,
DAVINCI_AUDIO_WORD_16,
DAVINCI_AUDIO_WORD_20,
DAVINCI_AUDIO_WORD_24,
DAVINCI_AUDIO_WORD_32,
DAVINCI_AUDIO_WORD_28, /* This is only valid for McASP */
};

struct davinci_audio_dev {
struct davinci_pcm_dma_params dma_params[2];
void __iomem *base;
Expand Down

0 comments on commit 7c772b1

Please sign in to comment.