msm: board-9615: add gpio-regulator wrapper around GPIO 18

Add a gpio-regulator device to control GPIO 18.  This GPIO is
used as the enable signal for the external 2.95 V regulator
used for the SD card on 9615 boards.

Change-Id: Ia3893fbdc49a7c0a7ac0d4ea1799274458b1d591
Signed-off-by: David Collins <collinsd@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-9615-regulator.c b/arch/arm/mach-msm/board-9615-regulator.c
index 855d956..6568bef 100644
--- a/arch/arm/mach-msm/board-9615-regulator.c
+++ b/arch/arm/mach-msm/board-9615-regulator.c
@@ -12,6 +12,7 @@
  */
 
 #include <linux/regulator/pm8018-regulator.h>
+#include <linux/regulator/gpio-regulator.h>
 #include <mach/rpm-regulator.h>
 
 #include "board-9615.h"
@@ -83,6 +84,9 @@
 VREG_CONSUMERS(LVS1) = {
 	REGULATOR_SUPPLY("8018_lvs1",		NULL),
 };
+VREG_CONSUMERS(EXT_2P95V) = {
+	REGULATOR_SUPPLY("ext_2p95v",		NULL),
+};
 
 #define PM8018_VREG_INIT(_id, _min_uV, _max_uV, _modes, _ops, _apply_uV, \
 			 _pull_down, _always_on, _supply_regulator, \
@@ -238,6 +242,25 @@
 		.pin_ctrl = _pin_ctrl, \
 	}
 
+#define GPIO_VREG_INIT(_id, _reg_name, _gpio_label, _gpio) \
+	[GPIO_VREG_ID_##_id] = { \
+		.init_data = { \
+			.constraints = { \
+				.valid_ops_mask	= REGULATOR_CHANGE_STATUS, \
+			}, \
+			.num_consumer_supplies	= \
+					ARRAY_SIZE(vreg_consumers_##_id), \
+			.consumer_supplies	= vreg_consumers_##_id, \
+		}, \
+		.regulator_name = _reg_name, \
+		.gpio_label	= _gpio_label, \
+		.gpio		= _gpio, \
+	}
+
+/* GPIO regulator constraints */
+struct gpio_regulator_platform_data msm_gpio_regulator_pdata[] = {
+	GPIO_VREG_INIT(EXT_2P95V, "ext_2p95v", "ext_2p95_en", 18),
+};
 
 /* PM8018 regulator constraints */
 struct pm8018_regulator_platform_data