[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180322095903.h7hgm3xylq3esjyf@vireshk-mac-ubuntu>
Date: Thu, 22 Mar 2018 17:59:03 +0800
From: Viresh Kumar <viresh.kumar@...aro.org>
To: Ulf Hansson <ulf.hansson@...aro.org>
Cc: Kevin Hilman <khilman@...nel.org>,
"Rafael J. Wysocki" <rjw@...ysocki.net>,
Len Brown <len.brown@...el.com>, Pavel Machek <pavel@....cz>,
Linux PM <linux-pm@...r.kernel.org>,
Stephen Boyd <sboyd@...eaurora.org>,
Nishanth Menon <nm@...com>,
Vincent Guittot <vincent.guittot@...aro.org>,
Rob Herring <robh+dt@...nel.org>,
Rajendra Nayak <rnayak@...eaurora.org>,
Sudeep Holla <sudeep.holla@....com>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/7] PM / Domain: Add struct device to genpd
On 22-03-18, 10:30, Ulf Hansson wrote:
> On 22 December 2017 at 08:26, Viresh Kumar <viresh.kumar@...aro.org> wrote:
> > The power-domain core would be using the OPP core going forward and the
> > OPP core has the basic requirement of a device structure for its working.
>
> According to the OPP core also seems to require the ->dev.of_node to
> be set. Actually, it seems like that part belongs in patch4 instead,
> while starting to make use of the opp OF APIs. Could you please move
> it?
You meaning setting of the of_node to the next patch? I can do that if that;s
what you want.
> > +static struct bus_type genpd_bus_type = {
> > + .name = "genpd",
> > +};
>
> This seems silly. Can't we just avoid having a bus type altogether,
> thus no need to call bus_register() as well?
I thought we need a bus where we want to add the device, haven't tried with that
pointer being empty. Will try that and let you know.
> > +
> > /**
> > * pm_genpd_init - Initialize a generic I/O PM domain object.
> > * @genpd: PM domain object to initialize.
> > @@ -1687,6 +1691,18 @@ int pm_genpd_init(struct generic_pm_domain *genpd,
> > return ret;
> > }
> >
> > + genpd->dev.bus = &genpd_bus_type;
> > + device_initialize(&genpd->dev);
> > + dev_set_name(&genpd->dev, "%s", genpd->name);
> > +
> > + ret = device_add(&genpd->dev);
>
> What's the point of adding the device? Can we skip this step, as I
> guess the opp core is only using the device as cookie rather actual
> using it? No?
We also use it for the OPP debugfs stuff, so that would be required I believe.
We also use it for playing with clk/regulator stuff as well, though we may not
use it in genpd case for now.
--
viresh
Powered by blists - more mailing lists