This source file includes following definitions.
- soc_dpcm_debugfs_add
- dpcm_path_put
1
2
3
4
5
6
7
8 #ifndef __LINUX_SND_SOC_DPCM_H
9 #define __LINUX_SND_SOC_DPCM_H
10
11 #include <linux/slab.h>
12 #include <linux/list.h>
13 #include <sound/pcm.h>
14
15 struct snd_soc_pcm_runtime;
16
17
18
19
20
21 enum snd_soc_dpcm_update {
22 SND_SOC_DPCM_UPDATE_NO = 0,
23 SND_SOC_DPCM_UPDATE_BE,
24 SND_SOC_DPCM_UPDATE_FE,
25 };
26
27
28
29
30 enum snd_soc_dpcm_link_state {
31 SND_SOC_DPCM_LINK_STATE_NEW = 0,
32 SND_SOC_DPCM_LINK_STATE_FREE,
33 };
34
35
36
37
38 enum snd_soc_dpcm_state {
39 SND_SOC_DPCM_STATE_NEW = 0,
40 SND_SOC_DPCM_STATE_OPEN,
41 SND_SOC_DPCM_STATE_HW_PARAMS,
42 SND_SOC_DPCM_STATE_PREPARE,
43 SND_SOC_DPCM_STATE_START,
44 SND_SOC_DPCM_STATE_STOP,
45 SND_SOC_DPCM_STATE_PAUSED,
46 SND_SOC_DPCM_STATE_SUSPEND,
47 SND_SOC_DPCM_STATE_HW_FREE,
48 SND_SOC_DPCM_STATE_CLOSE,
49 };
50
51
52
53
54
55
56
57
58 enum snd_soc_dpcm_trigger {
59 SND_SOC_DPCM_TRIGGER_PRE = 0,
60 SND_SOC_DPCM_TRIGGER_POST,
61 SND_SOC_DPCM_TRIGGER_BESPOKE,
62 };
63
64
65
66
67
68
69 struct snd_soc_dpcm {
70
71 struct snd_soc_pcm_runtime *be;
72 struct snd_soc_pcm_runtime *fe;
73
74
75 enum snd_soc_dpcm_link_state state;
76
77
78 struct list_head list_be;
79 struct list_head list_fe;
80
81
82 struct snd_pcm_hw_params hw_params;
83 #ifdef CONFIG_DEBUG_FS
84 struct dentry *debugfs_state;
85 #endif
86 };
87
88
89
90
91 struct snd_soc_dpcm_runtime {
92 struct list_head be_clients;
93 struct list_head fe_clients;
94
95 int users;
96 struct snd_pcm_runtime *runtime;
97 struct snd_pcm_hw_params hw_params;
98
99
100 enum snd_soc_dpcm_update runtime_update;
101 enum snd_soc_dpcm_state state;
102
103 int trigger_pending;
104 };
105
106 #define for_each_dpcm_fe(be, stream, dpcm) \
107 list_for_each_entry(dpcm, &(be)->dpcm[stream].fe_clients, list_fe)
108
109 #define for_each_dpcm_be(fe, stream, dpcm) \
110 list_for_each_entry(dpcm, &(fe)->dpcm[stream].be_clients, list_be)
111 #define for_each_dpcm_be_safe(fe, stream, dpcm, _dpcm) \
112 list_for_each_entry_safe(dpcm, _dpcm, &(fe)->dpcm[stream].be_clients, list_be)
113 #define for_each_dpcm_be_rollback(fe, stream, dpcm) \
114 list_for_each_entry_continue_reverse(dpcm, &(fe)->dpcm[stream].be_clients, list_be)
115
116
117 int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe,
118 struct snd_soc_pcm_runtime *be, int stream);
119
120
121 int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
122 struct snd_soc_pcm_runtime *be, int stream);
123
124
125 int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream);
126
127
128 int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe,
129 struct snd_soc_pcm_runtime *be, int stream);
130
131
132 struct snd_pcm_substream *
133 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream);
134
135
136 enum snd_soc_dpcm_state
137 snd_soc_dpcm_be_get_state(struct snd_soc_pcm_runtime *be, int stream);
138
139
140 void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
141 enum snd_soc_dpcm_state state);
142
143
144 int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
145 int soc_dpcm_runtime_update(struct snd_soc_card *);
146
147 #ifdef CONFIG_DEBUG_FS
148 void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
149 #else
150 static inline void soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd)
151 {
152 }
153 #endif
154
155 int dpcm_path_get(struct snd_soc_pcm_runtime *fe,
156 int stream, struct snd_soc_dapm_widget_list **list_);
157 int dpcm_process_paths(struct snd_soc_pcm_runtime *fe,
158 int stream, struct snd_soc_dapm_widget_list **list, int new);
159 int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream);
160 int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream);
161 void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream);
162 void dpcm_clear_pending_state(struct snd_soc_pcm_runtime *fe, int stream);
163 int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream);
164 int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int tream);
165 int dpcm_be_dai_trigger(struct snd_soc_pcm_runtime *fe, int stream, int cmd);
166 int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream);
167 int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir,
168 int event);
169
170 static inline void dpcm_path_put(struct snd_soc_dapm_widget_list **list)
171 {
172 kfree(*list);
173 }
174
175
176 #endif