summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
authorAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2021-06-16 13:49:01 +0000
committerAndrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>2021-06-16 13:49:01 +0000
commit5134d8a627a2d5df24640674e500a725652bcd0d (patch)
treec562226f2483929fd1c461c2b9edbe0f6f994d37 /drivers/regulator
parentef8eb7d4787bee4be718a83b6c73fb8cc7e8f158 (diff)
parentffe4d2a0684d4e6aa6ff066b1cd8663a62f2888c (diff)
Merge tag 'v5.4.126' into 5.4-2.3.x-imx
This is the 5.4.126 stable release Conflicts: - drivers/usb/cdns3/gadget.c: Skip upstream commit f0509160f25e3 ("usb: cdns3: Fix runtime PM imbalance on error") as the implementation is not present in the NXP tree to apply it. Signed-off-by: Andrey Zhizhikin <andrey.zhizhikin@leica-geosystems.com>
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/core.c6
-rw-r--r--drivers/regulator/max77620-regulator.c7
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
index aa86f2ec480f..94b3fd891cac 100644
--- a/drivers/regulator/core.c
+++ b/drivers/regulator/core.c
@@ -1381,6 +1381,12 @@ static int set_machine_constraints(struct regulator_dev *rdev)
* and we have control then make sure it is enabled.
*/
if (rdev->constraints->always_on || rdev->constraints->boot_on) {
+ /* If we want to enable this regulator, make sure that we know
+ * the supplying regulator.
+ */
+ if (rdev->supply_name && !rdev->supply)
+ return -EPROBE_DEFER;
+
if (rdev->supply) {
ret = regulator_enable(rdev->supply);
if (ret < 0) {
diff --git a/drivers/regulator/max77620-regulator.c b/drivers/regulator/max77620-regulator.c
index 8d9731e4052b..5c439c850d09 100644
--- a/drivers/regulator/max77620-regulator.c
+++ b/drivers/regulator/max77620-regulator.c
@@ -814,6 +814,13 @@ static int max77620_regulator_probe(struct platform_device *pdev)
config.dev = dev;
config.driver_data = pmic;
+ /*
+ * Set of_node_reuse flag to prevent driver core from attempting to
+ * claim any pinmux resources already claimed by the parent device.
+ * Otherwise PMIC driver will fail to re-probe.
+ */
+ device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent);
+
for (id = 0; id < MAX77620_NUM_REGS; id++) {
struct regulator_dev *rdev;
struct regulator_desc *rdesc;