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);
regmap_write(priv->regmap, priv->offset, priv->mask);
static struct sysreset_ops syscon_reboot_ops = {
.request = syscon_reboot_request,
int syscon_reboot_probe(struct udevice *dev)
struct syscon_reboot_priv *priv = dev_get_priv(dev);
err = uclass_get_device_by_phandle(UCLASS_SYSCON, dev,
pr_err("unable to find syscon device\n");
priv->regmap = syscon_get_regmap(syscon);
pr_err("unable to find regmap\n");
priv->offset = dev_read_u32_default(dev, "offset", 0);
priv->mask = dev_read_u32_default(dev, "mask", 0);
static const struct udevice_id syscon_reboot_ids[] = {
{ .compatible = "syscon-reboot" },