summaryrefslogtreecommitdiff
path: root/drivers/sysreset
diff options
context:
space:
mode:
authorPatrick Delaunay <patrick.delaunay@st.com>2019-05-20 10:58:39 +0200
committerPatrick Delaunay <patrick.delaunay@st.com>2019-07-12 11:18:53 +0200
commit486942184a5ac72a0a6d77bbb4527b5baeb901de (patch)
treeb158c7d8fb44e6854e244c31e65464a610f11203 /drivers/sysreset
parent4048e171d2de7b6eafb52875014a036f97e7dc38 (diff)
downloadu-boot-486942184a5ac72a0a6d77bbb4527b5baeb901de.tar.gz
u-boot-486942184a5ac72a0a6d77bbb4527b5baeb901de.tar.bz2
u-boot-486942184a5ac72a0a6d77bbb4527b5baeb901de.zip
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. Signed-off-by: Patrick Delaunay <patrick.delaunay@st.com>
Diffstat (limited to 'drivers/sysreset')
-rw-r--r--drivers/sysreset/sysreset_syscon.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/sysreset/sysreset_syscon.c b/drivers/sysreset/sysreset_syscon.c
index 1028160247..d0e586f66f 100644
--- a/drivers/sysreset/sysreset_syscon.c
+++ b/drivers/sysreset/sysreset_syscon.c
@@ -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 */ }
};