regulator: rk818: fix of_regulator_match table boost id missing
authorchenjh <chenjh@rock-chips.com>
Thu, 2 Mar 2017 04:08:11 +0000 (12:08 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 2 Mar 2017 07:20:00 +0000 (15:20 +0800)
Change-Id: I9703deb0cef7b6e721fb7e5f68ffbea5803bdc5a
Signed-off-by: chenjh <chenjh@rock-chips.com>
drivers/regulator/rk818-regulator.c

index e7ffb2e643bbb838cb2f316b0a3f45ebfd3619f0..42f2b5aa68fff5d28e76015590334bc230e04439 100644 (file)
@@ -32,6 +32,7 @@
 #define RK818_BUCK4_VSEL_MASK  0x1f
 #define RK818_LDO_VSEL_MASK    0x1f
 #define RK818_LDO3_VSEL_MASK   0x0f
+#define RK818_BOOST_ON_VSEL_MASK       0xe0
 
 /* Ramp rate definitions for buck1 / buck2 only */
 #define RK818_RAMP_RATE_OFFSET         3
@@ -108,6 +109,10 @@ static const struct regulator_linear_range rk818_ldo6_voltage_ranges[] = {
        REGULATOR_LINEAR_RANGE(800000, 0, 17, 100000),
 };
 
+static const struct regulator_linear_range rk818_boost_voltage_ranges[] = {
+       REGULATOR_LINEAR_RANGE(4700000, 0, 7, 100000),
+};
+
 static int rk818_set_ramp_delay(struct regulator_dev *rdev, int ramp_delay)
 {
        struct rk808 *rk818 = rdev->reg_data;
@@ -398,6 +403,21 @@ static const struct regulator_desc rk818_desc[] = {
                .enable_reg = RK818_DCDC_EN_REG,
                .enable_mask = BIT(3),
                .owner = THIS_MODULE,
+       }, {
+               .name = "DCDC_BOOST",
+               .supply_name = "boost",
+               .id = RK818_ID_BOOST,
+               .ops = &rk818_reg_ops,
+               .type = REGULATOR_VOLTAGE,
+               .n_voltages = 8,
+               .linear_ranges = rk818_boost_voltage_ranges,
+               .n_linear_ranges = ARRAY_SIZE(rk818_boost_voltage_ranges),
+               .vsel_reg = RK818_BOOST_LDO9_ON_VSEL_REG,
+               .vsel_mask = RK818_BOOST_ON_VSEL_MASK,
+               .enable_reg = RK818_DCDC_EN_REG,
+               .enable_mask = BIT(4),
+               .enable_time = 0,
+               .owner = THIS_MODULE,
        }, {
                .name = "LDO_REG1",
                .supply_name = "vcc6",
@@ -550,6 +570,7 @@ static struct of_regulator_match rk818_reg_matches[] = {
        [RK818_ID_DCDC2]        = { .name = "DCDC_REG2" },
        [RK818_ID_DCDC3]        = { .name = "DCDC_REG3" },
        [RK818_ID_DCDC4]        = { .name = "DCDC_REG4" },
+       [RK818_ID_BOOST]        = { .name = "DCDC_BOOST" },
        [RK818_ID_LDO1]         = { .name = "LDO_REG1" },
        [RK818_ID_LDO2]         = { .name = "LDO_REG2" },
        [RK818_ID_LDO3]         = { .name = "LDO_REG3" },
@@ -729,7 +750,7 @@ static int rk818_regulator_probe(struct platform_device *pdev)
        case RK818_ID:
                reg_desc = rk818_desc;
                reg_matches = rk818_reg_matches;
-               reg_nr = RK818_NUM_REGULATORS;
+               reg_nr = ARRAY_SIZE(rk818_reg_matches);
                break;
        case RK805_ID:
                reg_desc = rk805_desc;