Revert "power: regulator: Trigger probe of regulators which are always-on or boot-on"

Unfortunately this commit causes a problem on nyan-big:

   U-Boot SPL 2024.10-rc6-00632-g51c4679d2f84 (Nov 30 2024 - 13:28:40 -0700)
   Trying to boot from RAM

   U-Boot 2024.10-rc6-00632-g51c4679d2f84 (Nov 30 2024 - 13:28:40 -0700)

   SoC: tegra124
   Reset cause: POR
   Model: Acer Chromebook 13 CB5-311
   Board: Google/NVIDIA Nyan-big, ID: -2
   DRAM:  2 GiB
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   failed to read ID1 register: -121
   failed to read ID: -121
   Unknown PLL id 14
   failed to read ID1 register: -121
   failed to read ID: -121
   initcall failed at call 810029c8 (err=-121: Remote I/O error)
   ### ERROR ### Please RESET the board ###

This reverts commit 51c4679d2f.

Tweak a few tests also, so they continue to pass.

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2024-12-01 07:42:30 -07:00
parent 1b244135e2
commit e7100b4c37
2 changed files with 11 additions and 17 deletions

View File

@@ -433,8 +433,6 @@ static int regulator_post_bind(struct udevice *dev)
const char *property = "regulator-name";
uc_pdata = dev_get_uclass_plat(dev);
uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on");
uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on");
/* Regulator's mandatory constraint */
uc_pdata->name = dev_read_string(dev, property);
@@ -446,21 +444,13 @@ static int regulator_post_bind(struct udevice *dev)
return -EINVAL;
}
if (!regulator_name_is_unique(dev, uc_pdata->name)) {
debug("'%s' of dev: '%s', has nonunique value: '%s\n",
property, dev->name, uc_pdata->name);
return -EINVAL;
}
if (regulator_name_is_unique(dev, uc_pdata->name))
return 0;
/*
* In case the regulator has regulator-always-on or
* regulator-boot-on DT property, trigger probe() to
* configure its default state during startup.
*/
if (uc_pdata->always_on || uc_pdata->boot_on)
dev_or_flags(dev, DM_FLAG_PROBE_AFTER_BIND);
debug("'%s' of dev: '%s', has nonunique value: '%s\n",
property, dev->name, uc_pdata->name);
return 0;
return -EINVAL;
}
static int regulator_pre_probe(struct udevice *dev)
@@ -483,6 +473,8 @@ static int regulator_pre_probe(struct udevice *dev)
-ENODATA);
uc_pdata->max_uA = dev_read_u32_default(dev, "regulator-max-microamp",
-ENODATA);
uc_pdata->always_on = dev_read_bool(dev, "regulator-always-on");
uc_pdata->boot_on = dev_read_bool(dev, "regulator-boot-on");
uc_pdata->ramp_delay = dev_read_u32_default(dev, "regulator-ramp-delay",
0);
uc_pdata->force_off = dev_read_bool(dev, "regulator-force-boot-off");

View File

@@ -186,7 +186,8 @@ int dm_test_power_regulator_set_enable_if_allowed(struct unit_test_state *uts)
/* Get BUCK1 - always on regulator */
platname = regulator_names[BUCK1][PLATNAME];
ut_asserteq(-EALREADY, regulator_autoset_by_name(platname, &dev_autoset));
ut_asserteq(-EALREADY,
regulator_autoset_by_name(platname, &dev_autoset));
ut_assertok(regulator_get_by_platname(platname, &dev));
/* Try disabling always-on regulator */
@@ -288,7 +289,8 @@ static int dm_test_power_regulator_autoset(struct unit_test_state *uts)
* Expected output state: uV=1200000; uA=200000; output enabled
*/
platname = regulator_names[BUCK1][PLATNAME];
ut_asserteq(-EALREADY, regulator_autoset_by_name(platname, &dev_autoset));
ut_asserteq(-EALREADY,
regulator_autoset_by_name(platname, &dev_autoset));
/* Check, that the returned device is proper */
ut_assertok(regulator_get_by_platname(platname, &dev));