sysreset: syscon: add support for power off
PATCH 1/1 sysreset: syscon: add support for power off
The new type sysreset 'POWER_OFF', introduced by
commit 751fed426f87 ("sysreset: Add a way to find the last reset") is only supported for "syscon-poweroff" compatible.
For details see Linux binding:./Documentation/devicetree/bindings/power/reset/syscon-poweroff.txt
This patch removes the support of POWER_OFF for "syscon-reboot" and keeps only the COLD reset (for command reset support) and it introduces the compatible "syscon-poweroff" for the POWER_OFF case.
---
drivers/sysreset/sysreset_syscon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/sysreset/sysreset_syscon.c +4 -2
@@ -23,8 +23,9 @@ struct syscon_reboot_priv {static int syscon_reboot_request (struct udevice *dev,enum sysreset_t type) {struct syscon_reboot_priv *priv =dev_get_priv (dev); +ulong driver_data =dev_get_driver_data (dev); -if (type ==SYSRESET_POWER ) +if (type != driver_data)return -EPROTONOSUPPORT ;regmap_write (priv->regmap, priv->offset, priv->mask);
@@ -53,7 +54,8 @@ int syscon_reboot_probe(struct udevice *dev) }static const struct udevice_id syscon_reboot_ids[] = { - { .compatible ="syscon-reboot" }, + { .compatible ="syscon-reboot" , .data =SYSRESET_COLD }, + { .compatible ="syscon-poweroff" , .data =SYSRESET_POWER_OFF }, {/* sentinel */ } };
Signature · 1 line
2.7.4
PATCH 1/1 sysreset: syscon: add support for power off
Hi,
Quoted 15 lines
From: Patrick DELAUNAY <[email protected]>
Sent: lundi 20 mai 2019 10:59The new type sysreset '
POWER_OFF', introduced by commit751fed426f87("sysreset: Add a way to find the last reset") is only supported for "syscon- poweroff" compatible.For details see Linux binding:
./Documentation/devicetree/bindings/power/reset/syscon-poweroff.txtThis patch removes the support of
POWER_OFFfor "syscon-reboot" and keeps only the COLD reset (for command reset support) and it introduces the compatible "syscon-poweroff"
for thePOWER_OFFcase.
Quoted 6 lines
Signed-off-by Patrick Delaunay <[email protected]>---
drivers/sysreset/sysreset_syscon.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
Applied to u-boot-stm32/master, thanks!
Patrick