mxs_nand: Update compatible string for i.MX6SX
[oweals/u-boot.git] / drivers / sysreset / sysreset_syscon.c
index 1028160247ac4171ca6f881702d48a1985798fa8..f64701aab3c834ad967a30f04b1ef3ca0a217e81 100644 (file)
@@ -13,6 +13,7 @@
 #include <regmap.h>
 #include <sysreset.h>
 #include <syscon.h>
+#include <linux/err.h>
 
 struct syscon_reboot_priv {
        struct regmap *regmap;
@@ -23,8 +24,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 +55,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 */ }
 };