Re: of_clk_add_(hw_)providers multipule times for one node?

From: Rob Herring
Date: Thu Aug 04 2016 - 18:11:15 EST


On Thu, Aug 4, 2016 at 4:25 PM, Stephen Boyd <sboyd@xxxxxxxxxxxxxx> wrote:
> +Rob in case he has any insight
>
> On 07/09, Masahiro Yamada wrote:
>> Hi.
>>
>> I think the current code allows to add
>> clk_providers multiple times against one DT node.
>>
>> Are there cases that really need to do so?
>
> If we have clk drivers that have a device driver structure and
> also use CLK_OF_DECLARE then we could get into a situation where
> they register two providers for the same device node. I can't
> think of any other situation where this would happen though.

In this case I'd think you could have some sort of hand-off. Perhaps
the code using CLK_OF_DECLARE can only do provide enable and get_rate
and then the full driver loads with more capabilities.

The other case I could think of is you need to match on more than just
the compatible, so the callbacks could have additional logic to match
against. But in that case, only one should succeed. Also, there's the
general problem that we can't support 2 drivers both matching where
one is a better match than the other.

Rob