[PATCH 2/3] plat-nomadik: Added suspend/resume support for MTU timer.

Linus Walleij linus.ml.walleij at gmail.com
Thu Sep 2 15:30:53 EDT 2010


2010/9/2 Russell King - ARM Linux <linux at arm.linux.org.uk>:
> On Thu, Sep 02, 2010 at 09:30:32AM +0200, Jonas Aaberg wrote:
>> (...)
>>       /*
>> -      * Tick rate is 2.4MHz for Nomadik and 110MHz for ux500:
>> +      * Tick rate is 2.4MHz for Nomadik and 100 or 133MHz for ux500:
>>        * use a divide-by-16 counter if it's more than 16MHz
>>        */
>> -     cr = MTU_CRn_32BITS;;
>>       rate = clk_get_rate(clk0);
>> -     if (rate > 16 << 20) {
>> +     if (rate > (16 << 20))
>
> n << 20 doesn't give you MHz, so this code doesn't match the comments.
> Do you mean 16MHz or 16.777216MHz ?

That comes from Alessandros oneshot mode a while back actually,
Jonas is only factoring it around.

Alessandro why do we kick in a prescaler if rate > (16 << 20)?
Seems weird to me too when I look at it, more like it'd be
if rate (1 << 20) which makes sense, if the counter will flip
around 20 bits in 1 second we prescale it by 16.

Yours,
Linus Walleij



More information about the linux-arm-kernel mailing list