Lines Matching +full:nxp +full:- +full:imx
1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright 2019 NXP
4 * Author: Daniel Baluta <daniel.baluta@nxp.com>
9 #include <linux/firmware/imx/dsp.h>
18 * imx_dsp_ring_doorbell - triggers an interrupt on the other side (DSP)
23 * Returns non-negative value for success, negative value for error
31 return -EINVAL; in imx_dsp_ring_doorbell()
33 dsp_chan = &ipc->chans[idx]; in imx_dsp_ring_doorbell()
34 ret = mbox_send_message(dsp_chan->ch, NULL); in imx_dsp_ring_doorbell()
43 * imx_dsp_handle_rx - rx callback used by imx mailbox
55 if (chan->idx == 0) { in imx_dsp_handle_rx()
56 chan->ipc->ops->handle_reply(chan->ipc); in imx_dsp_handle_rx()
58 chan->ipc->ops->handle_request(chan->ipc); in imx_dsp_handle_rx()
59 imx_dsp_ring_doorbell(chan->ipc, 1); in imx_dsp_handle_rx()
65 struct device *dev = &pdev->dev; in imx_dsp_probe()
73 device_set_of_node_from_dev(&pdev->dev, pdev->dev.parent); in imx_dsp_probe()
77 return -ENOMEM; in imx_dsp_probe()
83 chan_name = kasprintf(GFP_KERNEL, "rxdb%d", i - 2); in imx_dsp_probe()
86 return -ENOMEM; in imx_dsp_probe()
88 dsp_chan = &dsp_ipc->chans[i]; in imx_dsp_probe()
89 cl = &dsp_chan->cl; in imx_dsp_probe()
90 cl->dev = dev; in imx_dsp_probe()
91 cl->tx_block = false; in imx_dsp_probe()
92 cl->knows_txdone = true; in imx_dsp_probe()
93 cl->rx_callback = imx_dsp_handle_rx; in imx_dsp_probe()
95 dsp_chan->ipc = dsp_ipc; in imx_dsp_probe()
96 dsp_chan->idx = i % 2; in imx_dsp_probe()
97 dsp_chan->ch = mbox_request_channel_byname(cl, chan_name); in imx_dsp_probe()
98 if (IS_ERR(dsp_chan->ch)) { in imx_dsp_probe()
99 ret = PTR_ERR(dsp_chan->ch); in imx_dsp_probe()
100 if (ret != -EPROBE_DEFER) in imx_dsp_probe()
111 dsp_ipc->dev = dev; in imx_dsp_probe()
115 dev_info(dev, "NXP i.MX DSP IPC initialized\n"); in imx_dsp_probe()
121 dsp_chan = &dsp_ipc->chans[j]; in imx_dsp_probe()
122 mbox_free_channel(dsp_chan->ch); in imx_dsp_probe()
134 dsp_ipc = dev_get_drvdata(&pdev->dev); in imx_dsp_remove()
137 dsp_chan = &dsp_ipc->chans[i]; in imx_dsp_remove()
138 mbox_free_channel(dsp_chan->ch); in imx_dsp_remove()
146 .name = "imx-dsp",
153 MODULE_AUTHOR("Daniel Baluta <daniel.baluta@nxp.com>");
154 MODULE_DESCRIPTION("IMX DSP IPC protocol driver");