[RFC] OMAP1 PM Core, Platform Power Parameter 1/2

From: Eugeny S. Mints
Date: Fri Sep 29 2006 - 18:23:27 EST


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@xxxxxxxxxxx>
+ *
+ * 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@xxxxxxxxxxx>
+ *
+ * 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__*/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/