diff options
| author | Svyatoslav Ryhel <[email protected]> | 2023-10-24 10:49:05 +0300 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-11-03 17:40:40 -0400 |
| commit | fa1e72ea3d62f561fb990113ce404ad603d61e83 (patch) | |
| tree | 900d6875c78c653a1664703856eb8afa0abce5c5 /drivers/power | |
| parent | 102c4e3183e8166541f57acb9e35aff1c38e4947 (diff) | |
sysreset: implement MAX77663 sysreset functions
MAX77663 PMIC has embedded poweroff function used by some
device to initiane device power off. Implement it as sysreset
driver.
Signed-off-by: Svyatoslav Ryhel <[email protected]>
Diffstat (limited to 'drivers/power')
| -rw-r--r-- | drivers/power/pmic/max77663.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/power/pmic/max77663.c b/drivers/power/pmic/max77663.c index fac97ed221e..68c3cbbc646 100644 --- a/drivers/power/pmic/max77663.c +++ b/drivers/power/pmic/max77663.c @@ -44,7 +44,16 @@ static int max77663_read(struct udevice *dev, uint reg, uint8_t *buff, int len) static int max77663_bind(struct udevice *dev) { ofnode regulators_node; - int children; + int children, ret; + + if (IS_ENABLED(CONFIG_SYSRESET_MAX77663)) { + ret = device_bind_driver(dev, MAX77663_RST_DRIVER, + "sysreset", NULL); + if (ret) { + log_err("cannot bind SYSRESET (ret = %d)\n", ret); + return ret; + } + } regulators_node = dev_read_subnode(dev, "regulators"); if (!ofnode_valid(regulators_node)) { |
