Lines Matching +full:reboot +full:- +full:offset

1 // SPDX-License-Identifier: GPL-2.0-or-later
11 #include <linux/reboot.h>
14 #include <linux/reboot-mode.h>
18 struct reboot_mode_driver reboot; member
19 u32 offset; member
23 static int syscon_reboot_mode_write(struct reboot_mode_driver *reboot, in syscon_reboot_mode_write() argument
29 syscon_rbm = container_of(reboot, struct syscon_reboot_mode, reboot); in syscon_reboot_mode_write()
31 ret = regmap_update_bits(syscon_rbm->map, syscon_rbm->offset, in syscon_reboot_mode_write()
32 syscon_rbm->mask, magic); in syscon_reboot_mode_write()
34 dev_err(reboot->dev, "update reboot mode bits failed\n"); in syscon_reboot_mode_write()
44 syscon_rbm = devm_kzalloc(&pdev->dev, sizeof(*syscon_rbm), GFP_KERNEL); in syscon_reboot_mode_probe()
46 return -ENOMEM; in syscon_reboot_mode_probe()
48 syscon_rbm->reboot.dev = &pdev->dev; in syscon_reboot_mode_probe()
49 syscon_rbm->reboot.write = syscon_reboot_mode_write; in syscon_reboot_mode_probe()
50 syscon_rbm->mask = 0xffffffff; in syscon_reboot_mode_probe()
52 syscon_rbm->map = syscon_node_to_regmap(pdev->dev.parent->of_node); in syscon_reboot_mode_probe()
53 if (IS_ERR(syscon_rbm->map)) in syscon_reboot_mode_probe()
54 return PTR_ERR(syscon_rbm->map); in syscon_reboot_mode_probe()
56 if (of_property_read_u32(pdev->dev.of_node, "offset", in syscon_reboot_mode_probe()
57 &syscon_rbm->offset)) in syscon_reboot_mode_probe()
58 return -EINVAL; in syscon_reboot_mode_probe()
60 of_property_read_u32(pdev->dev.of_node, "mask", &syscon_rbm->mask); in syscon_reboot_mode_probe()
62 ret = devm_reboot_mode_register(&pdev->dev, &syscon_rbm->reboot); in syscon_reboot_mode_probe()
64 dev_err(&pdev->dev, "can't register reboot mode\n"); in syscon_reboot_mode_probe()
70 { .compatible = "syscon-reboot-mode" },
78 .name = "syscon-reboot-mode",
84 MODULE_AUTHOR("Andy Yan <andy.yan@rock-chips.com");
85 MODULE_DESCRIPTION("SYSCON reboot mode driver");