public inbox for linux-omap@vger.kernel.org
 help / color / mirror / Atom feed
* Possible error in omap16xxcam_set_xclk?
@ 2006-06-13 15:07 Matt Callow
  2006-06-13 20:52 ` Matt Callow
  0 siblings, 1 reply; 2+ messages in thread
From: Matt Callow @ 2006-06-13 15:07 UTC (permalink / raw)
  To: linux-omap-open-source

  Hi,

I've been looking at omap/omap16xxcam.c (with a view to creating an 
omap1510 equivalent) and have noticed the following:


        int divisor = 1;
        divisor = data->ocp_clk/xclk;
        if ( divisor * xclk < data->ocp_clk)
                ++divisor;

        switch (divisor) {
                case 1:
                case 2:
                        xclk_val = FOSCMOD_TC2_CK2;
                        break;
                case 3:
                        xclk_val = FOSCMOD_TC2_CK3;
                        break;
                case 4:
                case 5:
                case 6:
                case 7:
                        xclk_val = FOSCMOD_TC2_CK4;
                        break;
...

Now, by my reckoning, divisor can only be 1 or 2 when it reaches the 
case statement. So, should the preceding if statement actually be:

        while ( divisor * xclk < data->ocp_clk)
                ++divisor;

?

regards

Matt Callow

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Possible error in omap16xxcam_set_xclk?
  2006-06-13 15:07 Possible error in omap16xxcam_set_xclk? Matt Callow
@ 2006-06-13 20:52 ` Matt Callow
  0 siblings, 0 replies; 2+ messages in thread
From: Matt Callow @ 2006-06-13 20:52 UTC (permalink / raw)
  Cc: linux-omap-open-source

Matt Callow wrote:

>  Hi,
>
> I've been looking at omap/omap16xxcam.c (with a view to creating an
> omap1510 equivalent) and have noticed the following:
>
>
>        int divisor = 1;
>        divisor = data->ocp_clk/xclk;
>        if ( divisor * xclk < data->ocp_clk)
>                ++divisor;
>
>        switch (divisor) {
>                case 1:
>                case 2:
>                        xclk_val = FOSCMOD_TC2_CK2;
>                        break;
>                case 3:
>                        xclk_val = FOSCMOD_TC2_CK3;
>                        break;
>                case 4:
>                case 5:
>                case 6:
>                case 7:
>                        xclk_val = FOSCMOD_TC2_CK4;
>                        break;
> ...
>
> Now, by my reckoning, divisor can only be 1 or 2 when it reaches the
> case statement. So, should the preceding if statement actually be:
>
>        while ( divisor * xclk < data->ocp_clk)
>                ++divisor;
>
> ?
>
>
No!
Answered my own question! I should have looked more carefully at the
code :-)

Matt

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-06-13 20:52 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-13 15:07 Possible error in omap16xxcam_set_xclk? Matt Callow
2006-06-13 20:52 ` Matt Callow

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox