1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (c) 2016, NVIDIA CORPORATION.
11 struct sandbox_mbox_test {
12 struct mbox_chan chan;
15 int sandbox_mbox_test_get(struct udevice *dev)
17 struct sandbox_mbox_test *sbmt = dev_get_priv(dev);
19 return mbox_get_by_name(dev, "test", &sbmt->chan);
22 int sandbox_mbox_test_send(struct udevice *dev, uint32_t msg)
24 struct sandbox_mbox_test *sbmt = dev_get_priv(dev);
26 return mbox_send(&sbmt->chan, &msg);
29 int sandbox_mbox_test_recv(struct udevice *dev, uint32_t *msg)
31 struct sandbox_mbox_test *sbmt = dev_get_priv(dev);
33 return mbox_recv(&sbmt->chan, msg, 100);
36 int sandbox_mbox_test_free(struct udevice *dev)
38 struct sandbox_mbox_test *sbmt = dev_get_priv(dev);
40 return mbox_free(&sbmt->chan);
43 static const struct udevice_id sandbox_mbox_test_ids[] = {
44 { .compatible = "sandbox,mbox-test" },
48 U_BOOT_DRIVER(sandbox_mbox_test) = {
49 .name = "sandbox_mbox_test",
51 .of_match = sandbox_mbox_test_ids,
52 .priv_auto_alloc_size = sizeof(struct sandbox_mbox_test),