summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-14 03:42:59 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-14 03:42:59 -0800
commit42bd9640b2345718927b0311517483aa05bcf7f5 (patch)
tree3c45e1c629f92cff45b37fece845a8b1fa593ff0 /drivers/regulator
parenta1e7739089bd98d1c0b1bb61aa837a05f712c3af (diff)
parentcd997caa007151b9c2d838625a21e32394dd439a (diff)
Merge "regulator: cpr3: fix system regulator vote in regulator disable path"
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/cpr3-regulator.c10
-rw-r--r--drivers/regulator/cpr3-util.c30
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;
}
/*