sof-client-probes.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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_tstamp;
  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_tstamp *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. struct sof_probes_ipc_ops {
  33. int (*init)(struct sof_client_dev *cdev, u32 stream_tag,
  34. size_t buffer_size);
  35. int (*deinit)(struct sof_client_dev *cdev);
  36. int (*points_info)(struct sof_client_dev *cdev,
  37. struct sof_probe_point_desc **desc,
  38. size_t *num_desc);
  39. int (*points_add)(struct sof_client_dev *cdev,
  40. struct sof_probe_point_desc *desc,
  41. size_t num_desc);
  42. int (*points_remove)(struct sof_client_dev *cdev,
  43. unsigned int *buffer_id, size_t num_buffer_id);
  44. };
  45. extern const struct sof_probes_ipc_ops ipc3_probe_ops;
  46. extern const struct sof_probes_ipc_ops ipc4_probe_ops;
  47. struct sof_probes_priv {
  48. struct dentry *dfs_points;
  49. struct dentry *dfs_points_remove;
  50. u32 extractor_stream_tag;
  51. struct snd_soc_card card;
  52. void *ipc_priv;
  53. const struct sof_probes_host_ops *host_ops;
  54. const struct sof_probes_ipc_ops *ipc_ops;
  55. };
  56. #endif