Lines Matching refs:sdev

29 static void hda_dsp_ipc_host_done(struct snd_sof_dev *sdev)  in hda_dsp_ipc_host_done()  argument
35 snd_sof_dsp_update_bits_forced(sdev, HDA_DSP_BAR, in hda_dsp_ipc_host_done()
41 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, in hda_dsp_ipc_host_done()
47 static void hda_dsp_ipc_dsp_done(struct snd_sof_dev *sdev) in hda_dsp_ipc_dsp_done() argument
53 snd_sof_dsp_update_bits_forced(sdev, HDA_DSP_BAR, in hda_dsp_ipc_dsp_done()
59 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, in hda_dsp_ipc_dsp_done()
65 int hda_dsp_ipc_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) in hda_dsp_ipc_send_msg() argument
68 sof_mailbox_write(sdev, sdev->host_box.offset, msg->msg_data, in hda_dsp_ipc_send_msg()
70 snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI, in hda_dsp_ipc_send_msg()
104 int hda_dsp_ipc4_send_msg(struct snd_sof_dev *sdev, struct snd_sof_ipc_msg *msg) in hda_dsp_ipc4_send_msg() argument
106 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_dsp_ipc4_send_msg()
109 if (hda_ipc4_tx_is_busy(sdev)) { in hda_dsp_ipc4_send_msg()
118 sof_mailbox_write(sdev, sdev->host_box.offset, msg_data->data_ptr, in hda_dsp_ipc4_send_msg()
121 snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE, msg_data->extension); in hda_dsp_ipc4_send_msg()
122 snd_sof_dsp_write(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI, in hda_dsp_ipc4_send_msg()
131 void hda_dsp_ipc_get_reply(struct snd_sof_dev *sdev) in hda_dsp_ipc_get_reply() argument
133 struct snd_sof_ipc_msg *msg = sdev->msg; in hda_dsp_ipc_get_reply()
143 dev_warn(sdev->dev, "unexpected ipc interrupt raised!\n"); in hda_dsp_ipc_get_reply()
162 snd_sof_ipc_get_reply(sdev); in hda_dsp_ipc_get_reply()
170 struct snd_sof_dev *sdev = context; in hda_dsp_ipc4_irq_thread() local
175 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_dsp_ipc4_irq_thread()
176 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_dsp_ipc4_irq_thread()
180 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL, in hda_dsp_ipc4_irq_thread()
182 hda_dsp_ipc_dsp_done(sdev); in hda_dsp_ipc4_irq_thread()
190 u32 hipcte = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_ipc4_irq_thread()
196 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL, in hda_dsp_ipc4_irq_thread()
201 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in hda_dsp_ipc4_irq_thread()
202 struct sof_ipc4_msg *data = sdev->ipc->msg.reply_data; in hda_dsp_ipc4_irq_thread()
207 spin_lock_irq(&sdev->ipc_lock); in hda_dsp_ipc4_irq_thread()
209 snd_sof_ipc_get_reply(sdev); in hda_dsp_ipc4_irq_thread()
210 hda_dsp_ipc_host_done(sdev); in hda_dsp_ipc4_irq_thread()
211 snd_sof_ipc_reply(sdev, data->primary); in hda_dsp_ipc4_irq_thread()
213 spin_unlock_irq(&sdev->ipc_lock); in hda_dsp_ipc4_irq_thread()
215 dev_dbg_ratelimited(sdev->dev, in hda_dsp_ipc4_irq_thread()
224 sdev->ipc->msg.rx_data = &notification_data; in hda_dsp_ipc4_irq_thread()
225 snd_sof_ipc_msgs_rx(sdev); in hda_dsp_ipc4_irq_thread()
226 sdev->ipc->msg.rx_data = NULL; in hda_dsp_ipc4_irq_thread()
229 hda_dsp_ipc_host_done(sdev); in hda_dsp_ipc4_irq_thread()
237 dev_dbg_ratelimited(sdev->dev, "nothing to do in IPC IRQ thread\n"); in hda_dsp_ipc4_irq_thread()
240 struct sof_intel_hda_dev *hdev = sdev->pdata->hw_pdata; in hda_dsp_ipc4_irq_thread()
243 hda_dsp_ipc4_send_msg(sdev, hdev->delayed_ipc_tx_msg); in hda_dsp_ipc4_irq_thread()
253 struct snd_sof_dev *sdev = context; in hda_dsp_ipc_irq_thread() local
263 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, in hda_dsp_ipc_irq_thread()
265 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_dsp_ipc_irq_thread()
266 hipci = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI); in hda_dsp_ipc_irq_thread()
267 hipcte = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCTE); in hda_dsp_ipc_irq_thread()
274 trace_sof_intel_ipc_firmware_response(sdev, msg, msg_ext); in hda_dsp_ipc_irq_thread()
277 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, in hda_dsp_ipc_irq_thread()
291 if (likely(sdev->fw_state == SOF_FW_BOOT_COMPLETE)) { in hda_dsp_ipc_irq_thread()
292 spin_lock_irq(&sdev->ipc_lock); in hda_dsp_ipc_irq_thread()
295 hda_dsp_ipc_get_reply(sdev); in hda_dsp_ipc_irq_thread()
296 snd_sof_ipc_reply(sdev, msg); in hda_dsp_ipc_irq_thread()
299 hda_dsp_ipc_dsp_done(sdev); in hda_dsp_ipc_irq_thread()
301 spin_unlock_irq(&sdev->ipc_lock); in hda_dsp_ipc_irq_thread()
303 dev_dbg_ratelimited(sdev->dev, "IPC reply before FW_READY: %#x\n", in hda_dsp_ipc_irq_thread()
315 trace_sof_intel_ipc_firmware_initiated(sdev, msg, msg_ext); in hda_dsp_ipc_irq_thread()
318 snd_sof_dsp_update_bits(sdev, HDA_DSP_BAR, in hda_dsp_ipc_irq_thread()
324 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_ipc_irq_thread()
335 if (sdev->fw_state == SOF_FW_BOOT_IN_PROGRESS && in hda_dsp_ipc_irq_thread()
339 snd_sof_dsp_panic(sdev, HDA_DSP_PANIC_OFFSET(msg_ext), in hda_dsp_ipc_irq_thread()
343 snd_sof_ipc_msgs_rx(sdev); in hda_dsp_ipc_irq_thread()
346 hda_dsp_ipc_host_done(sdev); in hda_dsp_ipc_irq_thread()
355 dev_dbg_ratelimited(sdev->dev, in hda_dsp_ipc_irq_thread()
364 bool hda_dsp_check_ipc_irq(struct snd_sof_dev *sdev) in hda_dsp_check_ipc_irq() argument
366 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_dsp_check_ipc_irq()
370 if (sdev->dspless_mode_selected) in hda_dsp_check_ipc_irq()
374 irq_status = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS); in hda_dsp_check_ipc_irq()
375 trace_sof_intel_hda_irq_ipc_check(sdev, irq_status); in hda_dsp_check_ipc_irq()
397 int hda_dsp_ipc_get_mailbox_offset(struct snd_sof_dev *sdev) in hda_dsp_ipc_get_mailbox_offset() argument
403 int hda_dsp_ipc_get_window_offset(struct snd_sof_dev *sdev, u32 id) in hda_dsp_ipc_get_window_offset() argument
409 int hda_ipc_msg_data(struct snd_sof_dev *sdev, in hda_ipc_msg_data() argument
413 if (!sps || !sdev->stream_box.size) { in hda_ipc_msg_data()
414 sof_mailbox_read(sdev, sdev->dsp_box.offset, p, sz); in hda_ipc_msg_data()
428 sof_mailbox_read(sdev, hda_stream->sof_intel_stream.posn_offset, p, sz); in hda_ipc_msg_data()
435 int hda_set_stream_data_offset(struct snd_sof_dev *sdev, in hda_set_stream_data_offset() argument
447 if (posn_offset > sdev->stream_box.size || in hda_set_stream_data_offset()
451 hda_stream->sof_intel_stream.posn_offset = sdev->stream_box.offset + posn_offset; in hda_set_stream_data_offset()
453 dev_dbg(sdev->dev, "pcm: stream dir %d, posn mailbox offset is %zu", in hda_set_stream_data_offset()
460 void hda_ipc4_dsp_dump(struct snd_sof_dev *sdev, u32 flags) in hda_ipc4_dsp_dump() argument
465 hda_dsp_get_state(sdev, level); in hda_ipc4_dsp_dump()
468 sof_ipc4_intel_dump_telemetry_state(sdev, flags); in hda_ipc4_dsp_dump()
470 hda_dsp_dump_ext_rom_status(sdev, level, flags); in hda_ipc4_dsp_dump()
474 bool hda_check_ipc_irq(struct snd_sof_dev *sdev) in hda_check_ipc_irq() argument
478 chip = get_chip_info(sdev->pdata); in hda_check_ipc_irq()
480 return chip->check_ipc_irq(sdev); in hda_check_ipc_irq()
486 void hda_ipc_irq_dump(struct snd_sof_dev *sdev) in hda_ipc_irq_dump() argument
495 adspis = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_ADSPIS); in hda_ipc_irq_dump()
496 intsts = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTSTS); in hda_ipc_irq_dump()
497 intctl = snd_sof_dsp_read(sdev, HDA_DSP_HDA_BAR, SOF_HDA_INTCTL); in hda_ipc_irq_dump()
498 ppsts = snd_sof_dsp_read(sdev, HDA_DSP_PP_BAR, SOF_HDA_REG_PP_PPSTS); in hda_ipc_irq_dump()
499 rirbsts = snd_sof_dsp_read8(sdev, HDA_DSP_HDA_BAR, AZX_REG_RIRBSTS); in hda_ipc_irq_dump()
501 dev_err(sdev->dev, "hda irq intsts 0x%8.8x intlctl 0x%8.8x rirb %2.2x\n", in hda_ipc_irq_dump()
503 dev_err(sdev->dev, "dsp irq ppsts 0x%8.8x adspis 0x%8.8x\n", ppsts, adspis); in hda_ipc_irq_dump()
507 void hda_ipc_dump(struct snd_sof_dev *sdev) in hda_ipc_dump() argument
513 hda_ipc_irq_dump(sdev); in hda_ipc_dump()
516 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc_dump()
517 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc_dump()
518 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc_dump()
522 dev_err(sdev->dev, "host status 0x%8.8x dsp status 0x%8.8x mask 0x%8.8x\n", in hda_ipc_dump()
527 void hda_ipc4_dump(struct snd_sof_dev *sdev) in hda_ipc4_dump() argument
531 hda_ipc_irq_dump(sdev); in hda_ipc4_dump()
533 hipci = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCI); in hda_ipc4_dump()
534 hipcie = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCIE); in hda_ipc4_dump()
535 hipct = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCT); in hda_ipc4_dump()
536 hipcte = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCTE); in hda_ipc4_dump()
537 hipcctl = snd_sof_dsp_read(sdev, HDA_DSP_BAR, HDA_DSP_REG_HIPCCTL); in hda_ipc4_dump()
541 dev_err(sdev->dev, "Host IPC initiator: %#x|%#x, target: %#x|%#x, ctl: %#x\n", in hda_ipc4_dump()
546 bool hda_ipc4_tx_is_busy(struct snd_sof_dev *sdev) in hda_ipc4_tx_is_busy() argument
548 struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata; in hda_ipc4_tx_is_busy()
552 val = snd_sof_dsp_read(sdev, HDA_DSP_BAR, chip->ipc_req); in hda_ipc4_tx_is_busy()