diff options
| author | Tirupathi Reddy <tirupath@codeaurora.org> | 2017-01-09 15:21:20 +0530 |
|---|---|---|
| committer | Tirupathi Reddy <tirupath@codeaurora.org> | 2017-01-11 14:16:35 +0530 |
| commit | cd997caa007151b9c2d838625a21e32394dd439a (patch) | |
| tree | c1d6da4b4eedcdc217ea128b2e520de9c6565ab7 /drivers/regulator | |
| parent | 0a8e939a4e57d86da88c9856cd266447fc45ea85 (diff) | |
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>
Diffstat (limited to 'drivers/regulator')
| -rw-r--r-- | drivers/regulator/cpr3-regulator.c | 10 | ||||
| -rw-r--r-- | drivers/regulator/cpr3-util.c | 30 |
2 files changed, 24 insertions, 16 deletions
diff --git a/drivers/regulator/cpr3-regulator.c b/drivers/regulator/cpr3-regulator.c index e3e418100eef..6775152f2623 100644 --- a/drivers/regulator/cpr3-regulator.c +++ b/drivers/regulator/cpr3-regulator.c @@ -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"); diff --git a/drivers/regulator/cpr3-util.c b/drivers/regulator/cpr3-util.c index 60fe825ca013..120ca69e100f 100644 --- a/drivers/regulator/cpr3-util.c +++ b/drivers/regulator/cpr3-util.c @@ -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; } /* |
