Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 342920
b: refs/heads/master
c: 1b3bc06
h: refs/heads/master
v: v3
  • Loading branch information
Daniel Mack authored and Mark Brown committed Dec 7, 2012
1 parent 7c772b1 commit 5990bd6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ba764b3def0b979fd22884779f1a02f701e3af72
refs/heads/master: 1b3bc060fb008ddd75fe60c876c24784a517c10c
15 changes: 15 additions & 0 deletions trunk/sound/soc/davinci/davinci-mcasp.c
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,10 @@ static int davinci_mcasp_set_clkdiv(struct snd_soc_dai *dai, int div_id, int div
ACLKRDIV(div - 1), ACLKRDIV_MASK);
break;

case 2: /* BCLK/LRCLK ratio */
dev->bclk_lrclk_ratio = div;
break;

default:
return -EINVAL;
}
Expand Down Expand Up @@ -625,6 +629,17 @@ static int davinci_config_channel_size(struct davinci_audio_dev *dev,
u32 rotate = (32 - word_length) / 4;
u32 mask = (1ULL << word_length) - 1;

/*
* if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv()
* callback, take it into account here. That allows us to for example
* send 32 bits per channel to the codec, while only 16 of them carry
* audio payload.
* The clock ratio is given for a full period of data (both left and
* right channels), so it has to be divided by 2.
*/
if (dev->bclk_lrclk_ratio)
word_length = dev->bclk_lrclk_ratio / 2;

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

Expand Down
1 change: 1 addition & 0 deletions trunk/sound/soc/davinci/davinci-mcasp.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct davinci_audio_dev {
u8 num_serializer;
u8 *serial_dir;
u8 version;
u8 bclk_lrclk_ratio;

/* McASP FIFO related */
u8 txnumevt;
Expand Down

0 comments on commit 5990bd6

Please sign in to comment.