Thread (13 messages) read the whole thread 13 messages, 5 authors, 2017-01-26

[PATCH v3 2/4] dt-bindings: Add TI SCI PM Domains

From: robh@kernel.org (Rob Herring)
Date: 2017-01-26 16:56:51
Also in: linux-devicetree, linux-pm, lkml

Possibly related (same subject, not in this thread)

On Thu, Jan 26, 2017 at 9:09 AM, Dave Gerlach [off-list ref] wrote:
On 01/25/2017 04:32 PM, Rob Herring wrote:
quoted
On Wed, Jan 25, 2017 at 10:59 AM, Dave Gerlach [off-list ref] wrote:
[...]
quoted
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help