Lines Matching +full:mbox +full:- +full:name

1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright 2020-2021 NXP
25 static int vpu_mbox_request_channel(struct device *dev, struct vpu_mbox *mbox) in vpu_mbox_request_channel() argument
30 if (!dev || !mbox) in vpu_mbox_request_channel()
31 return -EINVAL; in vpu_mbox_request_channel()
32 if (mbox->ch) in vpu_mbox_request_channel()
35 cl = &mbox->cl; in vpu_mbox_request_channel()
36 cl->dev = dev; in vpu_mbox_request_channel()
37 if (mbox->block) { in vpu_mbox_request_channel()
38 cl->tx_block = true; in vpu_mbox_request_channel()
39 cl->tx_tout = 1000; in vpu_mbox_request_channel()
41 cl->tx_block = false; in vpu_mbox_request_channel()
43 cl->knows_txdone = false; in vpu_mbox_request_channel()
44 cl->rx_callback = vpu_mbox_rx_callback; in vpu_mbox_request_channel()
46 ch = mbox_request_channel_byname(cl, mbox->name); in vpu_mbox_request_channel()
49 "Failed to request mbox chan %s\n", in vpu_mbox_request_channel()
50 mbox->name); in vpu_mbox_request_channel()
52 mbox->ch = ch; in vpu_mbox_request_channel()
58 scnprintf(core->tx_type.name, sizeof(core->tx_type.name) - 1, "tx0"); in vpu_mbox_init()
59 core->tx_type.block = true; in vpu_mbox_init()
61 scnprintf(core->tx_data.name, sizeof(core->tx_data.name) - 1, "tx1"); in vpu_mbox_init()
62 core->tx_data.block = false; in vpu_mbox_init()
64 scnprintf(core->rx.name, sizeof(core->rx.name) - 1, "rx"); in vpu_mbox_init()
65 core->rx.block = true; in vpu_mbox_init()
74 ret = vpu_mbox_request_channel(core->dev, &core->tx_type); in vpu_mbox_request()
77 ret = vpu_mbox_request_channel(core->dev, &core->tx_data); in vpu_mbox_request()
80 ret = vpu_mbox_request_channel(core->dev, &core->rx); in vpu_mbox_request()
84 dev_dbg(core->dev, "%s request mbox\n", vpu_core_type_desc(core->type)); in vpu_mbox_request()
93 mbox_free_channel(core->tx_type.ch); in vpu_mbox_free()
94 mbox_free_channel(core->tx_data.ch); in vpu_mbox_free()
95 mbox_free_channel(core->rx.ch); in vpu_mbox_free()
96 core->tx_type.ch = NULL; in vpu_mbox_free()
97 core->tx_data.ch = NULL; in vpu_mbox_free()
98 core->rx.ch = NULL; in vpu_mbox_free()
99 dev_dbg(core->dev, "%s free mbox\n", vpu_core_type_desc(core->type)); in vpu_mbox_free()
104 mbox_send_message(core->tx_type.ch, &type); in vpu_mbox_send_type()
109 mbox_send_message(core->tx_data.ch, &data); in vpu_mbox_send_msg()
110 mbox_send_message(core->tx_type.ch, &type); in vpu_mbox_send_msg()