SUPERH platform development
 help / color / mirror / Atom feed
* [PATCH 01/14] sh: add a temporary macro to define fixed voltage regulators
@ 2012-06-20 15:12 Guennadi Liakhovetski
  2012-06-20 15:20 ` Paul Mundt
  2012-06-20 15:30 ` Guennadi Liakhovetski
  0 siblings, 2 replies; 3+ messages in thread
From: Guennadi Liakhovetski @ 2012-06-20 15:12 UTC (permalink / raw)
  To: linux-sh

Until the regulator_register_fixed_volt() function becomes available add a
macro to define fixed-voltage always on regulators.

Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
---
 arch/sh/include/mach-common/mach/regulator.h |   34 ++++++++++++++++++++++++++
 1 files changed, 34 insertions(+), 0 deletions(-)
 create mode 100644 arch/sh/include/mach-common/mach/regulator.h

diff --git a/arch/sh/include/mach-common/mach/regulator.h b/arch/sh/include/mach-common/mach/regulator.h
new file mode 100644
index 0000000..fe74995
--- /dev/null
+++ b/arch/sh/include/mach-common/mach/regulator.h
@@ -0,0 +1,34 @@
+/*
+ * Temporary header until regulator_register_fixed_volt() is available.
+ * Licensed under GPLv2, see COPYING for details.
+ */
+
+#ifndef ASM_REGULATOR_H
+#define ASM_REGULATOR_H
+
+#include <linux/regulator/driver.h>
+#include <linux/regulator/fixed.h>
+#include <linux/regulator/machine.h>
+
+#define REGULATOR_FIXED(s, rid, v)					\
+static struct regulator_init_data fixed_power_init_data_ ## rid = {	\
+	.num_consumer_supplies  = ARRAY_SIZE(s),			\
+	.consumer_supplies      = (s),					\
+	.constraints.always_on	= 1,					\
+};									\
+static struct fixed_voltage_config fixed_power_info_ ## rid = {		\
+	.supply_name = "Fixed #" # rid,					\
+	.microvolts = (v),						\
+	.gpio = -EINVAL,						\
+	.init_data = &fixed_power_init_data_ ## rid,			\
+	.enabled_at_boot = 1,						\
+};									\
+static struct platform_device fixed_power_ ## rid = {			\
+	.name = "reg-fixed-voltage",					\
+	.id   = (rid),							\
+	.dev  = {							\
+		.platform_data = &fixed_power_info_ ## rid,		\
+	},								\
+}
+
+#endif
-- 
1.7.2.5


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

end of thread, other threads:[~2012-06-20 15:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-06-20 15:12 [PATCH 01/14] sh: add a temporary macro to define fixed voltage regulators Guennadi Liakhovetski
2012-06-20 15:20 ` Paul Mundt
2012-06-20 15:30 ` Guennadi Liakhovetski

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