diff options
Diffstat (limited to 'include/sound/soc-dapm.h')
-rw-r--r-- | include/sound/soc-dapm.h | 42 |
1 files changed, 36 insertions, 6 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index a105b01e06d5..3030fdc6981d 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -130,6 +130,13 @@ | |||
130 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ | 130 | { .id = snd_soc_dapm_adc, .name = wname, .sname = stname, .reg = wreg, \ |
131 | .shift = wshift, .invert = winvert} | 131 | .shift = wshift, .invert = winvert} |
132 | 132 | ||
133 | /* generic register modifier widget */ | ||
134 | #define SND_SOC_DAPM_REG(wid, wname, wreg, wshift, wmask, won_val, woff_val) \ | ||
135 | { .id = wid, .name = wname, .kcontrols = NULL, .num_kcontrols = 0, \ | ||
136 | .reg = -((wreg) + 1), .shift = wshift, .mask = wmask, \ | ||
137 | .on_val = won_val, .off_val = woff_val, .event = dapm_reg_event, \ | ||
138 | .event_flags = SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD} | ||
139 | |||
133 | /* dapm kcontrol types */ | 140 | /* dapm kcontrol types */ |
134 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ | 141 | #define SOC_DAPM_SINGLE(xname, reg, shift, max, invert) \ |
135 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 142 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
@@ -193,6 +200,7 @@ struct snd_soc_dapm_widget; | |||
193 | enum snd_soc_dapm_type; | 200 | enum snd_soc_dapm_type; |
194 | struct snd_soc_dapm_path; | 201 | struct snd_soc_dapm_path; |
195 | struct snd_soc_dapm_pin; | 202 | struct snd_soc_dapm_pin; |
203 | struct snd_soc_dapm_route; | ||
196 | 204 | ||
197 | /* dapm controls */ | 205 | /* dapm controls */ |
198 | int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | 206 | int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, |
@@ -205,25 +213,32 @@ int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, | |||
205 | struct snd_ctl_elem_value *ucontrol); | 213 | struct snd_ctl_elem_value *ucontrol); |
206 | int snd_soc_dapm_new_control(struct snd_soc_codec *codec, | 214 | int snd_soc_dapm_new_control(struct snd_soc_codec *codec, |
207 | const struct snd_soc_dapm_widget *widget); | 215 | const struct snd_soc_dapm_widget *widget); |
216 | int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, | ||
217 | const struct snd_soc_dapm_widget *widget, | ||
218 | int num); | ||
208 | 219 | ||
209 | /* dapm path setup */ | 220 | /* dapm path setup */ |
210 | int snd_soc_dapm_connect_input(struct snd_soc_codec *codec, | 221 | int __deprecated snd_soc_dapm_connect_input(struct snd_soc_codec *codec, |
211 | const char *sink_name, const char *control_name, const char *src_name); | 222 | const char *sink_name, const char *control_name, const char *src_name); |
212 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); | 223 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); |
213 | void snd_soc_dapm_free(struct snd_soc_device *socdev); | 224 | void snd_soc_dapm_free(struct snd_soc_device *socdev); |
225 | int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | ||
226 | const struct snd_soc_dapm_route *route, int num); | ||
214 | 227 | ||
215 | /* dapm events */ | 228 | /* dapm events */ |
216 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, | 229 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, |
217 | int event); | 230 | int event); |
218 | int snd_soc_dapm_device_event(struct snd_soc_device *socdev, int event); | 231 | int snd_soc_dapm_set_bias_level(struct snd_soc_device *socdev, |
232 | enum snd_soc_bias_level level); | ||
219 | 233 | ||
220 | /* dapm sys fs - used by the core */ | 234 | /* dapm sys fs - used by the core */ |
221 | int snd_soc_dapm_sys_add(struct device *dev); | 235 | int snd_soc_dapm_sys_add(struct device *dev); |
222 | 236 | ||
223 | /* dapm audio endpoint control */ | 237 | /* dapm audio pin control and status */ |
224 | int snd_soc_dapm_set_endpoint(struct snd_soc_codec *codec, | 238 | int snd_soc_dapm_enable_pin(struct snd_soc_codec *codec, char *pin); |
225 | char *pin, int status); | 239 | int snd_soc_dapm_disable_pin(struct snd_soc_codec *codec, char *pin); |
226 | int snd_soc_dapm_sync_endpoints(struct snd_soc_codec *codec); | 240 | int snd_soc_dapm_get_pin_status(struct snd_soc_codec *codec, char *pin); |
241 | int snd_soc_dapm_sync(struct snd_soc_codec *codec); | ||
227 | 242 | ||
228 | /* dapm widget types */ | 243 | /* dapm widget types */ |
229 | enum snd_soc_dapm_type { | 244 | enum snd_soc_dapm_type { |
@@ -245,6 +260,18 @@ enum snd_soc_dapm_type { | |||
245 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 260 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
246 | }; | 261 | }; |
247 | 262 | ||
263 | /* | ||
264 | * DAPM audio route definition. | ||
265 | * | ||
266 | * Defines an audio route originating at source via control and finishing | ||
267 | * at sink. | ||
268 | */ | ||
269 | struct snd_soc_dapm_route { | ||
270 | const char *sink; | ||
271 | const char *control; | ||
272 | const char *source; | ||
273 | }; | ||
274 | |||
248 | /* dapm audio path between two widgets */ | 275 | /* dapm audio path between two widgets */ |
249 | struct snd_soc_dapm_path { | 276 | struct snd_soc_dapm_path { |
250 | char *name; | 277 | char *name; |
@@ -277,6 +304,9 @@ struct snd_soc_dapm_widget { | |||
277 | unsigned char shift; /* bits to shift */ | 304 | unsigned char shift; /* bits to shift */ |
278 | unsigned int saved_value; /* widget saved value */ | 305 | unsigned int saved_value; /* widget saved value */ |
279 | unsigned int value; /* widget current value */ | 306 | unsigned int value; /* widget current value */ |
307 | unsigned int mask; /* non-shifted mask */ | ||
308 | unsigned int on_val; /* on state value */ | ||
309 | unsigned int off_val; /* off state value */ | ||
280 | unsigned char power:1; /* block power status */ | 310 | unsigned char power:1; /* block power status */ |
281 | unsigned char invert:1; /* invert the power bit */ | 311 | unsigned char invert:1; /* invert the power bit */ |
282 | unsigned char active:1; /* active stream on DAC, ADC's */ | 312 | unsigned char active:1; /* active stream on DAC, ADC's */ |