diff --git a/drivers/power/supply/regulator.c b/drivers/power/supply/regulator.c index be63437b5a..4263477b16 100644 --- a/drivers/power/supply/regulator.c +++ b/drivers/power/supply/regulator.c @@ -1043,6 +1043,11 @@ regulator_register(FAR const struct regulator_desc_s *regulator_desc, list_initialize(&rdev->consumer_list); list_initialize(&rdev->list); + if (rdev->desc->bypass_on) + { + goto bypass; + } + if (rdev->desc->boot_on || rdev->desc->always_on) { ret = _regulator_do_enable(rdev); @@ -1060,6 +1065,7 @@ regulator_register(FAR const struct regulator_desc_s *regulator_desc, _regulator_do_disable(rdev); } +bypass: if (rdev->desc->apply_uv) { _regulator_do_set_voltage(rdev, rdev->desc->min_uv, diff --git a/include/nuttx/power/regulator.h b/include/nuttx/power/regulator.h index bc9a8e86b8..6251092d58 100644 --- a/include/nuttx/power/regulator.h +++ b/include/nuttx/power/regulator.h @@ -123,7 +123,10 @@ struct regulator_desc_s unsigned int boot_on; /* true if this regulator is to be enabled * at power up/reset */ - unsigned int always_on; + unsigned int always_on; /* true if this regulator is always on */ + unsigned int bypass_on; /* true if this regulator should be ignored + * during initialization + */ FAR const char *supply_name; #ifdef CONFIG_PM unsigned int auto_lp;