path.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  2. /*
  3. * Copyright(c) 2021 Intel Corporation. All rights reserved.
  4. *
  5. * Authors: Cezary Rojewski <[email protected]>
  6. * Amadeusz Slawinski <[email protected]>
  7. */
  8. #ifndef __SOUND_SOC_INTEL_AVS_PATH_H
  9. #define __SOUND_SOC_INTEL_AVS_PATH_H
  10. #include <linux/list.h>
  11. #include "avs.h"
  12. #include "topology.h"
  13. struct avs_path {
  14. u32 dma_id;
  15. struct list_head ppl_list;
  16. u32 state;
  17. struct avs_tplg_path *template;
  18. struct avs_dev *owner;
  19. /* device path management */
  20. struct list_head node;
  21. };
  22. struct avs_path_pipeline {
  23. u8 instance_id;
  24. struct list_head mod_list;
  25. struct list_head binding_list;
  26. struct avs_tplg_pipeline *template;
  27. struct avs_path *owner;
  28. /* path pipelines management */
  29. struct list_head node;
  30. };
  31. struct avs_path_module {
  32. u16 module_id;
  33. u16 instance_id;
  34. union avs_gtw_attributes gtw_attrs;
  35. struct avs_tplg_module *template;
  36. struct avs_path_pipeline *owner;
  37. /* pipeline modules management */
  38. struct list_head node;
  39. };
  40. struct avs_path_binding {
  41. struct avs_path_module *source;
  42. u8 source_pin;
  43. struct avs_path_module *sink;
  44. u8 sink_pin;
  45. struct avs_tplg_binding *template;
  46. struct avs_path_pipeline *owner;
  47. /* pipeline bindings management */
  48. struct list_head node;
  49. };
  50. void avs_path_free(struct avs_path *path);
  51. struct avs_path *avs_path_create(struct avs_dev *adev, u32 dma_id,
  52. struct avs_tplg_path_template *template,
  53. struct snd_pcm_hw_params *fe_params,
  54. struct snd_pcm_hw_params *be_params);
  55. int avs_path_bind(struct avs_path *path);
  56. int avs_path_unbind(struct avs_path *path);
  57. int avs_path_reset(struct avs_path *path);
  58. int avs_path_pause(struct avs_path *path);
  59. int avs_path_run(struct avs_path *path, int trigger);
  60. #endif