Lines Matching full:ipc

10 // Generic IPC layer that can work over MMIO and SPI/I2C. PHY layer provided
22 * sof_ipc_send_msg - generic function to prepare and send one IPC message
33 * Note: higher level sdev->ipc->tx_mutex must be held to make sure that
39 struct snd_sof_ipc *ipc = sdev->ipc; in sof_ipc_send_msg() local
43 if (ipc->disable_ipc_tx || sdev->fw_state != SOF_FW_BOOT_COMPLETE) in sof_ipc_send_msg()
53 msg = &ipc->msg; in sof_ipc_send_msg()
74 /* send IPC message from host to DSP */
75 int sof_ipc_tx_message(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes, in sof_ipc_tx_message() argument
78 if (msg_bytes > ipc->max_payload_size || in sof_ipc_tx_message()
79 reply_bytes > ipc->max_payload_size) in sof_ipc_tx_message()
82 return ipc->ops->tx_msg(ipc->sdev, msg_data, msg_bytes, reply_data, in sof_ipc_tx_message()
87 /* IPC set or get data from host to DSP */
88 int sof_ipc_set_get_data(struct snd_sof_ipc *ipc, void *msg_data, in sof_ipc_set_get_data() argument
91 return ipc->ops->set_get_data(ipc->sdev, msg_data, msg_bytes, set); in sof_ipc_set_get_data()
96 * send IPC message from host to DSP without modifying the DSP state.
97 * This will be used for IPC's that can be handled by the DSP
100 int sof_ipc_tx_message_no_pm(struct snd_sof_ipc *ipc, void *msg_data, size_t msg_bytes, in sof_ipc_tx_message_no_pm() argument
103 if (msg_bytes > ipc->max_payload_size || in sof_ipc_tx_message_no_pm()
104 reply_bytes > ipc->max_payload_size) in sof_ipc_tx_message_no_pm()
107 return ipc->ops->tx_msg(ipc->sdev, msg_data, msg_bytes, reply_data, in sof_ipc_tx_message_no_pm()
116 * Sometimes, there is unexpected reply ipc arriving. The reply in snd_sof_ipc_get_reply()
117 * ipc belongs to none of the ipcs sent from driver. in snd_sof_ipc_get_reply()
118 * In this case, the driver must ignore the ipc. in snd_sof_ipc_get_reply()
121 dev_warn(sdev->dev, "unexpected ipc interrupt raised!\n"); in snd_sof_ipc_get_reply()
125 sdev->msg->reply_error = sdev->ipc->ops->get_reply(sdev); in snd_sof_ipc_get_reply()
132 struct snd_sof_ipc_msg *msg = &sdev->ipc->msg; in snd_sof_ipc_reply()
149 struct snd_sof_ipc *ipc; in snd_sof_ipc_init() local
153 ipc = devm_kzalloc(sdev->dev, sizeof(*ipc), GFP_KERNEL); in snd_sof_ipc_init()
154 if (!ipc) in snd_sof_ipc_init()
157 mutex_init(&ipc->tx_mutex); in snd_sof_ipc_init()
158 ipc->sdev = sdev; in snd_sof_ipc_init()
159 msg = &ipc->msg; in snd_sof_ipc_init()
178 dev_err(sdev->dev, "Not supported IPC version: %d\n", in snd_sof_ipc_init()
185 dev_err(sdev->dev, "Missing IPC message handling ops\n"); in snd_sof_ipc_init()
191 dev_err(sdev->dev, "Missing IPC firmware loading ops\n"); in snd_sof_ipc_init()
196 dev_err(sdev->dev, "Missing IPC PCM ops\n"); in snd_sof_ipc_init()
201 dev_err(sdev->dev, "Missing IPC topology ops\n"); in snd_sof_ipc_init()
214 ipc->ops = ops; in snd_sof_ipc_init()
216 return ipc; in snd_sof_ipc_init()
222 struct snd_sof_ipc *ipc = sdev->ipc; in snd_sof_ipc_free() local
224 if (!ipc) in snd_sof_ipc_free()
227 /* disable sending of ipc's */ in snd_sof_ipc_free()
228 mutex_lock(&ipc->tx_mutex); in snd_sof_ipc_free()
229 ipc->disable_ipc_tx = true; in snd_sof_ipc_free()
230 mutex_unlock(&ipc->tx_mutex); in snd_sof_ipc_free()
232 if (ipc->ops->exit) in snd_sof_ipc_free()
233 ipc->ops->exit(sdev); in snd_sof_ipc_free()