#ifndef _IMX_DSP_IPC_H
#define _IMX_DSP_IPC_H
#include <linux/device.h>
#include <linux/types.h>
#include <linux/mailbox_client.h>
#define DSP_MU_CHAN_NUM …
struct imx_dsp_chan { … };
struct imx_dsp_ops { … };
struct imx_dsp_ipc { … };
static inline void imx_dsp_set_data(struct imx_dsp_ipc *ipc, void *data)
{ … }
static inline void *imx_dsp_get_data(struct imx_dsp_ipc *ipc)
{ … }
#if IS_ENABLED(CONFIG_IMX_DSP)
int imx_dsp_ring_doorbell(struct imx_dsp_ipc *dsp, unsigned int chan_idx);
struct mbox_chan *imx_dsp_request_channel(struct imx_dsp_ipc *ipc, int idx);
void imx_dsp_free_channel(struct imx_dsp_ipc *ipc, int idx);
#else
static inline int imx_dsp_ring_doorbell(struct imx_dsp_ipc *ipc,
unsigned int chan_idx)
{
return -ENOTSUPP;
}
struct mbox_chan *imx_dsp_request_channel(struct imx_dsp_ipc *ipc, int idx)
{
return ERR_PTR(-EOPNOTSUPP);
}
void imx_dsp_free_channel(struct imx_dsp_ipc *ipc, int idx) { }
#endif
#endif