linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: lamiaposta71@gmail.com (Raffaele Recalcati)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ASoC: DaVinci: Added support for cpu clocking I2S
Date: Wed, 30 Jun 2010 10:52:30 +0200	[thread overview]
Message-ID: <AANLkTikhqZRWYoNnZ2PSnVVpV0rUqQQyRxfz99a25EMU@mail.gmail.com> (raw)
In-Reply-To: <4C28F3D1.5060806@boundarydevices.com>

2010/6/28 Troy Kisky <troy.kisky@boundarydevices.com>

> Raffaele Recalcati wrote:
> > +             if (dev->i2s_fast_clock) {
> > +                     clk_div = 256;
> can you have
>   f = (freq / params->rate_num) * params->rate_den;
> > +                     do {
> > +                             framesize = (freq / (--clk_div)) /
> > +                                         params->rate_num *
> > +                                         params->rate_den;
> and
>                                framesize = f / (--clk_div);
> > +                     } while (((framesize < 33) || (framesize > 4095))
> &&
> > +                              (clk_div));
> > +                     clk_div--;
> looks like clk_div can go negative here, should the above while say
> (clk_div > 1)
>

> +                     } while (((framesize < 33) || (framesize > 4095)) &&
> +                              (clk_div));

only if clk_div not null stay inside the while.

> +                     clk_div--;

and here can at minumum be 0, not negative.



> > +                     srgr |= DAVINCI_MCBSP_SRGR_FPER(framesize - 1);
> > +             } else {
> > +                     /* symmetric waveforms */
> > +                     clk_div = freq / (mcbsp_word_length * 16) /
> > +                               params->rate_num * params->rate_den;
> > +                     srgr |= DAVINCI_MCBSP_SRGR_FPER(mcbsp_word_length *
> > +                                                     16 - 1);
> > +             }
> > +             clk_div &= 0xFF;
> > +             srgr |= clk_div;
>


so, dividing for (CLKGDV + 1) it is ok.

Raffaele
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20100630/574baf13/attachment.html>

      reply	other threads:[~2010-06-30  8:52 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-28  6:44 [PATCH] ASoC: DaVinci: Added support for cpu clocking I2S Raffaele Recalcati
2010-06-28 10:30 ` Mark Brown
2010-06-30  8:17   ` Raffaele Recalcati
2010-06-30 10:00     ` Raffaele Recalcati
2010-06-30 14:53     ` Mark Brown
2010-06-28 19:11 ` Troy Kisky
2010-06-30  8:52   ` Raffaele Recalcati [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AANLkTikhqZRWYoNnZ2PSnVVpV0rUqQQyRxfz99a25EMU@mail.gmail.com \
    --to=lamiaposta71@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).