提交 82cd1a2a 编写于 作者: P Patrick Delaunay

pmic: stpmic1: add support for SYSRESET_POWER_OFF

Adds support for SYSRESET_POWER_OFF = PMIC power off used by command
power off and introduced by commit 751fed42 ("sysreset: Add a way
to find the last reset").
The driver use SYSRESET_POWER for the PMIC-level power cycle, with restart.
Signed-off-by: NPatrick Delaunay <patrick.delaunay@st.com>
上级 35a54d41
......@@ -221,7 +221,7 @@ static int stpmic1_sysreset_request(struct udevice *dev, enum sysreset_t type)
struct udevice *pmic_dev;
int ret;
if (type != SYSRESET_POWER)
if (type != SYSRESET_POWER && type != SYSRESET_POWER_OFF)
return -EPROTONOSUPPORT;
ret = uclass_get_device_by_driver(UCLASS_PMIC,
......@@ -235,8 +235,13 @@ static int stpmic1_sysreset_request(struct udevice *dev, enum sysreset_t type)
if (ret < 0)
return ret;
ret = pmic_reg_write(pmic_dev, STPMIC1_MAIN_CR,
ret | STPMIC1_SWOFF | STPMIC1_RREQ_EN);
ret |= STPMIC1_SWOFF;
ret &= ~STPMIC1_RREQ_EN;
/* request Power Cycle */
if (type == SYSRESET_POWER)
ret |= STPMIC1_RREQ_EN;
ret = pmic_reg_write(pmic_dev, STPMIC1_MAIN_CR, ret);
if (ret < 0)
return ret;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册