2 * Copyright (c) 2016, NVIDIA CORPORATION.
4 * SPDX-License-Identifier: GPL-2.0
11 #include <asm/reset.h>
13 struct sandbox_reset_test {
15 struct reset_ctl_bulk bulk;
18 int sandbox_reset_test_get(struct udevice *dev)
20 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
22 return reset_get_by_name(dev, "test", &sbrt->ctl);
25 int sandbox_reset_test_get_bulk(struct udevice *dev)
27 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
29 return reset_get_bulk(dev, &sbrt->bulk);
32 int sandbox_reset_test_assert(struct udevice *dev)
34 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
36 return reset_assert(&sbrt->ctl);
39 int sandbox_reset_test_assert_bulk(struct udevice *dev)
41 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
43 return reset_assert_bulk(&sbrt->bulk);
46 int sandbox_reset_test_deassert(struct udevice *dev)
48 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
50 return reset_deassert(&sbrt->ctl);
53 int sandbox_reset_test_deassert_bulk(struct udevice *dev)
55 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
57 return reset_deassert_bulk(&sbrt->bulk);
60 int sandbox_reset_test_free(struct udevice *dev)
62 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
64 return reset_free(&sbrt->ctl);
67 int sandbox_reset_test_release_bulk(struct udevice *dev)
69 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
71 return reset_release_bulk(&sbrt->bulk);
74 static const struct udevice_id sandbox_reset_test_ids[] = {
75 { .compatible = "sandbox,reset-ctl-test" },
79 U_BOOT_DRIVER(sandbox_reset_test) = {
80 .name = "sandbox_reset_test",
82 .of_match = sandbox_reset_test_ids,
83 .priv_auto_alloc_size = sizeof(struct sandbox_reset_test),