sof-client-probes.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. #ifndef __SOF_CLIENT_PROBES_H
  3. #define __SOF_CLIENT_PROBES_H
  4. struct snd_compr_stream;
  5. struct snd_compr_tstamp64;
  6. struct snd_compr_params;
  7. struct sof_client_dev;
  8. struct snd_soc_dai;
  9. /*
  10. * Callbacks used on platforms where the control for audio is split between
  11. * DSP and host, like HDA.
  12. */
  13. struct sof_probes_host_ops {
  14. int (*startup)(struct sof_client_dev *cdev, struct snd_compr_stream *cstream,
  15. struct snd_soc_dai *dai, u32 *stream_id);
  16. int (*shutdown)(struct sof_client_dev *cdev, struct snd_compr_stream *cstream,
  17. struct snd_soc_dai *dai);
  18. int (*set_params)(struct sof_client_dev *cdev, struct snd_compr_stream *cstream,
  19. struct snd_compr_params *params,
  20. struct snd_soc_dai *dai);
  21. int (*trigger)(struct sof_client_dev *cdev, struct snd_compr_stream *cstream,
  22. int cmd, struct snd_soc_dai *dai);
  23. int (*pointer)(struct sof_client_dev *cdev, struct snd_compr_stream *cstream,
  24. struct snd_compr_tstamp64 *tstamp,
  25. struct snd_soc_dai *dai);
  26. };
  27. struct sof_probe_point_desc {
  28. unsigned int buffer_id;
  29. unsigned int purpose;
  30. unsigned int stream_tag;
  31. } __packed;
  32. enum sof_probe_info_type {
  33. PROBES_INFO_ACTIVE_PROBES,
  34. PROBES_INFO_AVAILABE_PROBES,
  35. };
  36. struct sof_probes_ipc_ops {
  37. int (*init)(struct sof_client_dev *cdev, u32 stream_tag,
  38. size_t buffer_size);
  39. int (*deinit)(struct sof_client_dev *cdev);
  40. int (*points_info)(struct sof_client_dev *cdev,
  41. struct sof_probe_point_desc **desc,
  42. size_t *num_desc, enum sof_probe_info_type type);
  43. int (*point_print)(struct sof_client_dev *cdev, char *buf, size_t size,
  44. struct sof_probe_point_desc *desc);
  45. int (*points_add)(struct sof_client_dev *cdev,
  46. struct sof_probe_point_desc *desc,
  47. size_t num_desc);
  48. int (*points_remove)(struct sof_client_dev *cdev,
  49. unsigned int *buffer_id, size_t num_buffer_id);
  50. };
  51. extern const struct sof_probes_ipc_ops ipc3_probe_ops;
  52. extern const struct sof_probes_ipc_ops ipc4_probe_ops;
  53. struct sof_probes_priv {
  54. struct dentry *dfs_points;
  55. struct dentry *dfs_points_remove;
  56. u32 extractor_stream_tag;
  57. struct snd_soc_card card;
  58. void *ipc_priv;
  59. const struct sof_probes_host_ops *host_ops;
  60. const struct sof_probes_ipc_ops *ipc_ops;
  61. };
  62. #endif