Lines Matching refs:sdev

23 static void hda_dsp_ipc_host_done(struct snd_sof_dev *sdev)  in hda_dsp_ipc_host_done()  argument
29 snd_sof_dsp_update_bits_forced(sdev, HDA_DSP_BAR, in hda_dsp_ipc_host_done()
35 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, in hda_dsp_ipc_host_done()
41 static void hda_dsp_ipc_dsp_done(struct snd_sof_dev *sdev) in hda_dsp_ipc_dsp_done() argument
47 snd_sof_dsp_update_bits_forced(sdev, HDA_DSP_BAR, in hda_dsp_ipc_dsp_done()
53 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, in hda_dsp_ipc_dsp_done()
59 int hda_dsp_ipc_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) in hda_dsp_ipc_send_msg() argument
62 sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, in hda_dsp_ipc_send_msg()
64 snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI, in hda_dsp_ipc_send_msg()
96 int hda_dsp_ipc4_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) in hda_dsp_ipc4_send_msg() argument
98 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_dsp_ipc4_send_msg()
101 if (hda_ipc4_tx_is_busy(sdev)) { in hda_dsp_ipc4_send_msg()
110 sof_mailbox_write(sdev, sdev->host_box.offset, msg_data->data_ptr, in hda_dsp_ipc4_send_msg()
113 snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE, msg_data->extension); in hda_dsp_ipc4_send_msg()
114 snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI, in hda_dsp_ipc4_send_msg()
122 void hda_dsp_ipc_get_reply(struct snd_sof_dev *sdev) in hda_dsp_ipc_get_reply() argument
124 struct snd_sof_ipc_msg *msg = sdev->msg; in hda_dsp_ipc_get_reply()
134 dev_warn(sdev->dev, "unexpected ipc interrupt raised!\n"); in hda_dsp_ipc_get_reply()
153 snd_sof_ipc_get_reply(sdev); in hda_dsp_ipc_get_reply()
160 struct snd_sof_dev *sdev = context; in hda_dsp_ipc4_irq_thread() local
165 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_dsp_ipc4_irq_thread()
166 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_dsp_ipc4_irq_thread()
170 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL, in hda_dsp_ipc4_irq_thread()
172 hda_dsp_ipc_dsp_done(sdev); in hda_dsp_ipc4_irq_thread()
180 u32 hipcte = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_ipc4_irq_thread()
186 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL, in hda_dsp_ipc4_irq_thread()
191 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in hda_dsp_ipc4_irq_thread()
192 struct sof_ipc4_msg *data = sdev->ipc->msg.reply_data; in hda_dsp_ipc4_irq_thread()
197 spin_lock_irq(&sdev->ipc_lock); in hda_dsp_ipc4_irq_thread()
199 snd_sof_ipc_get_reply(sdev); in hda_dsp_ipc4_irq_thread()
200 hda_dsp_ipc_host_done(sdev); in hda_dsp_ipc4_irq_thread()
201 snd_sof_ipc_reply(sdev, data->primary); in hda_dsp_ipc4_irq_thread()
203 spin_unlock_irq(&sdev->ipc_lock); in hda_dsp_ipc4_irq_thread()
205 dev_dbg_ratelimited(sdev->dev, in hda_dsp_ipc4_irq_thread()
214 sdev->ipc->msg.rx_data = &notification_data; in hda_dsp_ipc4_irq_thread()
215 snd_sof_ipc_msgs_rx(sdev); in hda_dsp_ipc4_irq_thread()
216 sdev->ipc->msg.rx_data = NULL; in hda_dsp_ipc4_irq_thread()
219 hda_dsp_ipc_host_done(sdev); in hda_dsp_ipc4_irq_thread()
227 dev_dbg_ratelimited(sdev->dev, "nothing to do in IPC IRQ thread\n"); in hda_dsp_ipc4_irq_thread()
230 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_dsp_ipc4_irq_thread()
233 hda_dsp_ipc4_send_msg(sdev, hdev->delayed_ipc_tx_msg); in hda_dsp_ipc4_irq_thread()
242 struct snd_sof_dev *sdev = context; in hda_dsp_ipc_irq_thread() local
252 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_ipc_irq_thread()
254 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_dsp_ipc_irq_thread()
255 hipci = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI); in hda_dsp_ipc_irq_thread()
256 hipcte = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCTE); in hda_dsp_ipc_irq_thread()
263 trace_sof_intel_ipc_firmware_response(sdev, msg, msg_ext); in hda_dsp_ipc_irq_thread()
266 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, in hda_dsp_ipc_irq_thread()
280 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in hda_dsp_ipc_irq_thread()
281 spin_lock_irq(&sdev->ipc_lock); in hda_dsp_ipc_irq_thread()
284 hda_dsp_ipc_get_reply(sdev); in hda_dsp_ipc_irq_thread()
285 snd_sof_ipc_reply(sdev, msg); in hda_dsp_ipc_irq_thread()
288 hda_dsp_ipc_dsp_done(sdev); in hda_dsp_ipc_irq_thread()
290 spin_unlock_irq(&sdev->ipc_lock); in hda_dsp_ipc_irq_thread()
292 dev_dbg_ratelimited(sdev->dev, "IPC reply before FW_READY: %#x\n", in hda_dsp_ipc_irq_thread()
304 trace_sof_intel_ipc_firmware_initiated(sdev, msg, msg_ext); in hda_dsp_ipc_irq_thread()
307 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, in hda_dsp_ipc_irq_thread()
313 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_ipc_irq_thread()
324 if (sdev->fw_state == SOF_FW_BOOT_IN_PROGRESS && in hda_dsp_ipc_irq_thread()
328 snd_sof_dsp_panic(sdev, HDA_DSP_PANIC_OFFSET(msg_ext), in hda_dsp_ipc_irq_thread()
332 snd_sof_ipc_msgs_rx(sdev); in hda_dsp_ipc_irq_thread()
335 hda_dsp_ipc_host_done(sdev); in hda_dsp_ipc_irq_thread()
344 dev_dbg_ratelimited(sdev->dev, in hda_dsp_ipc_irq_thread()
352 bool hda_dsp_check_ipc_irq(struct snd_sof_dev *sdev) in hda_dsp_check_ipc_irq() argument
354 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_check_ipc_irq()
358 if (sdev->dspless_mode_selected) in hda_dsp_check_ipc_irq()
362 irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS); in hda_dsp_check_ipc_irq()
363 trace_sof_intel_hda_irq_ipc_check(sdev, irq_status); in hda_dsp_check_ipc_irq()
384 int hda_dsp_ipc_get_mailbox_offset(struct snd_sof_dev *sdev) in hda_dsp_ipc_get_mailbox_offset() argument
389 int hda_dsp_ipc_get_window_offset(struct snd_sof_dev *sdev, u32 id) in hda_dsp_ipc_get_window_offset() argument
394 int hda_ipc_msg_data(struct snd_sof_dev *sdev, in hda_ipc_msg_data() argument
398 if (!sps || !sdev->stream_box.size) { in hda_ipc_msg_data()
399 sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz); in hda_ipc_msg_data()
413 sof_mailbox_read(sdev, hda_stream->sof_intel_stream.posn_offset, p, sz); in hda_ipc_msg_data()
419 int hda_set_stream_data_offset(struct snd_sof_dev *sdev, in hda_set_stream_data_offset() argument
431 if (posn_offset > sdev->stream_box.size || in hda_set_stream_data_offset()
435 hda_stream->sof_intel_stream.posn_offset = sdev->stream_box.offset + posn_offset; in hda_set_stream_data_offset()
437 dev_dbg(sdev->dev, "pcm: stream dir %d, posn mailbox offset is %zu", in hda_set_stream_data_offset()