Lines Matching +full:ipc +full:- +full:3

1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
26 * tell DSP cmd is done - clear busy in hda_dsp_ipc_host_done()
44 * set DONE bit - tell DSP we have received the reply msg in hda_dsp_ipc_dsp_done()
61 /* send IPC message to DSP */ in hda_dsp_ipc_send_msg()
62 sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, in hda_dsp_ipc_send_msg()
63 msg->msg_size); in hda_dsp_ipc_send_msg()
72 struct sof_ipc4_msg *msg_data = msg->msg_data; in hda_dsp_ipc4_send_msg()
75 if (msg_data->data_size) in hda_dsp_ipc4_send_msg()
76 sof_mailbox_write(sdev, sdev->host_box.offset, msg_data->data_ptr, in hda_dsp_ipc4_send_msg()
77 msg_data->data_size); in hda_dsp_ipc4_send_msg()
79 snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE, msg_data->extension); in hda_dsp_ipc4_send_msg()
81 msg_data->primary | HDA_DSP_REG_HIPCI_BUSY); in hda_dsp_ipc4_send_msg()
88 struct snd_sof_ipc_msg *msg = sdev->msg; in hda_dsp_ipc_get_reply()
93 * Sometimes, there is unexpected reply ipc arriving. The reply in hda_dsp_ipc_get_reply()
94 * ipc belongs to none of the ipcs sent from driver. in hda_dsp_ipc_get_reply()
95 * In this case, the driver must ignore the ipc. in hda_dsp_ipc_get_reply()
98 dev_warn(sdev->dev, "unexpected ipc interrupt raised!\n"); in hda_dsp_ipc_get_reply()
102 hdr = msg->msg_data; in hda_dsp_ipc_get_reply()
103 if (hdr->cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE) || in hda_dsp_ipc_get_reply()
104 hdr->cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_GATE)) { in hda_dsp_ipc_get_reply()
106 * memory windows are powered off before sending IPC reply, in hda_dsp_ipc_get_reply()
113 memcpy(msg->reply_data, &reply, sizeof(reply)); in hda_dsp_ipc_get_reply()
115 msg->reply_error = 0; in hda_dsp_ipc_get_reply()
152 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in hda_dsp_ipc4_irq_thread()
153 struct sof_ipc4_msg *data = sdev->ipc->msg.reply_data; in hda_dsp_ipc4_irq_thread()
155 data->primary = primary; in hda_dsp_ipc4_irq_thread()
156 data->extension = extension; in hda_dsp_ipc4_irq_thread()
158 spin_lock_irq(&sdev->ipc_lock); in hda_dsp_ipc4_irq_thread()
161 snd_sof_ipc_reply(sdev, data->primary); in hda_dsp_ipc4_irq_thread()
163 spin_unlock_irq(&sdev->ipc_lock); in hda_dsp_ipc4_irq_thread()
165 dev_dbg_ratelimited(sdev->dev, in hda_dsp_ipc4_irq_thread()
166 "IPC reply before FW_READY: %#x|%#x\n", in hda_dsp_ipc4_irq_thread()
174 sdev->ipc->msg.rx_data = &notification_data; in hda_dsp_ipc4_irq_thread()
176 sdev->ipc->msg.rx_data = NULL; in hda_dsp_ipc4_irq_thread()
187 dev_dbg_ratelimited(sdev->dev, "nothing to do in IPC IRQ thread\n"); in hda_dsp_ipc4_irq_thread()
192 /* IPC handler thread */
204 /* read IPC status */ in hda_dsp_ipc_irq_thread()
225 * waking up the sender and re-enabling the interrupt. Also in hda_dsp_ipc_irq_thread()
227 * if the DSP is fast enough to receive an IPC message, reply to in hda_dsp_ipc_irq_thread()
233 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in hda_dsp_ipc_irq_thread()
234 spin_lock_irq(&sdev->ipc_lock); in hda_dsp_ipc_irq_thread()
243 spin_unlock_irq(&sdev->ipc_lock); in hda_dsp_ipc_irq_thread()
245 dev_dbg_ratelimited(sdev->dev, "IPC reply before FW_READY: %#x\n", in hda_dsp_ipc_irq_thread()
266 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_ipc_irq_thread()
277 if (sdev->fw_state == SOF_FW_BOOT_IN_PROGRESS && in hda_dsp_ipc_irq_thread()
278 hda->boot_iteration < HDA_FW_BOOT_ATTEMPTS) in hda_dsp_ipc_irq_thread()
284 /* normal message - process normally */ in hda_dsp_ipc_irq_thread()
297 dev_dbg_ratelimited(sdev->dev, in hda_dsp_ipc_irq_thread()
298 "nothing to do in IPC IRQ thread\n"); in hda_dsp_ipc_irq_thread()
304 /* Check if an IPC IRQ occurred */
307 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_check_ipc_irq()
319 /* IPC message ? */ in hda_dsp_check_ipc_irq()
325 hda->code_loading = 0; in hda_dsp_check_ipc_irq()
326 wake_up(&hda->waitq); in hda_dsp_check_ipc_irq()
348 if (!substream || !sdev->stream_box.size) { in hda_ipc_msg_data()
349 sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz); in hda_ipc_msg_data()
351 struct hdac_stream *hstream = substream->runtime->private_data; in hda_ipc_msg_data()
360 return -ESTRPIPE; in hda_ipc_msg_data()
362 sof_mailbox_read(sdev, hda_stream->sof_intel_stream.posn_offset, p, sz); in hda_ipc_msg_data()
372 struct hdac_stream *hstream = substream->runtime->private_data; in hda_set_stream_data_offset()
379 if (posn_offset > sdev->stream_box.size || in hda_set_stream_data_offset()
381 return -EINVAL; in hda_set_stream_data_offset()
383 hda_stream->sof_intel_stream.posn_offset = sdev->stream_box.offset + posn_offset; in hda_set_stream_data_offset()
385 dev_dbg(sdev->dev, "pcm: stream dir %d, posn mailbox offset is %zu", in hda_set_stream_data_offset()
386 substream->stream, hda_stream->sof_intel_stream.posn_offset); in hda_set_stream_data_offset()