1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2020 MediaTek Inc.
5 * Author: Weijie Gao <weijie.gao@mediatek.com>
14 struct resetctl_reboot_priv {
15 struct reset_ctl_bulk resets;
18 static int resetctl_reboot_request(struct udevice *dev, enum sysreset_t type)
20 struct resetctl_reboot_priv *priv = dev_get_priv(dev);
22 return reset_assert_bulk(&priv->resets);
25 static struct sysreset_ops resetctl_reboot_ops = {
26 .request = resetctl_reboot_request,
29 int resetctl_reboot_probe(struct udevice *dev)
31 struct resetctl_reboot_priv *priv = dev_get_priv(dev);
33 return reset_get_bulk(dev, &priv->resets);
36 static const struct udevice_id resetctl_reboot_ids[] = {
37 { .compatible = "resetctl-reboot" },
41 U_BOOT_DRIVER(resetctl_reboot) = {
42 .id = UCLASS_SYSRESET,
43 .name = "resetctl_reboot",
44 .of_match = resetctl_reboot_ids,
45 .ops = &resetctl_reboot_ops,
46 .priv_auto_alloc_size = sizeof(struct resetctl_reboot_priv),
47 .probe = resetctl_reboot_probe,