public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC] OMAP1 PM Core,  Platform Power Parameter 1/2
@ 2006-09-29 22:24 Eugeny S. Mints
  2006-09-30 20:52 ` [linux-pm] " Pavel Machek
  0 siblings, 1 reply; 2+ messages in thread
From: Eugeny S. Mints @ 2006-09-29 22:24 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-pm, matt, amit.kucheria, igor.stoppa, ext-Tuukka.Tikkanen

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__*/

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

* Re: [linux-pm] [RFC] OMAP1 PM Core,  Platform Power Parameter 1/2
  2006-09-29 22:24 [RFC] OMAP1 PM Core, Platform Power Parameter 1/2 Eugeny S. Mints
@ 2006-09-30 20:52 ` Pavel Machek
  0 siblings, 0 replies; 2+ messages in thread
From: Pavel Machek @ 2006-09-30 20:52 UTC (permalink / raw)
  To: Eugeny S. Mints; +Cc: linux-kernel, linux-pm, ext-Tuukka.Tikkanen

Hi!

> 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

This is generic code (and please select some more reasonable
filename). It should not be in patch marked "OMAP1".

								Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

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

end of thread, other threads:[~2006-09-30 20:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-29 22:24 [RFC] OMAP1 PM Core, Platform Power Parameter 1/2 Eugeny S. Mints
2006-09-30 20:52 ` [linux-pm] " Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox