lkml.org 
[lkml]   [2015]   [Jan]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [alsa-devel][PATCH v2 2/2] ASoC: wm8960: Let wm8960 driver configure its bit clock and frame clock
On Wed, Jan 14, 2015 at 07:27:03PM +0000, Mark Brown wrote:
> On Wed, Jan 07, 2015 at 03:31:45PM +0800, Zidan Wang wrote:
>
> > + for (i = 0; i < ARRAY_SIZE(dac_divs); ++i) {
> > + if (wm8960->sysclk == lrclk * dac_divs[i]) {
> > + for (j = 0; j < ARRAY_SIZE(bclk_divs); ++j) {
> > + if (wm8960->sysclk == wm8960->bclk *
> > + bclk_divs[j] / 10) {
> > + goto config_clock;
> > + }
> > + }
> > + }
> > + }
> > +
> > + dev_err(codec->dev, "Unsupported sysclk %d\n", wm8960->sysclk);
> > + return;
>
> It's a bit awkward using the goto like this. A more common way of
> writing this is to change the above block to be
>
> if (i == ARRAY_SIZE(dac_divs))
> /* return error */
>
> rather than skipping over the error. Otherwise this looks good.

Hi Mark,

I found it can't generate bclk for S20_3LE data format.

For 2 channel S20_3LE data format:

bclk = fs * 20 * 2
Sysclk = BCLKDIV * bclk = BCLKDIV * fs * 40
Sysclk = DACDIV * fs * 256

BCLKDIV/DACDIV = 256/40 = 32/5

But BCLKDIV/DACDIV can't be 32/5. So I want to support tdm slot.

bclk = fs * slot_width * slots * channal.

Do you think it make sense, or any other ideas?

Best Regards,
Zidan


\
 
 \ /
  Last update: 2015-01-15 15:21    [W:0.092 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site