regulator: qpnp-labibb: Allow 0 ms for IBB PWRUP_DLY1 and PWRDN_DLY2
Currently, IBB PWRUP_DLY1 and PWRDN_DLY2 settings are configured only for values greater than 0. However, 0 ms (no delay) can be allowed by disabling EN_PWRUP_DLY1 or EN_PWRDN_DLY2 bits. Add support to allow this configuration. CRs-Fixed: 2125062 Change-Id: I8ef3b5522b8d4db6befb3fb1c2e58ea24c0f5ea0 Signed-off-by: Subbaraman Narayanamurthy <subbaram@codeaurora.org>
This commit is contained in:
parent
ce1d2a8266
commit
1b9a30ef0e
1 changed files with 27 additions and 16 deletions
|
@ -3272,7 +3272,7 @@ static int qpnp_ibb_dt_init(struct qpnp_labibb *labibb,
|
||||||
struct device_node *of_node)
|
struct device_node *of_node)
|
||||||
{
|
{
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
u32 i, tmp = 0;
|
u32 i = 0, tmp = 0;
|
||||||
u8 val, mask;
|
u8 val, mask;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -3306,37 +3306,48 @@ static int qpnp_ibb_dt_init(struct qpnp_labibb *labibb,
|
||||||
rc = of_property_read_u32(of_node,
|
rc = of_property_read_u32(of_node,
|
||||||
"qcom,qpnp-ibb-lab-pwrdn-delay", &tmp);
|
"qcom,qpnp-ibb-lab-pwrdn-delay", &tmp);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
for (val = 0; val < ARRAY_SIZE(ibb_pwrdn_dly_table); val++)
|
if (tmp > 0) {
|
||||||
if (ibb_pwrdn_dly_table[val] == tmp)
|
for (i = 0; i < ARRAY_SIZE(ibb_pwrdn_dly_table); i++) {
|
||||||
break;
|
if (ibb_pwrdn_dly_table[i] == tmp)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (val == ARRAY_SIZE(ibb_pwrdn_dly_table)) {
|
if (i == ARRAY_SIZE(ibb_pwrdn_dly_table)) {
|
||||||
pr_err("Invalid value in qcom,qpnp-ibb-lab-pwrdn-delay\n");
|
pr_err("Invalid value in qcom,qpnp-ibb-lab-pwrdn-delay\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
labibb->ibb_vreg.pwrdn_dly = tmp;
|
labibb->ibb_vreg.pwrdn_dly = tmp;
|
||||||
val |= IBB_PWRUP_PWRDN_CTL_1_EN_DLY2;
|
|
||||||
|
if (tmp > 0)
|
||||||
|
val = i | IBB_PWRUP_PWRDN_CTL_1_EN_DLY2;
|
||||||
|
|
||||||
mask |= IBB_PWRUP_PWRDN_CTL_1_EN_DLY2;
|
mask |= IBB_PWRUP_PWRDN_CTL_1_EN_DLY2;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = of_property_read_u32(of_node,
|
rc = of_property_read_u32(of_node,
|
||||||
"qcom,qpnp-ibb-lab-pwrup-delay", &tmp);
|
"qcom,qpnp-ibb-lab-pwrup-delay", &tmp);
|
||||||
if (!rc) {
|
if (!rc) {
|
||||||
for (i = 0; i < ARRAY_SIZE(ibb_pwrup_dly_table); i++)
|
if (tmp > 0) {
|
||||||
if (ibb_pwrup_dly_table[i] == tmp)
|
for (i = 0; i < ARRAY_SIZE(ibb_pwrup_dly_table); i++) {
|
||||||
break;
|
if (ibb_pwrup_dly_table[i] == tmp)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
if (i == ARRAY_SIZE(ibb_pwrup_dly_table)) {
|
if (i == ARRAY_SIZE(ibb_pwrup_dly_table)) {
|
||||||
pr_err("Invalid value in qcom,qpnp-ibb-lab-pwrup-delay\n");
|
pr_err("Invalid value in qcom,qpnp-ibb-lab-pwrup-delay\n");
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
labibb->ibb_vreg.pwrup_dly = tmp;
|
labibb->ibb_vreg.pwrup_dly = tmp;
|
||||||
|
|
||||||
|
if (tmp > 0)
|
||||||
|
val |= IBB_PWRUP_PWRDN_CTL_1_EN_DLY1;
|
||||||
|
|
||||||
val |= (i << IBB_PWRUP_PWRDN_CTL_1_DLY1_SHIFT);
|
val |= (i << IBB_PWRUP_PWRDN_CTL_1_DLY1_SHIFT);
|
||||||
val |= (IBB_PWRUP_PWRDN_CTL_1_EN_DLY1 |
|
val |= IBB_PWRUP_PWRDN_CTL_1_LAB_VREG_OK;
|
||||||
IBB_PWRUP_PWRDN_CTL_1_LAB_VREG_OK);
|
|
||||||
mask |= (IBB_PWRUP_PWRDN_CTL_1_EN_DLY1 |
|
mask |= (IBB_PWRUP_PWRDN_CTL_1_EN_DLY1 |
|
||||||
IBB_PWRUP_PWRDN_CTL_1_DLY1_MASK |
|
IBB_PWRUP_PWRDN_CTL_1_DLY1_MASK |
|
||||||
IBB_PWRUP_PWRDN_CTL_1_LAB_VREG_OK);
|
IBB_PWRUP_PWRDN_CTL_1_LAB_VREG_OK);
|
||||||
|
|
Loading…
Add table
Reference in a new issue