ipc3-priv.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */
  2. /*
  3. * This file is provided under a dual BSD/GPLv2 license. When using or
  4. * redistributing this file, you may do so under either license.
  5. *
  6. * Copyright(c) 2021 Intel Corporation
  7. */
  8. #ifndef __SOUND_SOC_SOF_IPC3_PRIV_H
  9. #define __SOUND_SOC_SOF_IPC3_PRIV_H
  10. #include "sof-priv.h"
  11. /* IPC3 specific ops */
  12. extern const struct sof_ipc_pcm_ops ipc3_pcm_ops;
  13. extern const struct sof_ipc_tplg_ops ipc3_tplg_ops;
  14. extern const struct sof_ipc_tplg_control_ops tplg_ipc3_control_ops;
  15. extern const struct sof_ipc_fw_loader_ops ipc3_loader_ops;
  16. extern const struct sof_ipc_fw_tracing_ops ipc3_dtrace_ops;
  17. /* helpers for fw_ready and ext_manifest parsing */
  18. int sof_ipc3_get_ext_windows(struct snd_sof_dev *sdev,
  19. const struct sof_ipc_ext_data_hdr *ext_hdr);
  20. int sof_ipc3_get_cc_info(struct snd_sof_dev *sdev,
  21. const struct sof_ipc_ext_data_hdr *ext_hdr);
  22. int sof_ipc3_validate_fw_version(struct snd_sof_dev *sdev);
  23. /* dtrace position update */
  24. int ipc3_dtrace_posn_update(struct snd_sof_dev *sdev,
  25. struct sof_ipc_dma_trace_posn *posn);
  26. /* RX handler backend */
  27. void sof_ipc3_do_rx_work(struct snd_sof_dev *sdev, struct sof_ipc_cmd_hdr *hdr, void *msg_buf);
  28. /* dtrace platform callback wrappers */
  29. static inline int sof_dtrace_host_init(struct snd_sof_dev *sdev,
  30. struct snd_dma_buffer *dmatb,
  31. struct sof_ipc_dma_trace_params_ext *dtrace_params)
  32. {
  33. const struct snd_sof_dsp_ops *dsp_ops = sdev->pdata->desc->ops;
  34. if (dsp_ops->trace_init)
  35. return dsp_ops->trace_init(sdev, dmatb, dtrace_params);
  36. return 0;
  37. }
  38. static inline int sof_dtrace_host_release(struct snd_sof_dev *sdev)
  39. {
  40. const struct snd_sof_dsp_ops *dsp_ops = sdev->pdata->desc->ops;
  41. if (dsp_ops->trace_release)
  42. return dsp_ops->trace_release(sdev);
  43. return 0;
  44. }
  45. static inline int sof_dtrace_host_trigger(struct snd_sof_dev *sdev, int cmd)
  46. {
  47. const struct snd_sof_dsp_ops *dsp_ops = sdev->pdata->desc->ops;
  48. if (dsp_ops->trace_trigger)
  49. return dsp_ops->trace_trigger(sdev, cmd);
  50. return 0;
  51. }
  52. #endif