linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leonard Crestez <leonard.crestez@nxp.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Anson Huang <anson.huang@nxp.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Chanwoo Choi <cw00.choi@samsung.com>,
	Michael Turquette <mturquette@baylibre.com>,
	Georgi Djakov <georgi.djakov@linaro.org>,
	Alexandre Bailon <abailon@baylibre.com>,
	Jacky Bai <ping.bai@nxp.com>,
	MyungJoo Ham <myungjoo.ham@samsung.com>,
	Kyungmin Park <kyungmin.park@samsung.com>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Shawn Guo <shawnguo@kernel.org>,
	Aisheng Dong <aisheng.dong@nxp.com>,
	Fabio Estevam <fabio.estevam@nxp.com>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	"kernel@pengutronix.de" <kernel@pengutronix.de>,
	"linux-clk@vger.kernel.org" <linux-clk@vger.kernel.org>,
	dl-linux-imx <linux-imx@nxp.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [RFC] devfreq: Add generic devfreq-dt driver
Date: Mon, 10 Jun 2019 22:13:19 +0000	[thread overview]
Message-ID: <VI1PR04MB50558EF0387824D6AAEEB18EEE130@VI1PR04MB5055.eurprd04.prod.outlook.com> (raw)
In-Reply-To: 20190606031526.xknv5qdoqufim6tr@vireshk-i7

On 6/6/2019 6:15 AM, Viresh Kumar wrote:
> On 05-06-19, 15:31, Leonard Crestez wrote:
>> +static const struct of_device_id devfreq_dt_of_match[] = {
>> +	{ .compatible = "generic-devfreq", },
>> +	{ /* sentinel */ },
>> +};
>> +MODULE_DEVICE_TABLE(of, devfreq_dt_of_match);
> 
> DT can't contain nodes for any virtual devices, this will have similar
> problems to cpufreq-dt. How is this driver going to get probed ? Who
> will create the device ?

CPUs are special devices, I'm not sure the same issues apply here.

If a SOC has multiple buses or frequency domains which can be scaled up 
and down then those can be treated as "real" devices and probing them 
from DT seems entirely reasonable. DT could look like this:

+       noc1 {
+               compatible = "fsl,imx8mm-noc", "generic-devfreq";
+               clocks = <&clk IMX8MM_CLK_NOC1>;
+               operating-points-v2 = <&noc1_opp_table>;
+       };
+
+       noc1_opp_table: noc1-opp-table {
+               compatible = "operating-points-v2";
+
+               opp-150M {
+                       opp-hz = /bits/ 64 <150000000>;
+               };
+               opp-750M {
+                       opp-hz = /bits/ 64 <750000000>;
+               };
+       };

Instead of a "generic-devfreq" fallback the compatible list of 
devfreq-dt could contain a large number of unrelated compat strings. 
This would be vaguely similar to the white/black lists from cpufreq-dt-plat.

There aren't really that many devfreq implementations so perhaps it's 
not worth generalizing very much. I should rename this to "devfreq-imx" 
even if there's nothing imx-specific inside it yet.

--
Regards,
Leonard

  reply	other threads:[~2019-06-10 22:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-05 12:31 [RFC] devfreq: Add generic devfreq-dt driver Leonard Crestez
2019-06-06  3:15 ` Viresh Kumar
2019-06-10 22:13   ` Leonard Crestez [this message]
2019-06-10 23:48     ` Stephen Boyd
2019-06-11  2:38       ` Viresh Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR04MB50558EF0387824D6AAEEB18EEE130@VI1PR04MB5055.eurprd04.prod.outlook.com \
    --to=leonard.crestez@nxp.com \
    --cc=abailon@baylibre.com \
    --cc=aisheng.dong@nxp.com \
    --cc=anson.huang@nxp.com \
    --cc=cw00.choi@samsung.com \
    --cc=fabio.estevam@nxp.com \
    --cc=georgi.djakov@linaro.org \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=kyungmin.park@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=myungjoo.ham@samsung.com \
    --cc=ping.bai@nxp.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@kernel.org \
    --cc=shawnguo@kernel.org \
    --cc=viresh.kumar@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).