diff mbox

[43/73] regulator: ab8500: Add VSDIO definition for the AB8540

Message ID 1359978868-28736-44-git-send-email-lee.jones@linaro.org
State New
Headers show

Commit Message

Lee Jones Feb. 4, 2013, 11:53 a.m. UTC
Add the definitions for VSDIO to Regulator Framework for AB8540.

Signed-off-by: Zhenhua HUANG <zhenhua.huang@stericsson.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Reviewed-by: Xiao Mei ZHANG <xiaomei.zhang@stericsson.com>
Reviewed-by: Mattias WALLIN <mattias.wallin@stericsson.com>
Reviewed-by: Mian Yousaf KAUKAB <mian.yousaf.kaukab@stericsson.com>
Reviewed-by: Philippe LANGLAIS <philippe.langlais@stericsson.com>
Tested-by: Maxime COQUELIN <maxime.coquelin@stericsson.com>
---
 drivers/regulator/ab8500.c       |   35 +++++++++++++++++++++++++++++++++++
 include/linux/regulator/ab8500.h |    1 +
 2 files changed, 36 insertions(+)
diff mbox

Patch

diff --git a/drivers/regulator/ab8500.c b/drivers/regulator/ab8500.c
index 1f1f361..2a08642 100644
--- a/drivers/regulator/ab8500.c
+++ b/drivers/regulator/ab8500.c
@@ -132,6 +132,17 @@  static const unsigned int ldo_vintcore_voltages[] = {
 	1350000,
 };
 
+static const int ldo_sdio_voltages[] = {
+	1160000,
+	1050000,
+	1100000,
+	1500000,
+	1800000,
+	2200000,
+	2910000,
+	3050000,
+};
+
 static int ab8500_regulator_enable(struct regulator_dev *rdev)
 {
 	int ret;
@@ -1409,6 +1420,30 @@  static struct ab8500_regulator_info
 		.update_val_idle	= 0x0c,
 		.update_val_normal	= 0x04,
 	},
+	[AB8540_LDO_SDIO] = {
+		.desc = {
+			.name		= "LDO-SDIO",
+			.ops		= &ab8500_regulator_volt_mode_ops,
+			.type		= REGULATOR_VOLTAGE,
+			.id		= AB8540_LDO_SDIO,
+			.owner		= THIS_MODULE,
+			.n_voltages = ARRAY_SIZE(ldo_sdio_voltages),
+		},
+		.min_uV			= 1050000,
+		.max_uV			= 3050000,
+		.load_lp_uA		= 5000,
+		.update_bank		= 0x03,
+		.update_reg		= 0x88,
+		.update_mask		= 0x30,
+		.update_val		= 0x10,
+		.update_val_idle	= 0x00,
+		.update_val_normal	= 0x20,
+		.voltage_bank		= 0x03,
+		.voltage_reg		= 0x88,
+		.voltage_mask		= 0x07,
+		.voltages		= ldo_sdio_voltages,
+		.voltages_len		= ARRAY_SIZE(ldo_sdio_voltages),
+	},
 };
 
 struct ab8500_reg_init {
diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
index e3d4a5b..caa9f6a 100644
--- a/include/linux/regulator/ab8500.h
+++ b/include/linux/regulator/ab8500.h
@@ -82,6 +82,7 @@  enum ab8540_regulator_id {
 	AB8540_LDO_ANAMIC2,
 	AB8540_LDO_DMIC,
 	AB8540_LDO_ANA,
+	AB8540_LDO_SDIO,
 	AB8540_SYSCLKREQ_2,
 	AB8540_SYSCLKREQ_4,
 	AB8540_NUM_REGULATORS,