regulator: cpr3: fix system regulator vote in regulator disable path
Vote minimum possible voltage corner on system regulator in regulator disable path when the CPR controller manages an underlying LDO of type LDO300. Also, fix the regulator get failure print when vdd-supply not specified for CPRh controllers. CRs-Fixed: 1108988 Change-Id: Ic1c7b6fd4bf93dd213b2f639aa21b47890906478 Signed-off-by: Tirupathi Reddy <tirupath@codeaurora.org>
This commit is contained in:
parent
0a8e939a4e
commit
cd997caa00
2 changed files with 24 additions and 16 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -4442,6 +4442,14 @@ static int cpr3_regulator_disable(struct regulator_dev *rdev)
|
|||
rc);
|
||||
goto done;
|
||||
}
|
||||
if (ctrl->support_ldo300_vreg) {
|
||||
rc = regulator_set_voltage(ctrl->system_regulator, 0,
|
||||
INT_MAX);
|
||||
if (rc)
|
||||
cpr3_err(ctrl, "failed to set voltage on system rc=%d\n",
|
||||
rc);
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
cpr3_debug(vreg, "Disabled\n");
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2015-2016, The Linux Foundation. All rights reserved.
|
||||
* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License version 2 and
|
||||
|
@ -1203,21 +1203,21 @@ int cpr3_parse_common_ctrl_data(struct cpr3_controller *ctrl)
|
|||
if (rc)
|
||||
return rc;
|
||||
|
||||
ctrl->vdd_regulator = devm_regulator_get(ctrl->dev, "vdd");
|
||||
if (IS_ERR(ctrl->vdd_regulator)) {
|
||||
rc = PTR_ERR(ctrl->vdd_regulator);
|
||||
if (rc != -EPROBE_DEFER) {
|
||||
/* vdd-supply is optional for CPRh controllers. */
|
||||
if (ctrl->ctrl_type == CPR_CTRL_TYPE_CPRH) {
|
||||
cpr3_debug(ctrl, "unable to request vdd regulator, rc=%d\n",
|
||||
rc);
|
||||
ctrl->vdd_regulator = NULL;
|
||||
return 0;
|
||||
}
|
||||
cpr3_err(ctrl, "unable to request vdd regulator, rc=%d\n",
|
||||
rc);
|
||||
if (of_find_property(ctrl->dev->of_node, "vdd-supply", NULL)) {
|
||||
ctrl->vdd_regulator = devm_regulator_get(ctrl->dev, "vdd");
|
||||
if (IS_ERR(ctrl->vdd_regulator)) {
|
||||
rc = PTR_ERR(ctrl->vdd_regulator);
|
||||
if (rc != -EPROBE_DEFER)
|
||||
cpr3_err(ctrl, "unable to request vdd regulator, rc=%d\n",
|
||||
rc);
|
||||
return rc;
|
||||
}
|
||||
return rc;
|
||||
} else if (ctrl->ctrl_type == CPR_CTRL_TYPE_CPRH) {
|
||||
/* vdd-supply is optional for CPRh controllers. */
|
||||
ctrl->vdd_regulator = NULL;
|
||||
} else {
|
||||
cpr3_err(ctrl, "vdd supply is not defined\n");
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Add table
Reference in a new issue