[PATCH 3/4] regulator: s2mps11: Set offset to voltage hexadecimal code of S2MPU02 LDO regulators

From: Chanwoo Choi
Date: Wed May 28 2014 - 07:10:27 EST


From: Jonghwa Lee <jonghwa3.lee@xxxxxxxxxxx>

Different with s2mps1x series, s2mpus02's LDO has offset in voltage hexadecimal
code, which is used as in selector in regulator subsystem. It means the value of
minimum voltage is not start with 0x0, but has certain offset.
(as like BUCK regulator in both of s2mps1x and s2mpu02)

Signed-off-by: Jonghwa Lee <jonghwa3.lee@xxxxxxxxxxx>
Signed-off-by: Chanwoo Choi <cw00.choi@xxxxxxxxxxx>
---
drivers/regulator/s2mps11.c | 5 +++++
include/linux/mfd/samsung/s2mpu02.h | 4 ++++
2 files changed, 9 insertions(+)

diff --git a/drivers/regulator/s2mps11.c b/drivers/regulator/s2mps11.c
index 064d44b..6e7b322 100644
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -732,6 +732,7 @@ static struct regulator_ops s2mpu02_buck_ops = {
.owner = THIS_MODULE, \
.min_uV = S2MPU02_LDO_MIN_900MV, \
.uV_step = S2MPU02_LDO_STEP_12_5MV, \
+ .linear_min_sel = S2MPU02_LDO_GROUP1_START_SEL, \
.n_voltages = S2MPU02_LDO_N_VOLTAGES, \
.vsel_reg = S2MPU02_REG_L1CTRL, \
.vsel_mask = S2MPU02_LDO_VSEL_MASK, \
@@ -746,6 +747,7 @@ static struct regulator_ops s2mpu02_buck_ops = {
.owner = THIS_MODULE, \
.min_uV = S2MPU02_LDO_MIN_1050MV, \
.uV_step = S2MPU02_LDO_STEP_25MV, \
+ .linear_min_sel = S2MPU02_LDO_GROUP2_START_SEL, \
.n_voltages = S2MPU02_LDO_N_VOLTAGES, \
.vsel_reg = S2MPU02_REG_L2CTRL1, \
.vsel_mask = S2MPU02_LDO_VSEL_MASK, \
@@ -760,6 +762,7 @@ static struct regulator_ops s2mpu02_buck_ops = {
.owner = THIS_MODULE, \
.min_uV = S2MPU02_LDO_MIN_900MV, \
.uV_step = S2MPU02_LDO_STEP_12_5MV, \
+ .linear_min_sel = S2MPU02_LDO_GROUP1_START_SEL, \
.n_voltages = S2MPU02_LDO_N_VOLTAGES, \
.vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \
.vsel_mask = S2MPU02_LDO_VSEL_MASK, \
@@ -774,6 +777,7 @@ static struct regulator_ops s2mpu02_buck_ops = {
.owner = THIS_MODULE, \
.min_uV = S2MPU02_LDO_MIN_1050MV, \
.uV_step = S2MPU02_LDO_STEP_25MV, \
+ .linear_min_sel = S2MPU02_LDO_GROUP2_START_SEL, \
.n_voltages = S2MPU02_LDO_N_VOLTAGES, \
.vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \
.vsel_mask = S2MPU02_LDO_VSEL_MASK, \
@@ -788,6 +792,7 @@ static struct regulator_ops s2mpu02_buck_ops = {
.owner = THIS_MODULE, \
.min_uV = S2MPU02_LDO_MIN_1600MV, \
.uV_step = S2MPU02_LDO_STEP_50MV, \
+ .linear_min_sel = S2MPU02_LDO_GROUP3_START_SEL, \
.n_voltages = S2MPU02_LDO_N_VOLTAGES, \
.vsel_reg = S2MPU02_REG_L3CTRL + num - 3, \
.vsel_mask = S2MPU02_LDO_VSEL_MASK, \
diff --git a/include/linux/mfd/samsung/s2mpu02.h b/include/linux/mfd/samsung/s2mpu02.h
index 98406f4..c70d3e3 100644
--- a/include/linux/mfd/samsung/s2mpu02.h
+++ b/include/linux/mfd/samsung/s2mpu02.h
@@ -181,6 +181,10 @@ enum S2MPU02_regulators {
#define S2MPU02_LDO_STEP_25MV 25000
#define S2MPU02_LDO_STEP_50MV 50000

+#define S2MPU02_LDO_GROUP1_START_SEL 0x8
+#define S2MPU02_LDO_GROUP2_START_SEL 0xA
+#define S2MPU02_LDO_GROUP3_START_SEL 0x10
+
#define S2MPU02_LDO_VSEL_MASK 0x3F
#define S2MPU02_BUCK_VSEL_MASK 0xFF
#define S2MPU02_ENABLE_MASK (0x03 << S2MPU02_ENABLE_SHIFT)
--
1.8.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/