1
2
3
4
5
6
7
8
9
10
11#ifndef __LINUX_SND_SOC_DPCM_H
12#define __LINUX_SND_SOC_DPCM_H
13
14#include <linux/list.h>
15#include <sound/pcm.h>
16
17struct snd_soc_pcm_runtime;
18
19
20
21
22
23enum snd_soc_dpcm_update {
24 SND_SOC_DPCM_UPDATE_NO = 0,
25 SND_SOC_DPCM_UPDATE_BE,
26 SND_SOC_DPCM_UPDATE_FE,
27};
28
29
30
31
32enum snd_soc_dpcm_link_state {
33 SND_SOC_DPCM_LINK_STATE_NEW = 0,
34 SND_SOC_DPCM_LINK_STATE_FREE,
35};
36
37
38
39
40enum snd_soc_dpcm_state {
41 SND_SOC_DPCM_STATE_NEW = 0,
42 SND_SOC_DPCM_STATE_OPEN,
43 SND_SOC_DPCM_STATE_HW_PARAMS,
44 SND_SOC_DPCM_STATE_PREPARE,
45 SND_SOC_DPCM_STATE_START,
46 SND_SOC_DPCM_STATE_STOP,
47 SND_SOC_DPCM_STATE_PAUSED,
48 SND_SOC_DPCM_STATE_SUSPEND,
49 SND_SOC_DPCM_STATE_HW_FREE,
50 SND_SOC_DPCM_STATE_CLOSE,
51};
52
53
54
55
56
57
58
59
60enum snd_soc_dpcm_trigger {
61 SND_SOC_DPCM_TRIGGER_PRE = 0,
62 SND_SOC_DPCM_TRIGGER_POST,
63 SND_SOC_DPCM_TRIGGER_BESPOKE,
64};
65
66
67
68
69
70
71struct snd_soc_dpcm {
72
73 struct snd_soc_pcm_runtime *be;
74 struct snd_soc_pcm_runtime *fe;
75
76
77 enum snd_soc_dpcm_link_state state;
78
79
80 struct list_head list_be;
81 struct list_head list_fe;
82
83
84 struct snd_pcm_hw_params hw_params;
85#ifdef CONFIG_DEBUG_FS
86 struct dentry *debugfs_state;
87#endif
88};
89
90
91
92
93struct snd_soc_dpcm_runtime {
94 struct list_head be_clients;
95 struct list_head fe_clients;
96
97 int users;
98 struct snd_pcm_runtime *runtime;
99 struct snd_pcm_hw_params hw_params;
100
101
102 enum snd_soc_dpcm_update runtime_update;
103 enum snd_soc_dpcm_state state;
104};
105
106
107int snd_soc_dpcm_can_be_free_stop(struct snd_soc_pcm_runtime *fe,
108 struct snd_soc_pcm_runtime *be, int stream);
109
110
111int snd_soc_dpcm_can_be_params(struct snd_soc_pcm_runtime *fe,
112 struct snd_soc_pcm_runtime *be, int stream);
113
114
115int snd_soc_dpcm_fe_can_update(struct snd_soc_pcm_runtime *fe, int stream);
116
117
118int snd_soc_dpcm_be_can_update(struct snd_soc_pcm_runtime *fe,
119 struct snd_soc_pcm_runtime *be, int stream);
120
121
122struct snd_pcm_substream *
123 snd_soc_dpcm_get_substream(struct snd_soc_pcm_runtime *be, int stream);
124
125
126enum snd_soc_dpcm_state
127 snd_soc_dpcm_be_get_state(struct snd_soc_pcm_runtime *be, int stream);
128
129
130void snd_soc_dpcm_be_set_state(struct snd_soc_pcm_runtime *be, int stream,
131 enum snd_soc_dpcm_state state);
132
133
134int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute);
135int soc_dpcm_debugfs_add(struct snd_soc_pcm_runtime *rtd);
136int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *);
137
138#endif
139