Lines Matching +full:dsp +full:- +full:irq
1 // SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause)
15 * Hardware interface for generic Intel audio DSP HDA IP
24 * tell DSP cmd is done - clear busy in hda_dsp_ipc_host_done()
25 * interrupt and send reply msg to dsp in hda_dsp_ipc_host_done()
42 * set DONE bit - tell DSP we have received the reply msg in hda_dsp_ipc_dsp_done()
43 * from DSP, and processed it, don't send more reply to host in hda_dsp_ipc_dsp_done()
59 /* send IPC message to DSP */ in hda_dsp_ipc_send_msg()
60 sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, in hda_dsp_ipc_send_msg()
61 msg->msg_size); in hda_dsp_ipc_send_msg()
70 struct snd_sof_ipc_msg *msg = sdev->msg; in hda_dsp_ipc_get_reply()
81 dev_warn(sdev->dev, "unexpected ipc interrupt raised!\n"); in hda_dsp_ipc_get_reply()
85 hdr = msg->msg_data; in hda_dsp_ipc_get_reply()
86 if (hdr->cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_CTX_SAVE) || in hda_dsp_ipc_get_reply()
87 hdr->cmd == (SOF_IPC_GLB_PM_MSG | SOF_IPC_PM_GATE)) { in hda_dsp_ipc_get_reply()
96 memcpy(msg->reply_data, &reply, sizeof(reply)); in hda_dsp_ipc_get_reply()
100 /* get IPC reply from DSP in the mailbox */ in hda_dsp_ipc_get_reply()
101 sof_mailbox_read(sdev, sdev->host_box.offset, &reply, in hda_dsp_ipc_get_reply()
105 memcpy(msg->reply_data, &reply, sizeof(reply)); in hda_dsp_ipc_get_reply()
109 if (reply.hdr.size != msg->reply_size && in hda_dsp_ipc_get_reply()
112 dev_err(sdev->dev, "error: reply expected %zu got %u bytes\n", in hda_dsp_ipc_get_reply()
113 msg->reply_size, reply.hdr.size); in hda_dsp_ipc_get_reply()
114 ret = -EINVAL; in hda_dsp_ipc_get_reply()
118 if (msg->reply_size > 0) in hda_dsp_ipc_get_reply()
119 sof_mailbox_read(sdev, sdev->host_box.offset, in hda_dsp_ipc_get_reply()
120 msg->reply_data, msg->reply_size); in hda_dsp_ipc_get_reply()
124 msg->reply_error = ret; in hda_dsp_ipc_get_reply()
129 irqreturn_t hda_dsp_ipc_irq_thread(int irq, void *context) in hda_dsp_ipc_irq_thread() argument
147 /* is this a reply message from the DSP */ in hda_dsp_ipc_irq_thread()
152 dev_vdbg(sdev->dev, in hda_dsp_ipc_irq_thread()
163 * waking up the sender and re-enabling the interrupt. Also in hda_dsp_ipc_irq_thread()
165 * if the DSP is fast enough to receive an IPC message, reply to in hda_dsp_ipc_irq_thread()
171 spin_lock_irq(&sdev->ipc_lock); in hda_dsp_ipc_irq_thread()
173 /* handle immediate reply from DSP core */ in hda_dsp_ipc_irq_thread()
180 spin_unlock_irq(&sdev->ipc_lock); in hda_dsp_ipc_irq_thread()
185 /* is this a new message from DSP */ in hda_dsp_ipc_irq_thread()
190 dev_vdbg(sdev->dev, in hda_dsp_ipc_irq_thread()
199 /* handle messages from DSP */ in hda_dsp_ipc_irq_thread()
204 /* normal message - process normally */ in hda_dsp_ipc_irq_thread()
217 dev_dbg_ratelimited(sdev->dev, in hda_dsp_ipc_irq_thread()
218 "nothing to do in IPC IRQ thread\n"); in hda_dsp_ipc_irq_thread()
224 /* Check if an IPC IRQ occurred */
232 dev_vdbg(sdev->dev, "irq handler: irq_status:0x%x\n", irq_status); in hda_dsp_check_ipc_irq()
260 if (!substream || !sdev->stream_box.size) { in hda_ipc_msg_data()
261 sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz); in hda_ipc_msg_data()
263 struct hdac_stream *hstream = substream->runtime->private_data; in hda_ipc_msg_data()
272 sof_mailbox_read(sdev, hda_stream->stream.posn_offset, in hda_ipc_msg_data()
281 struct hdac_stream *hstream = substream->runtime->private_data; in hda_ipc_pcm_params()
284 size_t posn_offset = reply->posn_offset; in hda_ipc_pcm_params()
290 if (posn_offset > sdev->stream_box.size || in hda_ipc_pcm_params()
292 return -EINVAL; in hda_ipc_pcm_params()
294 hda_stream->stream.posn_offset = sdev->stream_box.offset + posn_offset; in hda_ipc_pcm_params()
296 dev_dbg(sdev->dev, "pcm: stream dir %d, posn mailbox offset is %zu", in hda_ipc_pcm_params()
297 substream->stream, hda_stream->stream.posn_offset); in hda_ipc_pcm_params()