Commit 5e965704 authored by Axel Lin's avatar Axel Lin Committed by Mark Brown

regulator: as3722: Fix off-by-one n_voltages setting for SDx

AS3722_SDx_VSEL_MAX means the maximum selecter, the n_voltages should be
AS3722_SDx_VSEL_MAX + 1.
Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Acked-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 43f6fc95
...@@ -99,7 +99,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = { ...@@ -99,7 +99,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
.sleep_ctrl_mask = AS3722_SD0_EXT_ENABLE_MASK, .sleep_ctrl_mask = AS3722_SD0_EXT_ENABLE_MASK,
.control_reg = AS3722_SD0_CONTROL_REG, .control_reg = AS3722_SD0_CONTROL_REG,
.mode_mask = AS3722_SD0_MODE_FAST, .mode_mask = AS3722_SD0_MODE_FAST,
.n_voltages = AS3722_SD0_VSEL_MAX, .n_voltages = AS3722_SD0_VSEL_MAX + 1,
}, },
{ {
.regulator_id = AS3722_REGULATOR_ID_SD1, .regulator_id = AS3722_REGULATOR_ID_SD1,
...@@ -112,7 +112,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = { ...@@ -112,7 +112,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
.sleep_ctrl_mask = AS3722_SD1_EXT_ENABLE_MASK, .sleep_ctrl_mask = AS3722_SD1_EXT_ENABLE_MASK,
.control_reg = AS3722_SD1_CONTROL_REG, .control_reg = AS3722_SD1_CONTROL_REG,
.mode_mask = AS3722_SD1_MODE_FAST, .mode_mask = AS3722_SD1_MODE_FAST,
.n_voltages = AS3722_SD0_VSEL_MAX, .n_voltages = AS3722_SD0_VSEL_MAX + 1,
}, },
{ {
.regulator_id = AS3722_REGULATOR_ID_SD2, .regulator_id = AS3722_REGULATOR_ID_SD2,
...@@ -126,7 +126,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = { ...@@ -126,7 +126,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
.sleep_ctrl_mask = AS3722_SD2_EXT_ENABLE_MASK, .sleep_ctrl_mask = AS3722_SD2_EXT_ENABLE_MASK,
.control_reg = AS3722_SD23_CONTROL_REG, .control_reg = AS3722_SD23_CONTROL_REG,
.mode_mask = AS3722_SD2_MODE_FAST, .mode_mask = AS3722_SD2_MODE_FAST,
.n_voltages = AS3722_SD2_VSEL_MAX, .n_voltages = AS3722_SD2_VSEL_MAX + 1,
}, },
{ {
.regulator_id = AS3722_REGULATOR_ID_SD3, .regulator_id = AS3722_REGULATOR_ID_SD3,
...@@ -140,7 +140,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = { ...@@ -140,7 +140,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
.sleep_ctrl_mask = AS3722_SD3_EXT_ENABLE_MASK, .sleep_ctrl_mask = AS3722_SD3_EXT_ENABLE_MASK,
.control_reg = AS3722_SD23_CONTROL_REG, .control_reg = AS3722_SD23_CONTROL_REG,
.mode_mask = AS3722_SD3_MODE_FAST, .mode_mask = AS3722_SD3_MODE_FAST,
.n_voltages = AS3722_SD2_VSEL_MAX, .n_voltages = AS3722_SD2_VSEL_MAX + 1,
}, },
{ {
.regulator_id = AS3722_REGULATOR_ID_SD4, .regulator_id = AS3722_REGULATOR_ID_SD4,
...@@ -154,7 +154,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = { ...@@ -154,7 +154,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
.sleep_ctrl_mask = AS3722_SD4_EXT_ENABLE_MASK, .sleep_ctrl_mask = AS3722_SD4_EXT_ENABLE_MASK,
.control_reg = AS3722_SD4_CONTROL_REG, .control_reg = AS3722_SD4_CONTROL_REG,
.mode_mask = AS3722_SD4_MODE_FAST, .mode_mask = AS3722_SD4_MODE_FAST,
.n_voltages = AS3722_SD2_VSEL_MAX, .n_voltages = AS3722_SD2_VSEL_MAX + 1,
}, },
{ {
.regulator_id = AS3722_REGULATOR_ID_SD5, .regulator_id = AS3722_REGULATOR_ID_SD5,
...@@ -168,7 +168,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = { ...@@ -168,7 +168,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
.sleep_ctrl_mask = AS3722_SD5_EXT_ENABLE_MASK, .sleep_ctrl_mask = AS3722_SD5_EXT_ENABLE_MASK,
.control_reg = AS3722_SD5_CONTROL_REG, .control_reg = AS3722_SD5_CONTROL_REG,
.mode_mask = AS3722_SD5_MODE_FAST, .mode_mask = AS3722_SD5_MODE_FAST,
.n_voltages = AS3722_SD2_VSEL_MAX, .n_voltages = AS3722_SD2_VSEL_MAX + 1,
}, },
{ {
.regulator_id = AS3722_REGULATOR_ID_SD6, .regulator_id = AS3722_REGULATOR_ID_SD6,
...@@ -181,7 +181,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = { ...@@ -181,7 +181,7 @@ static const struct as3722_register_mapping as3722_reg_lookup[] = {
.sleep_ctrl_mask = AS3722_SD6_EXT_ENABLE_MASK, .sleep_ctrl_mask = AS3722_SD6_EXT_ENABLE_MASK,
.control_reg = AS3722_SD6_CONTROL_REG, .control_reg = AS3722_SD6_CONTROL_REG,
.mode_mask = AS3722_SD6_MODE_FAST, .mode_mask = AS3722_SD6_MODE_FAST,
.n_voltages = AS3722_SD0_VSEL_MAX, .n_voltages = AS3722_SD0_VSEL_MAX + 1,
}, },
{ {
.regulator_id = AS3722_REGULATOR_ID_LDO0, .regulator_id = AS3722_REGULATOR_ID_LDO0,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment