1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2016, NVIDIA CORPORATION.
12 #include <asm/reset.h>
14 struct sandbox_reset_test {
16 struct reset_ctl_bulk bulk;
19 int sandbox_reset_test_get(struct udevice *dev)
21 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
23 return reset_get_by_name(dev, "test", &sbrt->ctl);
26 int sandbox_reset_test_get_bulk(struct udevice *dev)
28 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
30 return reset_get_bulk(dev, &sbrt->bulk);
33 int sandbox_reset_test_assert(struct udevice *dev)
35 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
37 return reset_assert(&sbrt->ctl);
40 int sandbox_reset_test_assert_bulk(struct udevice *dev)
42 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
44 return reset_assert_bulk(&sbrt->bulk);
47 int sandbox_reset_test_deassert(struct udevice *dev)
49 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
51 return reset_deassert(&sbrt->ctl);
54 int sandbox_reset_test_deassert_bulk(struct udevice *dev)
56 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
58 return reset_deassert_bulk(&sbrt->bulk);
61 int sandbox_reset_test_free(struct udevice *dev)
63 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
65 return reset_free(&sbrt->ctl);
68 int sandbox_reset_test_release_bulk(struct udevice *dev)
70 struct sandbox_reset_test *sbrt = dev_get_priv(dev);
72 return reset_release_bulk(&sbrt->bulk);
75 static const struct udevice_id sandbox_reset_test_ids[] = {
76 { .compatible = "sandbox,reset-ctl-test" },
80 U_BOOT_DRIVER(sandbox_reset_test) = {
81 .name = "sandbox_reset_test",
83 .of_match = sandbox_reset_test_ids,
84 .priv_auto_alloc_size = sizeof(struct sandbox_reset_test),