Re: [PATCH v7 2/3] clk: clk-pic32: Add PIC32 clock driver

From: Purna Chandra Mandal
Date: Sat Feb 20 2016 - 02:05:04 EST


On 02/20/2016 01:46 AM, Michael Turquette wrote:

> Quoting Joshua Henderson (2016-02-19 08:25:35)
>> +const struct clk_ops pic32_roclk_ops = {
>> + .enable = roclk_enable,
>> + .disable = roclk_disable,
>> + .is_enabled = roclk_is_enabled,
>> + .get_parent = roclk_get_parent,
>> + .set_parent = roclk_set_parent,
>> + .determine_rate = roclk_determine_rate,
>> + .recalc_rate = roclk_recalc_rate,
>> + .round_rate = roclk_round_rate,
>> + .set_rate_and_parent = roclk_set_rate_and_parent,
>> + .set_rate = roclk_set_rate,
>> + .init = roclk_init,
>> +};
> You can remove .round_rate and only use .determine_rate.

Ack. Will remove .round_rate.

> ...
>> +CLK_OF_DECLARE(pic32mzda_clk, "microchip,pic32mzda-clk", pic32mzda_clock_init);
> Can you make this a platform_driver instead of using CLK_OF_DECLARE? I
> asked this in v6 but there was no response.

Mike,
I tried to use platform_driver approach, but didn't work for me.
On MIPS/PIC32 first call of clk_get() happens from "start_kernel -> time_init()->
plat_time_init()" which is very early in boot sequence even before execution of
early_initcall(). In short, by platform_driver way I'was not able to register clock(s)
before the first clock user becomes ready. Whereas with CLK_OF_DECLARE() I can
explicitly call of_clk_init() in plat_time_init() just before calling clk_get().

Please suggest me if you have any reference to avoid my case.

> Regards,
> Mike
>
>> --
>> 1.7.9.5
>>