Skip to contentSkip to conversation

regulator: Add GPIO enable control to fixed voltage regulator driver

PATCH RESEND Superseded Roger Quadros 2 participants 3 messages Aug 5, 2009 – Aug 6, 2009

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH RESEND v5 1/1 regulator: Add GPIO enable control to fixed voltage regulator driver

From: Roger Quadros <[email protected]>

Now fixed regulators that have their enable pin connected to a GPIO line can use the fixed regulator driver for regulator enable/disable control. The GPIO number and polarity information is passed through platform data. GPIO enable control is achieved using gpiolib.

---
 Makefile                        |    6 ++-
 drivers/regulator/fixed.c       |   88 ++++++++++++++++++++++++++++++++++++++-
 include/linux/regulator/fixed.h |   24 +++++++++++
 3 files changed, 114 insertions(+), 4 deletions(-)
Makefile +4 -2
index 0d46615..b2ba5ef 100644
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 31
-EXTRAVERSION = -rc5
+EXTRAVERSION = -rc4
 NAME = Man-Eating Seals of Antiquity
 
 # *DOCUMENTATION*
@@ -161,6 +161,8 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 				  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
 				  -e s/sh[234].*/sh/ )
 
+SUBARCH := arm
+
 # Cross compiling and selecting different set of gcc/bin-utils
 # ---------------------------------------------------------------------------
 #
@@ -181,7 +183,7 @@ SUBARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ \
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
 export KBUILD_BUILDHOST := $(SUBARCH)
 ARCH		?= $(SUBARCH)
-CROSS_COMPILE	?=
+CROSS_COMPILE	?= arm-linux-
 
 # Architecture as present in compile.h
 UTS_MACHINE 	:= $(ARCH)
drivers/regulator/fixed.c +86 -2

143 lines not on this page · raw message

include/linux/regulator/fixed.h +24 -0
index 91b4da3..e94a4a1 100644
@@ -5,6 +5,9 @@
  *
  * Author: Mark Brown <[email protected]>
  *
+ * Copyright (c) 2009 Nokia Corporation
+ * Roger Quadros <[email protected]>
+ *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
  * published by the Free Software Foundation; either version 2 of the
@@ -16,9 +19,30 @@
 
 struct regulator_init_data;
 
+/**
+ * struct fixed_voltage_config - fixed_voltage_config structure
+ * @supply_name:	Name of the regulator supply
+ * @microvolts:		Output voltage of regulator
+ * @gpio:		GPIO to use for enable control
+ * 			set to -EINVAL if not used
+ * @enable_high:	Polarity of enable GPIO
+ *			1 = Active high, 0 = Active low
+ * @enabled_at_boot:	Whether regulator has been enabled at
+ * 			boot or not. 1 = Yes, 0 = No
+ * 			This is used to keep the regulator at
+ * 			the default state
+ * @init_data:		regulator_init_data
+ *
+ * This structure contains fixed voltage regulator configuration
+ * information that must be passed by platform code to the fixed
+ * voltage regulator driver.
+ */
 struct fixed_voltage_config {
 	const char *supply_name;
 	int microvolts;
+	int gpio;
+	unsigned enable_high:1;
+	unsigned enabled_at_boot:1;
 	struct regulator_init_data *init_data;
 };
 
Signature · 1 line
1.5.6.3
#1 lore raw
Quoted 22 lines · ext Roger Quadros

From: Roger Quadros <[email protected]>

Now fixed regulators that have their enable pin connected to a GPIO line can use the fixed regulator driver for regulator enable/disable control. The GPIO number and polarity information is passed through platform data. GPIO enable control is achieved using gpiolib.

---
 Makefile                        |    6 ++-
 drivers/regulator/fixed.c       |   88 ++++++++++++++++++++++++++++++++++++++-
 include/linux/regulator/fixed.h |   24 +++++++++++
 3 files changed, 114 insertions(+), 4 deletions(-)
Makefile +0 -0
index 0d46615..b2ba5ef 100644

Makefile line 4

Quoted 5 lines
Makefile +1 -1
@@ -1,7 +1,7 @@
 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 31
-EXTRAVERSION = -rc5
+EXTRAVERSION = -rc4

nice!! :-p

Signature · 1 line
balbi
#2 lore raw
Quoted 13 lines

Makefile line 4

Quoted 10 lines
Makefile +0 -0
index 0d46615..b2ba5ef 100644
@@ -1,7 +1,7 @@

 VERSION = 2
 PATCHLEVEL = 6
 SUBLEVEL = 31

Makefile +1 -1
-EXTRAVERSION = -rc5
+EXTRAVERSION = -rc4

nice!! :-p

Quoted 3 lines

--
balbi

oh no..
bad day :(