Hi Raffaele,

On Thu, Jul 29, 2010 at 20:23:04, Raffaele Recalcati wrote:

>       >
>       >       > +
>       >       > +     /* check all possibilities to get best fitting
> for the
>       > required freq */
>       >
>       >       > +     i_min_err = min_err = INT_MAX;
>       >       > +     for (i = 0x0F; i > 0; i--) {
>       >       > +             if (clk->parent->set_rate) {
>       >       > +                     ret = clk_set_rate(clk->parent,
> rate *
>       > i) ;
>       >       > +                     err = clk_get_rate(clk->parent)
> - rate *
>       > i;
>       >       > +                     if (min_err > abs(err)) {
>       >       > +                             min_err = abs(err);
>       >       > +                             i_min_err = i;
>       >       > +                     }
>       >       > +             }
>       >       > +     }
>       >
>       >
>       >       Why should the child touch the parent's clock output?
> Users of
>       > the
>       >       clock framework should be able to set these rates
> independently.
>       >
>       >
>       >
>       > right.
>       > we tried.
>       > the problem is that the clkout2 is used for uda1345 system
> clock.
>       > without chenig the parent we can't get close.
>       > the sound is really too fast.
>       >
>
>
>       You should be able to change both clocks independently.
>       Example, in your board code:
>
>       xxx uda135_set_clk_rate(xxx)
>       {
>              clk_set_rate(sysclkN, desired_rate);
>              clk_set_rate(clkout2, desired_rate);
>       }
>
>
>
>
> Doing like that I should put a logic in that driver.

This code should be in some platform file and abstracted from
the driver using clock APIs.

> It is not wrong, because I'm writing a cpu_dai, but, anyway, I will
> change the sysclk9 that, maybe, is used from someone else.
>
> Isn't there the possibility to "occupy" a sysclk?

No, because the hardware doesn't allow it. Who else is using sysclk9?

> Can't I use clk->flags to have a conditional behaviour of
> clk_sysclk_recalc if it is called from pll1_sysclk9 or from clkout2 ?
>

In my opinion overloading clk_sysclk_recalc to recalculate clkout2
clock rate will be confusing. Since the clkout2 code is DM365 specific,
it can reside dm365.c itself.

Thanks,
Sekhar

_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

Reply via email to