| // SPDX-License-Identifier: GPL-2.0+ |
| * Copyright(C) 2023 Svyatoslav Ryhel <clamor95@gmail.com> |
| #include <power/palmas.h> |
| static int palmas_sysreset_request(struct udevice *dev, |
| struct palmas_priv *priv = dev_get_priv(dev->parent); |
| * Mask INT3 on second page which detects vbus |
| * or device will immediately turn on. |
| ret = dm_i2c_reg_clrset(priv->chip2, PALMAS_INT3_MASK, |
| /* PALMAS: SW_RST > DEV_CTRL */ |
| pmic_reg_write(dev->parent, PALMAS_DEV_CTRL, SW_RST); |
| /* PALMAS: DEV_OFF > DEV_CTRL */ |
| pmic_reg_write(dev->parent, PALMAS_DEV_CTRL, DEV_OFF); |
| static struct sysreset_ops palmas_sysreset = { |
| .request = palmas_sysreset_request, |
| U_BOOT_DRIVER(sysreset_palmas) = { |
| .name = PALMAS_RST_DRIVER, |