power: pmic: enable sysreset function with device tree property

Add a condition to enable the PMIC sysreset function via the
system-power-controller device tree property in addition to the existing
Kconfig dependency, provided the PMIC supports it.

Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Quentin Schulz <quentin.schulz@cherry.de> # RK8xx
This commit is contained in:
Svyatoslav Ryhel
2026-02-07 19:43:40 +02:00
parent 67ef43b491
commit 20531fa618
6 changed files with 17 additions and 6 deletions

View File

@@ -46,7 +46,9 @@ static int max77663_bind(struct udevice *dev)
ofnode regulators_node;
int children, ret;
if (IS_ENABLED(CONFIG_SYSRESET_MAX77663)) {
if (IS_ENABLED(CONFIG_SYSRESET_MAX77663) &&
(dev_read_bool(dev, "maxim,system-power-controller") ||
dev_read_bool(dev, "system-power-controller"))) {
ret = device_bind_driver_to_node(dev, MAX77663_RST_DRIVER,
"sysreset", dev_ofnode(dev),
NULL);

View File

@@ -48,7 +48,8 @@ static int max8907_bind(struct udevice *dev)
int children, ret;
if (IS_ENABLED(CONFIG_SYSRESET_MAX8907) &&
dev_read_bool(dev, "maxim,system-power-controller")) {
(dev_read_bool(dev, "maxim,system-power-controller") ||
dev_read_bool(dev, "system-power-controller"))) {
ret = device_bind_driver_to_node(dev, MAX8907_RST_DRIVER,
"sysreset", dev_ofnode(dev),
NULL);

View File

@@ -48,7 +48,9 @@ static int palmas_bind(struct udevice *dev)
ofnode subnode, gpio_node;
int children, ret;
if (IS_ENABLED(CONFIG_SYSRESET_PALMAS)) {
if (IS_ENABLED(CONFIG_SYSRESET_PALMAS) &&
(dev_read_bool(dev, "ti,system-power-controller") ||
dev_read_bool(dev, "system-power-controller"))) {
ret = device_bind_driver_to_node(dev, PALMAS_RST_DRIVER,
"sysreset", dev_ofnode(dev),
NULL);

View File

@@ -61,7 +61,9 @@ static int pmic_tps65910_bind(struct udevice *dev)
ofnode regulators_node;
int children, ret;
if (IS_ENABLED(CONFIG_SYSRESET_TPS65910)) {
if (IS_ENABLED(CONFIG_SYSRESET_TPS65910) &&
(dev_read_bool(dev, "ti,system-power-controller") ||
dev_read_bool(dev, "system-power-controller"))) {
ret = device_bind_driver(dev, TPS65910_RST_DRIVER,
"sysreset", NULL);
if (ret) {

View File

@@ -220,7 +220,9 @@ static int rk8xx_bind(struct udevice *dev)
debug("%s: '%s' - found regulators subnode\n", __func__, dev->name);
if (CONFIG_IS_ENABLED(SYSRESET)) {
if (CONFIG_IS_ENABLED(SYSRESET) &&
(dev_read_bool(dev, "rockchip,system-power-controller") ||
dev_read_bool(dev, "system-power-controller"))) {
ret = device_bind_driver_to_node(dev, "rk8xx_sysreset",
"rk8xx_sysreset",
dev_ofnode(dev), NULL);

View File

@@ -46,7 +46,9 @@ static int tps80031_bind(struct udevice *dev)
ofnode regulators_node;
int children, ret;
if (IS_ENABLED(CONFIG_SYSRESET_TPS80031)) {
if (IS_ENABLED(CONFIG_SYSRESET_TPS80031) &&
(dev_read_bool(dev, "ti,system-power-controller") ||
dev_read_bool(dev, "system-power-controller"))) {
ret = device_bind_driver(dev, TPS80031_RST_DRIVER,
"sysreset", NULL);
if (ret) {