msm: 9615: Use gpio-regulator driver for SDC1

Instead of controlling the GPIO that powers up SD/MMC cards
in SDC1 slot from the board file, make use of the gpio-regulator
driver and control the regulator from the SD/MMC driver.

Change-Id: I820ac334f69fb41a79a074eddfe38930a0d30bb3
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
diff --git a/drivers/mmc/host/msm_sdcc.c b/drivers/mmc/host/msm_sdcc.c
index 31c4172..6181758 100644
--- a/drivers/mmc/host/msm_sdcc.c
+++ b/drivers/mmc/host/msm_sdcc.c
@@ -1682,16 +1682,20 @@
 {
 	int rc = 0;
 
-	rc = regulator_set_optimum_mode(vreg->reg, uA_load);
-	if (rc < 0)
-		pr_err("%s: regulator_set_optimum_mode(reg=%s, uA_load=%d)"
-			" failed. rc=%d\n", __func__, vreg->name,
-			uA_load, rc);
-	else
-		/* regulator_set_optimum_mode() can return non zero value
-		 * even for success case.
-		 */
-		rc = 0;
+	/* regulators that do not support regulator_set_voltage also
+	   do not support regulator_set_optimum_mode */
+	if (vreg->set_voltage_sup) {
+		rc = regulator_set_optimum_mode(vreg->reg, uA_load);
+		if (rc < 0)
+			pr_err("%s: regulator_set_optimum_mode(reg=%s, "
+				"uA_load=%d) failed. rc=%d\n", __func__,
+				vreg->name, uA_load, rc);
+		else
+			/* regulator_set_optimum_mode() can return non zero
+			 * value even for success case.
+			 */
+			rc = 0;
+	}
 
 	return rc;
 }