Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1365236

[PATCH v6 05/21] PM / devfreq: Add governer type with unique number

From Chanwoo Choi <cw00.choi@samsung.com>
Newsgroups linux.kernel
Subject [PATCH v6 05/21] PM / devfreq: Add governer type with unique number
Date 2016-03-28 01:50 +0200
Message-ID <rhsBt-79r-33@gated-at.bofh.it> (permalink)
References <rhsrM-75N-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


This patch just adds the governor type to identify them
by using the defined constant.

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
---
 drivers/devfreq/governor.h                | 6 ++++++
 drivers/devfreq/governor_performance.c    | 1 +
 drivers/devfreq/governor_powersave.c      | 1 +
 drivers/devfreq/governor_simpleondemand.c | 1 +
 drivers/devfreq/governor_userspace.c      | 1 +
 include/linux/devfreq.h                   | 2 ++
 6 files changed, 12 insertions(+)

diff --git a/drivers/devfreq/governor.h b/drivers/devfreq/governor.h
index fad7d6321978..cf19b923c362 100644
--- a/drivers/devfreq/governor.h
+++ b/drivers/devfreq/governor.h
@@ -18,6 +18,12 @@
 
 #define to_devfreq(DEV)	container_of((DEV), struct devfreq, dev)
 
+/* Devfreq governor type */
+#define DEVFREQ_GOV_ONDEMAND			0x1
+#define DEVFREQ_GOV_PERFORMANCE			0x2
+#define DEVFREQ_GOV_POWERSAVE			0x3
+#define DEVFREQ_GOV_USERSPACE			0x4
+
 /* Devfreq events */
 #define DEVFREQ_GOV_START			0x1
 #define DEVFREQ_GOV_STOP			0x2
diff --git a/drivers/devfreq/governor_performance.c b/drivers/devfreq/governor_performance.c
index c72f942f30a8..594d8ecb13fb 100644
--- a/drivers/devfreq/governor_performance.c
+++ b/drivers/devfreq/governor_performance.c
@@ -43,6 +43,7 @@ static int devfreq_performance_handler(struct devfreq *devfreq,
 
 static struct devfreq_governor devfreq_performance = {
 	.name = "performance",
+	.type = DEVFREQ_GOV_PERFORMANCE,
 	.get_target_freq = devfreq_performance_func,
 	.event_handler = devfreq_performance_handler,
 };
diff --git a/drivers/devfreq/governor_powersave.c b/drivers/devfreq/governor_powersave.c
index 0c6bed567e6d..e2817e1f2a31 100644
--- a/drivers/devfreq/governor_powersave.c
+++ b/drivers/devfreq/governor_powersave.c
@@ -40,6 +40,7 @@ static int devfreq_powersave_handler(struct devfreq *devfreq,
 
 static struct devfreq_governor devfreq_powersave = {
 	.name = "powersave",
+	.type = DEVFREQ_GOV_POWERSAVE,
 	.get_target_freq = devfreq_powersave_func,
 	.event_handler = devfreq_powersave_handler,
 };
diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c
index ae72ba5e78df..b905a535d486 100644
--- a/drivers/devfreq/governor_simpleondemand.c
+++ b/drivers/devfreq/governor_simpleondemand.c
@@ -126,6 +126,7 @@ static int devfreq_simple_ondemand_handler(struct devfreq *devfreq,
 
 static struct devfreq_governor devfreq_simple_ondemand = {
 	.name = "simple_ondemand",
+	.type = DEVFREQ_GOV_ONDEMAND,
 	.get_target_freq = devfreq_simple_ondemand_func,
 	.event_handler = devfreq_simple_ondemand_handler,
 };
diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
index 35de6e83c1fe..c78ab78a5220 100644
--- a/drivers/devfreq/governor_userspace.c
+++ b/drivers/devfreq/governor_userspace.c
@@ -138,6 +138,7 @@ static int devfreq_userspace_handler(struct devfreq *devfreq,
 
 static struct devfreq_governor devfreq_userspace = {
 	.name = "userspace",
+	.type = DEVFREQ_GOV_USERSPACE,
 	.get_target_freq = devfreq_userspace_func,
 	.event_handler = devfreq_userspace_handler,
 };
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
index 152ea342529c..9baf45f661ad 100644
--- a/include/linux/devfreq.h
+++ b/include/linux/devfreq.h
@@ -104,6 +104,7 @@ struct devfreq_dev_profile {
  * struct devfreq_governor - Devfreq policy governor
  * @node:		list node - contains registered devfreq governors
  * @name:		Governor's name
+ * @type:		Governor's type
  * @get_target_freq:	Returns desired operating frequency for the device.
  *			Basically, get_target_freq will run
  *			devfreq_dev_profile.get_dev_status() to get the
@@ -121,6 +122,7 @@ struct devfreq_governor {
 	struct list_head node;
 
 	const char name[DEVFREQ_NAME_LEN];
+	const int type;
 	int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
 	int (*event_handler)(struct devfreq *devfreq,
 				unsigned int event, void *data);
-- 
1.9.1

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v6 00/21] PM / devferq: Add generic exynos bus frequency driver  and new passive governor Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 01/21] PM / devfreq: exynos: Add generic exynos bus  frequency driver Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 02/21] PM / devfreq: exynos: Add documentation for generic  exynos bus frequency driver Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 07/21] PM / devfreq: exynos: Add support of bus frequency of  sub-blocks using passive governor Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 11/21] MAINTAINERS: Add samsung bus frequency driver entry Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 14/21] ARM: dts: Add bus nodes using VDD_INT for Exynos3250 Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 06/21] PM / devfreq: Add new passive governor Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 03/21] PM / devfreq: Add devfreq_get_devfreq_by_phandle() Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 17/21] ARM: dts: Add bus nodes using VDD_MIF for Exynos4210 Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 21/21] ARM: dts: Add support of bus frequency for  exynos4412-trats/odroidu3 Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 12/21] ARM: dts: Add DMC bus node for Exynos3250 Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 16/21] ARM: dts: Add bus nodes using VDD_INT for Exynos4x12 Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 13/21] ARM: dts: Add DMC bus frequency for  exynos3250-rinato/monk Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200
  [PATCH v6 05/21] PM / devfreq: Add governer type with unique number Chanwoo Choi <cw00.choi@samsung.com> - 2016-03-28 01:50 +0200

csiph-web