linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] cpufreq: dt: Remove unused code
@ 2016-09-09 11:18 Viresh Kumar
  2016-09-09 11:18 ` [PATCH 2/3] cpufreq: dt: Update kconfig description Viresh Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Viresh Kumar @ 2016-09-09 11:18 UTC (permalink / raw)
  To: Rafael Wysocki, Viresh Kumar
  Cc: linaro-kernel, linux-pm, linux-kernel, Juri.Lelli, arnd.bergmann

This is leftover from an earlier patch which removed the usage of
platform data but forgot to remove this line. Remove it now.

Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq-dt.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 3957de801ae8..2bd20534155d 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -366,8 +366,6 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	dt_cpufreq_driver.driver_data = dev_get_platdata(&pdev->dev);
-
 	ret = cpufreq_register_driver(&dt_cpufreq_driver);
 	if (ret)
 		dev_err(&pdev->dev, "failed register driver: %d\n", ret);
-- 
2.7.1.410.g6faf27b

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] cpufreq: dt: Update kconfig description
  2016-09-09 11:18 [PATCH 1/3] cpufreq: dt: Remove unused code Viresh Kumar
@ 2016-09-09 11:18 ` Viresh Kumar
  2016-09-09 11:18 ` [PATCH 3/3] cpufreq: dt: Support governor tunables per policy Viresh Kumar
  2016-09-14  1:01 ` [PATCH 1/3] cpufreq: dt: Remove unused code Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2016-09-09 11:18 UTC (permalink / raw)
  To: Rafael Wysocki, Viresh Kumar
  Cc: linaro-kernel, linux-pm, linux-kernel, Juri.Lelli, arnd.bergmann

The cpufreq DT driver also supports systems that have multiple
clock/voltage domains for CPUs, i.e. multiple policy systems.

The description of the Kconfig entry was never updated after the driver
was modified to support such systems, fix it.

Reported-by: Juri Lelli <Juri.Lelli@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/cpufreq/Kconfig b/drivers/cpufreq/Kconfig
index 4dc95250cf4e..d8b164a7c4e5 100644
--- a/drivers/cpufreq/Kconfig
+++ b/drivers/cpufreq/Kconfig
@@ -222,7 +222,7 @@ config CPUFREQ_DT
 	help
 	  This adds a generic DT based cpufreq driver for frequency management.
 	  It supports both uniprocessor (UP) and symmetric multiprocessor (SMP)
-	  systems which share clock and voltage across all CPUs.
+	  systems.
 
 	  If in doubt, say N.
 
-- 
2.7.1.410.g6faf27b

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] cpufreq: dt: Support governor tunables per policy
  2016-09-09 11:18 [PATCH 1/3] cpufreq: dt: Remove unused code Viresh Kumar
  2016-09-09 11:18 ` [PATCH 2/3] cpufreq: dt: Update kconfig description Viresh Kumar
@ 2016-09-09 11:18 ` Viresh Kumar
  2016-09-14  1:01 ` [PATCH 1/3] cpufreq: dt: Remove unused code Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2016-09-09 11:18 UTC (permalink / raw)
  To: Rafael Wysocki, Viresh Kumar
  Cc: linaro-kernel, linux-pm, linux-kernel, Juri.Lelli, arnd.bergmann

The cpufreq-dt driver is also used for systems with multiple
clock/voltage domains for CPUs, i.e. multiple cpufreq policies in a
system.

And in such cases the platform users may want to enable "governor
tunables per policy". Support that via platform data, as not all users
of the driver would want that behavior.

Reported-by: Juri Lelli <Juri.Lelli@arm.com>
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
---
 drivers/cpufreq/cpufreq-dt-platdev.c |  7 +++++--
 drivers/cpufreq/cpufreq-dt.c         |  6 ++++++
 drivers/cpufreq/cpufreq-dt.h         | 19 +++++++++++++++++++
 3 files changed, 30 insertions(+), 2 deletions(-)
 create mode 100644 drivers/cpufreq/cpufreq-dt.h

diff --git a/drivers/cpufreq/cpufreq-dt-platdev.c b/drivers/cpufreq/cpufreq-dt-platdev.c
index 285ed3e6494e..da2fa27b5b30 100644
--- a/drivers/cpufreq/cpufreq-dt-platdev.c
+++ b/drivers/cpufreq/cpufreq-dt-platdev.c
@@ -11,6 +11,8 @@
 #include <linux/of.h>
 #include <linux/platform_device.h>
 
+#include "cpufreq-dt.h"
+
 static const struct of_device_id machines[] __initconst = {
 	{ .compatible = "allwinner,sun4i-a10", },
 	{ .compatible = "allwinner,sun5i-a10s", },
@@ -92,7 +94,8 @@ static int __init cpufreq_dt_platdev_init(void)
 	if (!match)
 		return -ENODEV;
 
-	return PTR_ERR_OR_ZERO(platform_device_register_simple("cpufreq-dt", -1,
-							       NULL, 0));
+	return PTR_ERR_OR_ZERO(platform_device_register_data(NULL, "cpufreq-dt",
+			       -1, match->data,
+			       sizeof(struct cpufreq_dt_platform_data)));
 }
 device_initcall(cpufreq_dt_platdev_init);
diff --git a/drivers/cpufreq/cpufreq-dt.c b/drivers/cpufreq/cpufreq-dt.c
index 2bd20534155d..5c07ae05d69a 100644
--- a/drivers/cpufreq/cpufreq-dt.c
+++ b/drivers/cpufreq/cpufreq-dt.c
@@ -25,6 +25,8 @@
 #include <linux/slab.h>
 #include <linux/thermal.h>
 
+#include "cpufreq-dt.h"
+
 struct private_data {
 	struct device *cpu_dev;
 	struct thermal_cooling_device *cdev;
@@ -353,6 +355,7 @@ static struct cpufreq_driver dt_cpufreq_driver = {
 
 static int dt_cpufreq_probe(struct platform_device *pdev)
 {
+	struct cpufreq_dt_platform_data *data = dev_get_platdata(&pdev->dev);
 	int ret;
 
 	/*
@@ -366,6 +369,9 @@ static int dt_cpufreq_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
+	if (data && data->have_governor_per_policy)
+		dt_cpufreq_driver.flags |= CPUFREQ_HAVE_GOVERNOR_PER_POLICY;
+
 	ret = cpufreq_register_driver(&dt_cpufreq_driver);
 	if (ret)
 		dev_err(&pdev->dev, "failed register driver: %d\n", ret);
diff --git a/drivers/cpufreq/cpufreq-dt.h b/drivers/cpufreq/cpufreq-dt.h
new file mode 100644
index 000000000000..54d774e46c43
--- /dev/null
+++ b/drivers/cpufreq/cpufreq-dt.h
@@ -0,0 +1,19 @@
+/*
+ * Copyright (C) 2016 Linaro
+ * Viresh Kumar <viresh.kumar@linaro.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 as
+ * published by the Free Software Foundation.
+ */
+
+#ifndef __CPUFREQ_DT_H__
+#define __CPUFREQ_DT_H__
+
+#include <linux/types.h>
+
+struct cpufreq_dt_platform_data {
+	bool have_governor_per_policy;
+};
+
+#endif /* __CPUFREQ_DT_H__ */
-- 
2.7.1.410.g6faf27b

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] cpufreq: dt: Remove unused code
  2016-09-09 11:18 [PATCH 1/3] cpufreq: dt: Remove unused code Viresh Kumar
  2016-09-09 11:18 ` [PATCH 2/3] cpufreq: dt: Update kconfig description Viresh Kumar
  2016-09-09 11:18 ` [PATCH 3/3] cpufreq: dt: Support governor tunables per policy Viresh Kumar
@ 2016-09-14  1:01 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2016-09-14  1:01 UTC (permalink / raw)
  To: Viresh Kumar
  Cc: linaro-kernel, linux-pm, linux-kernel, Juri.Lelli, arnd.bergmann

On Friday, September 09, 2016 04:48:06 PM Viresh Kumar wrote:
> This is leftover from an earlier patch which removed the usage of
> platform data but forgot to remove this line. Remove it now.
> 
> Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>

All [1-3/3] applied.

Thanks,
Rafael

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-14  0:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-09 11:18 [PATCH 1/3] cpufreq: dt: Remove unused code Viresh Kumar
2016-09-09 11:18 ` [PATCH 2/3] cpufreq: dt: Update kconfig description Viresh Kumar
2016-09-09 11:18 ` [PATCH 3/3] cpufreq: dt: Support governor tunables per policy Viresh Kumar
2016-09-14  1:01 ` [PATCH 1/3] cpufreq: dt: Remove unused code Rafael J. Wysocki

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).