summaryrefslogtreecommitdiff
path: root/drivers/regulator
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/regulator')
-rw-r--r--drivers/regulator/max77802.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/drivers/regulator/max77802.c b/drivers/regulator/max77802.c
index ad1caa902ef0..967e10934d3e 100644
--- a/drivers/regulator/max77802.c
+++ b/drivers/regulator/max77802.c
@@ -540,7 +540,17 @@ static int max77802_pmic_probe(struct platform_device *pdev)
config.of_node = pdata->regulators[i].of_node;
ret = regmap_read(iodev->regmap, regulators[i].enable_reg, &val);
- max77802->opmode[id] = val >> shift & MAX77802_OPMODE_MASK;
+ val = val >> shift & MAX77802_OPMODE_MASK;
+
+ /*
+ * If the regulator is disabled and the system warm rebooted,
+ * the hardware reports OFF as the regulator operating mode.
+ * Default to operating mode NORMAL in that case.
+ */
+ if (val == MAX77802_OPMODE_OFF)
+ max77802->opmode[id] = MAX77802_OPMODE_NORMAL;
+ else
+ max77802->opmode[id] = val;
rdev = devm_regulator_register(&pdev->dev,
&regulators[i], &config);