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