Changeset 772 for GPL/trunk/alsa-kernel/include/sound/soc-dapm.h
- Timestamp:
- Apr 19, 2025, 8:08:37 PM (4 months ago)
- Location:
- GPL/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
GPL/trunk
- Property svn:mergeinfo changed
/GPL/branches/uniaud32-6.6-LTS (added) merged: 765,768-769 /GPL/branches/uniaud32-exp (added) merged: 735-741,743-744,748-751,753-760,762-764 /GPL/branches/uniaud32-next merged: 718-734
- Property svn:mergeinfo changed
-
GPL/trunk/alsa-kernel/include/sound/soc-dapm.h
r679 r772 17 17 18 18 struct device; 19 struct snd_pcm_substream; 19 20 struct snd_soc_pcm_runtime; 20 21 struct soc_enum; … … 42 43 /* codec domain */ 43 44 #define SND_SOC_DAPM_VMID(wname) \ 44 { .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \ 45 (struct snd_soc_dapm_widget) { \ 46 .id = snd_soc_dapm_vmid, .name = wname, .kcontrol_news = NULL, \ 45 47 .num_kcontrols = 0} 46 48 47 49 /* platform domain */ 48 50 #define SND_SOC_DAPM_SIGGEN(wname) \ 49 { .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \ 51 (struct snd_soc_dapm_widget) { \ 52 .id = snd_soc_dapm_siggen, .name = wname, .kcontrol_news = NULL, \ 50 53 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 51 54 #define SND_SOC_DAPM_SINK(wname) \ 52 { .id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \ 55 (struct snd_soc_dapm_widget) { \ 56 .id = snd_soc_dapm_sink, .name = wname, .kcontrol_news = NULL, \ 53 57 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 54 58 #define SND_SOC_DAPM_INPUT(wname) \ 55 { .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \ 59 (struct snd_soc_dapm_widget) { \ 60 .id = snd_soc_dapm_input, .name = wname, .kcontrol_news = NULL, \ 56 61 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 57 62 #define SND_SOC_DAPM_OUTPUT(wname) \ 58 { .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \ 63 (struct snd_soc_dapm_widget) { \ 64 .id = snd_soc_dapm_output, .name = wname, .kcontrol_news = NULL, \ 59 65 .num_kcontrols = 0, .reg = SND_SOC_NOPM } 60 66 #define SND_SOC_DAPM_MIC(wname, wevent) \ 61 { .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \ 67 (struct snd_soc_dapm_widget) { \ 68 .id = snd_soc_dapm_mic, .name = wname, .kcontrol_news = NULL, \ 62 69 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 63 70 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} 64 71 #define SND_SOC_DAPM_HP(wname, wevent) \ 65 { .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \ 72 (struct snd_soc_dapm_widget) { \ 73 .id = snd_soc_dapm_hp, .name = wname, .kcontrol_news = NULL, \ 66 74 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 67 75 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 68 76 #define SND_SOC_DAPM_SPK(wname, wevent) \ 69 { .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \ 77 (struct snd_soc_dapm_widget) { \ 78 .id = snd_soc_dapm_spk, .name = wname, .kcontrol_news = NULL, \ 70 79 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 71 80 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} 72 81 #define SND_SOC_DAPM_LINE(wname, wevent) \ 73 { .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \ 82 (struct snd_soc_dapm_widget) { \ 83 .id = snd_soc_dapm_line, .name = wname, .kcontrol_news = NULL, \ 74 84 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 75 85 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_PRE_PMD} … … 82 92 #define SND_SOC_DAPM_PGA(wname, wreg, wshift, winvert,\ 83 93 wcontrols, wncontrols) \ 84 { .id = snd_soc_dapm_pga, .name = wname, \ 94 (struct snd_soc_dapm_widget) { \ 95 .id = snd_soc_dapm_pga, .name = wname, \ 85 96 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 86 97 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 87 98 #define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\ 88 99 wcontrols, wncontrols) \ 89 { .id = snd_soc_dapm_out_drv, .name = wname, \ 100 (struct snd_soc_dapm_widget) { \ 101 .id = snd_soc_dapm_out_drv, .name = wname, \ 90 102 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 91 103 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 92 104 #define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 93 105 wcontrols, wncontrols)\ 94 { .id = snd_soc_dapm_mixer, .name = wname, \ 106 (struct snd_soc_dapm_widget) { \ 107 .id = snd_soc_dapm_mixer, .name = wname, \ 95 108 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 96 109 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 97 110 #define SND_SOC_DAPM_MIXER_NAMED_CTL(wname, wreg, wshift, winvert, \ 98 111 wcontrols, wncontrols)\ 99 { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 112 (struct snd_soc_dapm_widget) { \ 113 .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 100 114 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 101 115 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols} 102 116 /* DEPRECATED: use SND_SOC_DAPM_SUPPLY */ 103 117 #define SND_SOC_DAPM_MICBIAS(wname, wreg, wshift, winvert) \ 104 { .id = snd_soc_dapm_micbias, .name = wname, \ 118 (struct snd_soc_dapm_widget) { \ 119 .id = snd_soc_dapm_micbias, .name = wname, \ 105 120 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 106 121 .kcontrol_news = NULL, .num_kcontrols = 0} 107 122 #define SND_SOC_DAPM_SWITCH(wname, wreg, wshift, winvert, wcontrols) \ 108 { .id = snd_soc_dapm_switch, .name = wname, \ 123 (struct snd_soc_dapm_widget) { \ 124 .id = snd_soc_dapm_switch, .name = wname, \ 109 125 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 110 126 .kcontrol_news = wcontrols, .num_kcontrols = 1} 111 127 #define SND_SOC_DAPM_MUX(wname, wreg, wshift, winvert, wcontrols) \ 112 { .id = snd_soc_dapm_mux, .name = wname, \ 128 (struct snd_soc_dapm_widget) { \ 129 .id = snd_soc_dapm_mux, .name = wname, \ 113 130 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 114 131 .kcontrol_news = wcontrols, .num_kcontrols = 1} 115 132 #define SND_SOC_DAPM_DEMUX(wname, wreg, wshift, winvert, wcontrols) \ 116 { .id = snd_soc_dapm_demux, .name = wname, \ 133 (struct snd_soc_dapm_widget) { \ 134 .id = snd_soc_dapm_demux, .name = wname, \ 117 135 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 118 136 .kcontrol_news = wcontrols, .num_kcontrols = 1} … … 121 139 #define SOC_PGA_ARRAY(wname, wreg, wshift, winvert,\ 122 140 wcontrols) \ 123 { .id = snd_soc_dapm_pga, .name = wname, \ 141 (struct snd_soc_dapm_widget) { \ 142 .id = snd_soc_dapm_pga, .name = wname, \ 124 143 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 125 144 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 126 145 #define SOC_MIXER_ARRAY(wname, wreg, wshift, winvert, \ 127 146 wcontrols)\ 128 { .id = snd_soc_dapm_mixer, .name = wname, \ 147 (struct snd_soc_dapm_widget) { \ 148 .id = snd_soc_dapm_mixer, .name = wname, \ 129 149 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 130 150 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} 131 151 #define SOC_MIXER_NAMED_CTL_ARRAY(wname, wreg, wshift, winvert, \ 132 152 wcontrols)\ 133 { .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 153 (struct snd_soc_dapm_widget) { \ 154 .id = snd_soc_dapm_mixer_named_ctl, .name = wname, \ 134 155 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 135 156 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols)} … … 138 159 #define SND_SOC_DAPM_PGA_E(wname, wreg, wshift, winvert, wcontrols, \ 139 160 wncontrols, wevent, wflags) \ 140 { .id = snd_soc_dapm_pga, .name = wname, \ 161 (struct snd_soc_dapm_widget) { \ 162 .id = snd_soc_dapm_pga, .name = wname, \ 141 163 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 142 164 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ … … 144 166 #define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \ 145 167 wncontrols, wevent, wflags) \ 146 { .id = snd_soc_dapm_out_drv, .name = wname, \ 168 (struct snd_soc_dapm_widget) { \ 169 .id = snd_soc_dapm_out_drv, .name = wname, \ 147 170 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 148 171 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ … … 150 173 #define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 151 174 wncontrols, wevent, wflags) \ 152 { .id = snd_soc_dapm_mixer, .name = wname, \ 175 (struct snd_soc_dapm_widget) { \ 176 .id = snd_soc_dapm_mixer, .name = wname, \ 153 177 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 154 178 .kcontrol_news = wcontrols, .num_kcontrols = wncontrols, \ … … 156 180 #define SND_SOC_DAPM_MIXER_NAMED_CTL_E(wname, wreg, wshift, winvert, \ 157 181 wcontrols, wncontrols, wevent, wflags) \ 158 { .id = snd_soc_dapm_mixer, .name = wname, \ 182 (struct snd_soc_dapm_widget) { \ 183 .id = snd_soc_dapm_mixer, .name = wname, \ 159 184 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 160 185 .kcontrol_news = wcontrols, \ … … 162 187 #define SND_SOC_DAPM_SWITCH_E(wname, wreg, wshift, winvert, wcontrols, \ 163 188 wevent, wflags) \ 164 { .id = snd_soc_dapm_switch, .name = wname, \ 189 (struct snd_soc_dapm_widget) { \ 190 .id = snd_soc_dapm_switch, .name = wname, \ 165 191 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 166 192 .kcontrol_news = wcontrols, .num_kcontrols = 1, \ … … 168 194 #define SND_SOC_DAPM_MUX_E(wname, wreg, wshift, winvert, wcontrols, \ 169 195 wevent, wflags) \ 170 { .id = snd_soc_dapm_mux, .name = wname, \ 196 (struct snd_soc_dapm_widget) { \ 197 .id = snd_soc_dapm_mux, .name = wname, \ 171 198 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 172 199 .kcontrol_news = wcontrols, .num_kcontrols = 1, \ … … 176 203 #define SND_SOC_DAPM_PGA_S(wname, wsubseq, wreg, wshift, winvert, \ 177 204 wevent, wflags) \ 178 { .id = snd_soc_dapm_pga, .name = wname, \ 205 (struct snd_soc_dapm_widget) { \ 206 .id = snd_soc_dapm_pga, .name = wname, \ 179 207 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 180 208 .event = wevent, .event_flags = wflags, \ … … 182 210 #define SND_SOC_DAPM_SUPPLY_S(wname, wsubseq, wreg, wshift, winvert, wevent, \ 183 211 wflags) \ 184 { .id = snd_soc_dapm_supply, .name = wname, \ 212 (struct snd_soc_dapm_widget) { \ 213 .id = snd_soc_dapm_supply, .name = wname, \ 185 214 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 186 215 .event = wevent, .event_flags = wflags, .subseq = wsubseq} … … 189 218 #define SOC_PGA_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 190 219 wevent, wflags) \ 191 { .id = snd_soc_dapm_pga, .name = wname, \ 220 (struct snd_soc_dapm_widget) { \ 221 .id = snd_soc_dapm_pga, .name = wname, \ 192 222 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 193 223 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ … … 195 225 #define SOC_MIXER_E_ARRAY(wname, wreg, wshift, winvert, wcontrols, \ 196 226 wevent, wflags) \ 197 { .id = snd_soc_dapm_mixer, .name = wname, \ 227 (struct snd_soc_dapm_widget) { \ 228 .id = snd_soc_dapm_mixer, .name = wname, \ 198 229 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 199 230 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ … … 201 232 #define SOC_MIXER_NAMED_CTL_E_ARRAY(wname, wreg, wshift, winvert, \ 202 233 wcontrols, wevent, wflags) \ 203 { .id = snd_soc_dapm_mixer, .name = wname, \ 234 (struct snd_soc_dapm_widget) { \ 235 .id = snd_soc_dapm_mixer, .name = wname, \ 204 236 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 205 237 .kcontrol_news = wcontrols, .num_kcontrols = ARRAY_SIZE(wcontrols), \ … … 208 240 /* events that are pre and post DAPM */ 209 241 #define SND_SOC_DAPM_PRE(wname, wevent) \ 210 { .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \ 242 (struct snd_soc_dapm_widget) { \ 243 .id = snd_soc_dapm_pre, .name = wname, .kcontrol_news = NULL, \ 211 244 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 212 245 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_PRE_PMD} 213 246 #define SND_SOC_DAPM_POST(wname, wevent) \ 214 { .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \ 247 (struct snd_soc_dapm_widget) { \ 248 .id = snd_soc_dapm_post, .name = wname, .kcontrol_news = NULL, \ 215 249 .num_kcontrols = 0, .reg = SND_SOC_NOPM, .event = wevent, \ 216 250 .event_flags = SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD} … … 218 252 /* stream domain */ 219 253 #define SND_SOC_DAPM_AIF_IN(wname, stname, wchan, wreg, wshift, winvert) \ 220 { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 254 (struct snd_soc_dapm_widget) { \ 255 .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 221 256 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 222 257 #define SND_SOC_DAPM_AIF_IN_E(wname, stname, wchan, wreg, wshift, winvert, \ 223 258 wevent, wflags) \ 224 { .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 259 (struct snd_soc_dapm_widget) { \ 260 .id = snd_soc_dapm_aif_in, .name = wname, .sname = stname, \ 225 261 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 226 262 .event = wevent, .event_flags = wflags } 227 263 #define SND_SOC_DAPM_AIF_OUT(wname, stname, wchan, wreg, wshift, winvert) \ 228 { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 264 (struct snd_soc_dapm_widget) { \ 265 .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 229 266 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 230 267 #define SND_SOC_DAPM_AIF_OUT_E(wname, stname, wchan, wreg, wshift, winvert, \ 231 268 wevent, wflags) \ 232 { .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 269 (struct snd_soc_dapm_widget) { \ 270 .id = snd_soc_dapm_aif_out, .name = wname, .sname = stname, \ 233 271 .channel = wchan, SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 234 272 .event = wevent, .event_flags = wflags } 235 273 #define SND_SOC_DAPM_DAC(wname, stname, wreg, wshift, winvert) \ 236 { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 274 (struct snd_soc_dapm_widget) { \ 275 .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 237 276 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert) } 238 277 #define SND_SOC_DAPM_DAC_E(wname, stname, wreg, wshift, winvert, \ 239 278 wevent, wflags) \ 240 { .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 279 (struct snd_soc_dapm_widget) { \ 280 .id = snd_soc_dapm_dac, .name = wname, .sname = stname, \ 241 281 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 242 282 .event = wevent, .event_flags = wflags} 243 283 244 284 #define SND_SOC_DAPM_ADC(wname, stname, wreg, wshift, winvert) \ 245 { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 285 (struct snd_soc_dapm_widget) { \ 286 .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 246 287 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), } 247 288 #define SND_SOC_DAPM_ADC_E(wname, stname, wreg, wshift, winvert, \ 248 289 wevent, wflags) \ 249 { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 290 (struct snd_soc_dapm_widget) { \ 291 .id = snd_soc_dapm_adc, .name = wname, .sname = stname, \ 250 292 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 251 293 .event = wevent, .event_flags = wflags} 252 294 #define SND_SOC_DAPM_CLOCK_SUPPLY(wname) \ 253 { .id = snd_soc_dapm_clock_supply, .name = wname, \ 295 (struct snd_soc_dapm_widget) { \ 296 .id = snd_soc_dapm_clock_supply, .name = wname, \ 254 297 .reg = SND_SOC_NOPM, .event = dapm_clock_event, \ 255 298 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD } … … 257 300 /* generic widgets */ 258 301 #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ 259 { .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \ 302 (struct snd_soc_dapm_widget) { \ 303 .id = wid, .name = wname, .kcontrol_news = NULL, .num_kcontrols = 0, \ 260 304 .reg = wreg, .shift = wshift, .mask = wmask, \ 261 305 .on_val = won_val, .off_val = woff_val, } 262 306 #define SND_SOC_DAPM_SUPPLY(wname, wreg, wshift, winvert, wevent, wflags) \ 263 { .id = snd_soc_dapm_supply, .name = wname, \ 307 (struct snd_soc_dapm_widget) { \ 308 .id = snd_soc_dapm_supply, .name = wname, \ 264 309 SND_SOC_DAPM_INIT_REG_VAL(wreg, wshift, winvert), \ 265 310 .event = wevent, .event_flags = wflags} 266 311 #define SND_SOC_DAPM_REGULATOR_SUPPLY(wname, wdelay, wflags) \ 267 { .id = snd_soc_dapm_regulator_supply, .name = wname, \ 312 (struct snd_soc_dapm_widget) { \ 313 .id = snd_soc_dapm_regulator_supply, .name = wname, \ 268 314 .reg = SND_SOC_NOPM, .shift = wdelay, .event = dapm_regulator_event, \ 269 315 .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD, \ 270 316 .on_val = wflags} 271 317 #define SND_SOC_DAPM_PINCTRL(wname, active, sleep) \ 272 { .id = snd_soc_dapm_pinctrl, .name = wname, \ 318 (struct snd_soc_dapm_widget) { \ 319 .id = snd_soc_dapm_pinctrl, .name = wname, \ 273 320 .priv = (&(struct snd_soc_dapm_pinctrl_priv) \ 274 321 { .active_state = active, .sleep_state = sleep,}), \ … … 342 389 #define SND_SOC_DAPM_STREAM_SUSPEND 0x4 343 390 #define SND_SOC_DAPM_STREAM_RESUME 0x8 344 #define SND_SOC_DAPM_STREAM_PAUSE_PUSH 0x10391 #define SND_SOC_DAPM_STREAM_PAUSE_PUSH 0x10 345 392 #define SND_SOC_DAPM_STREAM_PAUSE_RELEASE 0x20 346 393 347 394 /* dapm event types */ 348 #define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ 349 #define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ 350 #define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ 351 #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ 352 #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ 353 #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ 354 #define SND_SOC_DAPM_WILL_PMU 0x40 /* called at start of sequence */ 355 #define SND_SOC_DAPM_WILL_PMD 0x80 /* called at start of sequence */ 356 #define SND_SOC_DAPM_PRE_POST_PMD \ 357 (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) 358 #define SND_SOC_DAPM_PRE_POST_PMU \ 359 (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU) 395 #define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ 396 #define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ 397 #define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ 398 #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ 399 #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ 400 #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ 401 #define SND_SOC_DAPM_WILL_PMU 0x40 /* called at start of sequence */ 402 #define SND_SOC_DAPM_WILL_PMD 0x80 /* called at start of sequence */ 403 #define SND_SOC_DAPM_PRE_POST_PMD (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD) 404 #define SND_SOC_DAPM_PRE_POST_PMU (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU) 360 405 361 406 /* convenience event type detection */ 362 #define SND_SOC_DAPM_EVENT_ON(e) \ 363 (e & (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)) 364 #define SND_SOC_DAPM_EVENT_OFF(e) \ 365 (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)) 407 #define SND_SOC_DAPM_EVENT_ON(e) (e & (SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMU)) 408 #define SND_SOC_DAPM_EVENT_OFF(e) (e & (SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMD)) 366 409 367 410 /* regulator widget flags */ 368 #define SND_SOC_DAPM_REGULATOR_BYPASS 0x1/* bypass when disabled */411 #define SND_SOC_DAPM_REGULATOR_BYPASS 0x1 /* bypass when disabled */ 369 412 370 413 struct snd_soc_dapm_widget; … … 397 440 }; 398 441 399 int dapm_regulator_event(struct snd_soc_dapm_widget *w, 400 struct snd_kcontrol *kcontrol, int event); 401 int dapm_clock_event(struct snd_soc_dapm_widget *w, 402 struct snd_kcontrol *kcontrol, int event); 403 int dapm_pinctrl_event(struct snd_soc_dapm_widget *w, 404 struct snd_kcontrol *kcontrol, int event); 442 int dapm_regulator_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 443 int dapm_clock_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 444 int dapm_pinctrl_event(struct snd_soc_dapm_widget *w, struct snd_kcontrol *kcontrol, int event); 405 445 406 446 /* dapm controls */ 407 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, 408 struct snd_ctl_elem_value *ucontrol); 409 int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol, 410 struct snd_ctl_elem_value *ucontrol); 447 int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 448 int snd_soc_dapm_get_volsw(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol); 411 449 int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, 412 450 struct snd_ctl_elem_value *ucontrol); … … 420 458 struct snd_ctl_elem_value *uncontrol); 421 459 int snd_soc_dapm_new_controls(struct snd_soc_dapm_context *dapm, 422 const struct snd_soc_dapm_widget *widget, 423 int num); 424 struct snd_soc_dapm_widget *snd_soc_dapm_new_control( 425 struct snd_soc_dapm_context *dapm, 460 const struct snd_soc_dapm_widget *widget, int num); 461 struct snd_soc_dapm_widget *snd_soc_dapm_new_control(struct snd_soc_dapm_context *dapm, 426 462 const struct snd_soc_dapm_widget *widget); 427 struct snd_soc_dapm_widget *snd_soc_dapm_new_control_unlocked( 428 struct snd_soc_dapm_context *dapm, 463 struct snd_soc_dapm_widget *snd_soc_dapm_new_control_unlocked(struct snd_soc_dapm_context *dapm, 429 464 const struct snd_soc_dapm_widget *widget); 430 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, 431 struct snd_soc_dai *dai);465 int snd_soc_dapm_new_dai_widgets(struct snd_soc_dapm_context *dapm, struct snd_soc_dai *dai); 466 void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w); 432 467 int snd_soc_dapm_link_dai_widgets(struct snd_soc_card *card); 433 468 void snd_soc_dapm_connect_dai_link_widgets(struct snd_soc_card *card); 434 469 435 470 int snd_soc_dapm_update_dai(struct snd_pcm_substream *substream, 436 struct snd_pcm_hw_params *params, 437 struct snd_soc_dai *dai);471 struct snd_pcm_hw_params *params, struct snd_soc_dai *dai); 472 int snd_soc_dapm_widget_name_cmp(struct snd_soc_dapm_widget *widget, const char *s); 438 473 439 474 /* dapm path setup */ … … 441 476 void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); 442 477 void snd_soc_dapm_init(struct snd_soc_dapm_context *dapm, 443 struct snd_soc_card *card, 444 struct snd_soc_component *component); 478 struct snd_soc_card *card, struct snd_soc_component *component); 445 479 int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, 446 480 const struct snd_soc_dapm_route *route, int num); … … 450 484 const struct snd_soc_dapm_route *route, int num); 451 485 void snd_soc_dapm_free_widget(struct snd_soc_dapm_widget *w); 452 void snd_soc_dapm_reset_cache(struct snd_soc_dapm_context *dapm);453 486 454 487 /* dapm events */ 455 void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, 456 int event); 488 void snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, int stream, int event); 457 489 void snd_soc_dapm_stream_stop(struct snd_soc_pcm_runtime *rtd, int stream); 458 490 void snd_soc_dapm_shutdown(struct snd_soc_card *card); … … 460 492 /* external DAPM widget events */ 461 493 int snd_soc_dapm_mixer_update_power(struct snd_soc_dapm_context *dapm, 462 struct snd_kcontrol *kcontrol, int connect, 463 struct snd_soc_dapm_update *update); 494 struct snd_kcontrol *kcontrol, int connect, struct snd_soc_dapm_update *update); 464 495 int snd_soc_dapm_mux_update_power(struct snd_soc_dapm_context *dapm, 465 496 struct snd_kcontrol *kcontrol, int mux, struct soc_enum *e, … … 468 499 /* dapm sys fs - used by the core */ 469 500 extern struct attribute *soc_dapm_dev_attrs[]; 470 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, 471 struct dentry *parent); 501 void snd_soc_dapm_debugfs_init(struct snd_soc_dapm_context *dapm, struct dentry *parent); 472 502 473 503 /* dapm audio pin control and status */ 474 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, 475 const char *pin); 476 int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 477 const char *pin); 478 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, 479 const char *pin); 480 int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, 481 const char *pin); 504 int snd_soc_dapm_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 505 int snd_soc_dapm_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 506 int snd_soc_dapm_disable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 507 int snd_soc_dapm_disable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 482 508 int snd_soc_dapm_nc_pin(struct snd_soc_dapm_context *dapm, const char *pin); 483 int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, 484 const char *pin); 485 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, 486 const char *pin); 509 int snd_soc_dapm_nc_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 510 int snd_soc_dapm_get_pin_status(struct snd_soc_dapm_context *dapm, const char *pin); 487 511 int snd_soc_dapm_sync(struct snd_soc_dapm_context *dapm); 488 512 int snd_soc_dapm_sync_unlocked(struct snd_soc_dapm_context *dapm); 489 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, 490 const char *pin); 491 int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, 492 const char *pin); 493 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, 494 const char *pin); 513 int snd_soc_dapm_force_enable_pin(struct snd_soc_dapm_context *dapm, const char *pin); 514 int snd_soc_dapm_force_enable_pin_unlocked(struct snd_soc_dapm_context *dapm, const char *pin); 515 int snd_soc_dapm_ignore_suspend(struct snd_soc_dapm_context *dapm, const char *pin); 495 516 unsigned int dapm_kcontrol_get_value(const struct snd_kcontrol *kcontrol); 496 517 … … 501 522 int snd_soc_dapm_dai_get_connected_widgets(struct snd_soc_dai *dai, int stream, 502 523 struct snd_soc_dapm_widget_list **list, 503 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, 504 enum snd_soc_dapm_direction)); 524 bool (*custom_stop_condition)(struct snd_soc_dapm_widget *, enum snd_soc_dapm_direction)); 505 525 void snd_soc_dapm_dai_free_widgets(struct snd_soc_dapm_widget_list **list); 506 526 507 struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm( 508 struct snd_kcontrol *kcontrol); 509 510 struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget( 511 struct snd_kcontrol *kcontrol); 512 513 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, 514 enum snd_soc_bias_level level); 527 struct snd_soc_dapm_context *snd_soc_dapm_kcontrol_dapm(struct snd_kcontrol *kcontrol); 528 struct snd_soc_dapm_widget *snd_soc_dapm_kcontrol_widget(struct snd_kcontrol *kcontrol); 529 530 int snd_soc_dapm_force_bias_level(struct snd_soc_dapm_context *dapm, enum snd_soc_bias_level level); 515 531 516 532 /* dapm widget types */ … … 518 534 snd_soc_dapm_input = 0, /* input pin */ 519 535 snd_soc_dapm_output, /* output pin */ 520 snd_soc_dapm_mux, 521 snd_soc_dapm_demux, 522 snd_soc_dapm_mixer, 523 snd_soc_dapm_mixer_named_ctl, 524 snd_soc_dapm_pga, 525 snd_soc_dapm_out_drv, 526 snd_soc_dapm_adc, 527 snd_soc_dapm_dac, 536 snd_soc_dapm_mux, /* selects 1 analog signal from many inputs */ 537 snd_soc_dapm_demux, /* connects the input to one of multiple outputs */ 538 snd_soc_dapm_mixer, /* mixes several analog signals together */ 539 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ 540 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ 541 snd_soc_dapm_out_drv, /* output driver */ 542 snd_soc_dapm_adc, /* analog to digital converter */ 543 snd_soc_dapm_dac, /* digital to analog converter */ 528 544 snd_soc_dapm_micbias, /* microphone bias (power) - DEPRECATED: use snd_soc_dapm_supply */ 529 snd_soc_dapm_mic, 530 snd_soc_dapm_hp, 531 snd_soc_dapm_spk, 532 snd_soc_dapm_line, 545 snd_soc_dapm_mic, /* microphone */ 546 snd_soc_dapm_hp, /* headphones */ 547 snd_soc_dapm_spk, /* speaker */ 548 snd_soc_dapm_line, /* line input/output */ 533 549 snd_soc_dapm_switch, /* analog switch */ 534 snd_soc_dapm_vmid, 535 snd_soc_dapm_pre, 536 snd_soc_dapm_post, 550 snd_soc_dapm_vmid, /* codec bias/vmid - to minimise pops */ 551 snd_soc_dapm_pre, /* machine specific pre widget - exec first */ 552 snd_soc_dapm_post, /* machine specific post widget - exec last */ 537 553 snd_soc_dapm_supply, /* power/clock supply */ 538 554 snd_soc_dapm_pinctrl, /* pinctrl */ … … 559 575 }; 560 576 561 enum snd_soc_dapm_subclass {562 SND_SOC_DAPM_CLASS_INIT = 0,563 SND_SOC_DAPM_CLASS_RUNTIME = 1,564 };565 566 577 /* 567 578 * DAPM audio route definition. … … 600 611 601 612 /* status */ 602 u32 connect:1; /* source and sink widgets are connected */603 u32 walking:1; 604 u32 weak:1; /* path ignored for power management */613 u32 connect:1; /* source and sink widgets are connected */ 614 u32 walking:1; /* path is in the process of being walked */ 615 u32 weak:1; /* path ignored for power management */ 605 616 u32 is_supply:1; /* At least one of the connected widgets is a supply */ 606 617 … … 616 627 struct snd_soc_dapm_widget { 617 628 enum snd_soc_dapm_type id; 618 const char *name; /* widget name */619 const char *sname; /* stream name */629 const char *name; /* widget name */ 630 const char *sname; /* stream name */ 620 631 struct list_head list; 621 632 struct snd_soc_dapm_context *dapm; … … 636 647 unsigned char new:1; /* cnew complete */ 637 648 unsigned char force:1; /* force state */ 638 unsigned char ignore_suspend:1; 649 unsigned char ignore_suspend:1; /* kept enabled over suspend */ 639 650 unsigned char new_power:1; /* power from this run */ 640 651 unsigned char power_checked:1; /* power checked this run */ 641 652 unsigned char is_supply:1; /* Widget is a supply type widget */ 642 653 unsigned char is_ep:2; /* Widget is a endpoint type widget */ 654 unsigned char no_wname_in_kcontrol_name:1; /* No widget name prefix in kcontrol name */ 643 655 int subseq; /* sort within widget type */ 644 656 … … 680 692 }; 681 693 682 struct snd_soc_dapm_wcache {683 struct snd_soc_dapm_widget *widget;684 };685 686 694 /* DAPM context */ 687 695 struct snd_soc_dapm_context { 688 696 enum snd_soc_bias_level bias_level; 689 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ 690 /* Go to BIAS_OFF in suspend if the DAPM context is idle */ 691 unsigned int suspend_bias_off:1; 692 693 struct device *dev; /* from parent - for debug */ 694 struct snd_soc_component *component; /* parent component */ 695 struct snd_soc_card *card; /* parent card */ 697 698 /* bit field */ 699 unsigned int idle_bias_off:1; /* Use BIAS_OFF instead of STANDBY */ 700 unsigned int suspend_bias_off:1; /* Use BIAS_OFF in suspend if the DAPM is idle */ 701 702 struct device *dev; /* from parent - for debug */ 703 struct snd_soc_component *component; /* parent component */ 704 struct snd_soc_card *card; /* parent card */ 696 705 697 706 /* used during DAPM updates */ … … 699 708 struct list_head list; 700 709 701 struct snd_soc_dapm_w cache path_sink_cache;702 struct snd_soc_dapm_w cache path_source_cache;710 struct snd_soc_dapm_widget *wcache_sink; 711 struct snd_soc_dapm_widget *wcache_source; 703 712 704 713 #ifdef CONFIG_DEBUG_FS … … 767 776 #define SND_SOC_DAPM_DIR_TO_EP(x) BIT(x) 768 777 769 #define SND_SOC_DAPM_EP_SOURCE 770 #define SND_SOC_DAPM_EP_SINK 778 #define SND_SOC_DAPM_EP_SOURCE SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_IN) 779 #define SND_SOC_DAPM_EP_SINK SND_SOC_DAPM_DIR_TO_EP(SND_SOC_DAPM_DIR_OUT) 771 780 772 781 /** 773 * snd_soc_dapm_widget_for_each_ sink_path - Iterates over all paths in the782 * snd_soc_dapm_widget_for_each_path - Iterates over all paths in the 774 783 * specified direction of a widget 775 784 * @w: The widget … … 782 791 783 792 /** 784 * snd_soc_dapm_widget_for_each_ sink_path_safe - Iterates over all paths in the793 * snd_soc_dapm_widget_for_each_path_safe - Iterates over all paths in the 785 794 * specified direction of a widget 786 795 * @w: The widget … … 790 799 * @next_p: Temporary storage for the next path 791 800 * 792 * This function works like snd_soc_dapm_widget_for_each_ sink_path, expect that801 * This function works like snd_soc_dapm_widget_for_each_path, expect that 793 802 * it is safe to remove the current path from the list while iterating 794 803 */
Note:
See TracChangeset
for help on using the changeset viewer.