From: "Eugeny S. Mints" <eugeny.mints@gmail.com>
To: linux-kernel@vger.kernel.org
Cc: linux-pm@lists.osdl.org, matt@nomadgs.com,
amit.kucheria@nokia.com, igor.stoppa@nokia.com,
ext-Tuukka.Tikkanen@nokia.com
Subject: [RFC] OMAP1 PM Core, Platform Power Parameter 1/2
Date: Sat, 30 Sep 2006 02:24:28 +0400 [thread overview]
Message-ID: <20060930022428.e27d4c53.eugeny.mints@gmail.com> (raw)
Basic building block for PM Core layer is platform power parameter concept. A platform power parameter is a name, get and set methods.
Although an PM Core implementation is completely arch specific any PM Core is
supposed to utilize platform power parameter concept.
Also any PM Core is supposed to export names of all platform power parameters
available on a platform. Any entity which registeres operating points is primary
consumer of platform_pwr_param_get_names() interface.
(Probably this interface routine might be moved to be a part of PowerOP Core
interface)
diff --git a/include/linux/plat_pwr_param.h b/include/linux/plat_pwr_param.h
new file mode 100644
index 0000000..3a78d2b
--- /dev/null
+++ b/include/linux/plat_pwr_param.h
@@ -0,0 +1,27 @@
+/*
+ * Interface to the list of platfrom power parameter names available on a
+ * platform
+ *
+ * Author: Eugeny S. Mints <eugeny@nomadgs.com>
+ *
+ * 2006 (c) Nomad Global Solutions, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ *
+ * This is used by an operating point registration entity/module
+ */
+
+#ifndef __PLAT_PWR_PARAM_H__
+#define __PLAT_PWR_PARAM_H__
+
+/*
+ * FIXME: for struct attribute; may be we need get rid of sysfs header
+ * dependency
+ */
+#include <linux/sysfs.h>
+
+int
+platform_pwr_param_get_names(struct attribute ***platform_pwr_params_names);
+
+#endif /*__PLAT_PWR_PARAM_H__*/
diff --git a/include/linux/pm_core.h b/include/linux/pm_core.h
new file mode 100644
index 0000000..a166bc5
--- /dev/null
+++ b/include/linux/pm_core.h
@@ -0,0 +1,46 @@
+/*
+ * Generic platform power parameter interface
+ *
+ * Author: Eugeny S. Mints <eugeny@nomadgs.com>
+ *
+ * 2006 (c) Nomad Global Solutions, Inc. This file is licensed under
+ * the terms of the GNU General Public License version 2. This program
+ * is licensed "as is" without any warranty of any kind, whether express
+ * or implied.
+ *
+ * This _arch_ _independent_ header defines concept of platform power parameter
+ * to be used by any PM Core layer arch specific implementation
+ *
+ * NOTE: this header is designed to be included by PM Core implementations only
+ */
+
+#ifndef __PM_CORE_H__
+#define __PM_CORE_H__
+
+/*
+ * FIXME: for struct attribute; may be we need get rid of sysfs header
+ * dependency
+ */
+#include <linux/sysfs.h>
+
+struct platform_pwr_param {
+ struct attribute attr;
+ int (*show) (void *md_opt, int *value);
+ void (*store) (void *md_opt, int value);
+};
+
+#define platform_pwr_param_init(_name) \
+static struct platform_pwr_param _name##_attr = { \
+ .attr = { \
+ .name = __stringify(_name), \
+ .mode = 0644, \
+ .owner = THIS_MODULE, \
+ }, \
+ .show = _name##_show, \
+ .store = _name##_store, \
+}
+
+#define to_platform_pwr_param(_attr) container_of((_attr), \
+ struct platform_pwr_param, attr)
+
+#endif /*__PM_CORE_H__*/
next reply other threads:[~2006-09-29 22:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-29 22:24 Eugeny S. Mints [this message]
2006-09-30 20:52 ` [linux-pm] [RFC] OMAP1 PM Core, Platform Power Parameter 1/2 Pavel Machek
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=20060930022428.e27d4c53.eugeny.mints@gmail.com \
--to=eugeny.mints@gmail.com \
--cc=amit.kucheria@nokia.com \
--cc=ext-Tuukka.Tikkanen@nokia.com \
--cc=igor.stoppa@nokia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@lists.osdl.org \
--cc=matt@nomadgs.com \
/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