[PATCH v3 2/4] dt-bindings: Add TI SCI PM Domains
Rob Herring
robh at kernel.org
Thu Jan 26 08:00:32 PST 2017
On Thu, Jan 26, 2017 at 9:09 AM, Dave Gerlach <d-gerlach at ti.com> wrote:
> On 01/25/2017 04:32 PM, Rob Herring wrote:
>>
>> On Wed, Jan 25, 2017 at 10:59 AM, Dave Gerlach <d-gerlach at ti.com> wrote:
[...]
>>> because genpd_xlate_simple only checks that the phandle is zero so that
>>> it
>>> can fail if it is not, but there's no functional reason it needs to do
>>> this.
>>> The genpd framework works as it did before no matter what the cells are
>>> set
>>> to if using of_genpd_add_provider_simple. Then in the attach_dev callback
>>> inside the ti_sci_pm_domains driver instead of doing
>>>
>>> ret = of_property_read_u32(np, "ti,sci-id", &idx);
>>>
>>> to read the ti,sc-id for a device into idx we can now do:
>>>
>>> ret = of_parse_phandle_with_args(np, "power-domains",
>>> "#power-domain-cells", 0, &pd_args);
>>> idx = pd_args.args[0];
>>>
>>> or even simpler from within our driver
>>>
>>> ret = of_property_read_u32_index(np, "power-domains", 1, &idx);
>>
>>
>> This you should not be doing. The client driver shouldn't care how
>> many cells or what their values are.
>
>
> Client drivers in other places use xlate functions, like in the
> drivers/reset framework, to interpret the cells. Is doing it this way really
> that different?
Oh, I was thinking the client driver, not the power domain controller
driver. NM.
Rob
More information about the linux-arm-kernel
mailing list