From: Nishanth Menon <nm@ti.com>
To: linux-pm <linux-pm@vger.kernel.org>
Cc: Nishanth Menon <nm@ti.com>,
Rajagopal Venkat <rajagopal.venkat@linaro.org>,
MyungJoo Ham <myungjoo.ham@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
"Rafael J. Wysocki" <rjw@sisk.pl>, Kevin Hilman <khilman@ti.com>,
linux-kernel@vger.kernel.org
Subject: [linux-next PATCH 3/7] PM / devfreq: register governors with devfreq framework
Date: Mon, 29 Oct 2012 15:01:44 -0500 [thread overview]
Message-ID: <1351540908-12195-4-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1351540908-12195-1-git-send-email-nm@ti.com>
With the new registration functions, governors can be now
registered with devfreq framework.
NOTE: generates 'discards qualifiers from pointer target type'
build warnings, which the next patche in this series fixes
Cc: Rajagopal Venkat <rajagopal.venkat@linaro.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>
Cc: Kyungmin Park <kyungmin.park@samsung.com>
Cc: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: Kevin Hilman <khilman@ti.com>
Cc: linux-pm@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Nishanth Menon <nm@ti.com>
---
drivers/devfreq/governor_performance.c | 18 ++++++++++++++++++
drivers/devfreq/governor_powersave.c | 18 ++++++++++++++++++
drivers/devfreq/governor_simpleondemand.c | 18 ++++++++++++++++++
drivers/devfreq/governor_userspace.c | 18 ++++++++++++++++++
4 files changed, 72 insertions(+)
diff --git a/drivers/devfreq/governor_performance.c b/drivers/devfreq/governor_performance.c
index eea3f9b..db8ff77 100644
--- a/drivers/devfreq/governor_performance.c
+++ b/drivers/devfreq/governor_performance.c
@@ -45,3 +45,21 @@ const struct devfreq_governor devfreq_performance = {
.get_target_freq = devfreq_performance_func,
.event_handler = devfreq_performance_handler,
};
+
+static int __init devfreq_performance_init(void)
+{
+ return devfreq_add_governor(&devfreq_performance);
+}
+subsys_initcall(devfreq_performance_init);
+
+static void __exit devfreq_performance_exit(void)
+{
+ int ret;
+
+ ret = devfreq_remove_governor(&devfreq_performance);
+ if (ret)
+ pr_err("%s: failed remove governor %d\n", __func__, ret);
+
+ return;
+}
+module_exit(devfreq_performance_exit);
diff --git a/drivers/devfreq/governor_powersave.c b/drivers/devfreq/governor_powersave.c
index 2868d98..30f0fca 100644
--- a/drivers/devfreq/governor_powersave.c
+++ b/drivers/devfreq/governor_powersave.c
@@ -42,3 +42,21 @@ const struct devfreq_governor devfreq_powersave = {
.get_target_freq = devfreq_powersave_func,
.event_handler = devfreq_powersave_handler,
};
+
+static int __init devfreq_powersave_init(void)
+{
+ return devfreq_add_governor(&devfreq_powersave);
+}
+subsys_initcall(devfreq_powersave_init);
+
+static void __exit devfreq_powersave_exit(void)
+{
+ int ret;
+
+ ret = devfreq_remove_governor(&devfreq_powersave);
+ if (ret)
+ pr_err("%s: failed remove governor %d\n", __func__, ret);
+
+ return;
+}
+module_exit(devfreq_powersave_exit);
diff --git a/drivers/devfreq/governor_simpleondemand.c b/drivers/devfreq/governor_simpleondemand.c
index b5cf0fb..85f9ed5 100644
--- a/drivers/devfreq/governor_simpleondemand.c
+++ b/drivers/devfreq/governor_simpleondemand.c
@@ -125,3 +125,21 @@ const struct devfreq_governor devfreq_simple_ondemand = {
.get_target_freq = devfreq_simple_ondemand_func,
.event_handler = devfreq_simple_ondemand_handler,
};
+
+static int __init devfreq_simple_ondemand_init(void)
+{
+ return devfreq_add_governor(&devfreq_simple_ondemand);
+}
+subsys_initcall(devfreq_simple_ondemand_init);
+
+static void __exit devfreq_simple_ondemand_exit(void)
+{
+ int ret;
+
+ ret = devfreq_remove_governor(&devfreq_simple_ondemand);
+ if (ret)
+ pr_err("%s: failed remove governor %d\n", __func__, ret);
+
+ return;
+}
+module_exit(devfreq_simple_ondemand_exit);
diff --git a/drivers/devfreq/governor_userspace.c b/drivers/devfreq/governor_userspace.c
index 7067555..110f178 100644
--- a/drivers/devfreq/governor_userspace.c
+++ b/drivers/devfreq/governor_userspace.c
@@ -140,3 +140,21 @@ const struct devfreq_governor devfreq_userspace = {
.get_target_freq = devfreq_userspace_func,
.event_handler = devfreq_userspace_handler,
};
+
+static int __init devfreq_userspace_init(void)
+{
+ return devfreq_add_governor(&devfreq_userspace);
+}
+subsys_initcall(devfreq_userspace_init);
+
+static void __exit devfreq_userspace_exit(void)
+{
+ int ret;
+
+ ret = devfreq_remove_governor(&devfreq_userspace);
+ if (ret)
+ pr_err("%s: failed remove governor %d\n", __func__, ret);
+
+ return;
+}
+module_exit(devfreq_userspace_exit);
--
1.7.9.5
next prev parent reply other threads:[~2012-10-29 20:01 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-29 20:01 [linux-next PATCH 0/7] PM / devfreq: allow governors to be modules and switch dynamically Nishanth Menon
2012-10-29 20:01 ` [linux-next PATCH 1/7] PM / devfreq: export update_devfreq Nishanth Menon
2012-10-29 20:01 ` [linux-next PATCH 2/7] PM / devfreq: provide hooks for governors to be registered Nishanth Menon
2012-10-29 20:01 ` Nishanth Menon [this message]
2012-10-29 20:01 ` [linux-next PATCH 4/7] PM / devfreq: map devfreq drivers to governor using name Nishanth Menon
2012-10-29 20:01 ` [linux-next PATCH 5/7] PM / devfreq: governors: add GPL module license and allow module build Nishanth Menon
2012-10-29 20:01 ` [linux-next PATCH 6/7] PM / devfreq: allow sysfs governor node to switch governor Nishanth Menon
2012-10-29 20:01 ` [linux-next PATCH 7/7] PM / devfreq: Add sysfs node to expose available governors Nishanth Menon
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=1351540908-12195-4-git-send-email-nm@ti.com \
--to=nm@ti.com \
--cc=khilman@ti.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=rajagopal.venkat@linaro.org \
--cc=rjw@sisk.pl \
/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