mirror of
https://source.denx.de/u-boot/u-boot.git
synced 2026-06-13 15:03:58 +03:00
power: regulator: Add vin-supply for GPIO and Fixed regulators
Enable the vin-supply when probing the regulator device. Signed-off-by: Ye Li <ye.li@nxp.com>
This commit is contained in:
@@ -45,6 +45,16 @@ int regulator_common_of_to_plat(struct udevice *dev,
|
|||||||
dev_read_u32_default(dev, "u-boot,off-on-delay-us", 0);
|
dev_read_u32_default(dev, "u-boot,off-on-delay-us", 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ret = device_get_supply_regulator(dev, "vin-supply", &plat->vin_supply);
|
||||||
|
if (ret) {
|
||||||
|
debug("Regulator vin regulator not defined: %d\n", ret);
|
||||||
|
if (ret != -ENOENT)
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (plat->vin_supply)
|
||||||
|
regulator_set_enable_if_allowed(plat->vin_supply, true);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ struct regulator_common_plat {
|
|||||||
unsigned int startup_delay_us;
|
unsigned int startup_delay_us;
|
||||||
unsigned int off_on_delay_us;
|
unsigned int off_on_delay_us;
|
||||||
unsigned int enable_count;
|
unsigned int enable_count;
|
||||||
|
struct udevice *vin_supply;
|
||||||
};
|
};
|
||||||
|
|
||||||
int regulator_common_of_to_plat(struct udevice *dev,
|
int regulator_common_of_to_plat(struct udevice *dev,
|
||||||
|
|||||||
Reference in New Issue
Block a user