diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2008-05-13 08:52:19 -0400 |
---|---|---|
committer | Jaroslav Kysela <perex@perex.cz> | 2008-05-19 07:19:18 -0400 |
commit | 105f1c28442301237d20b05a3d52d9987614016f (patch) | |
tree | d91e8de8092eeb5de8db676ffa8dd7cbb6f6d338 /include | |
parent | 4ba1327ab8ce179c40862f3dedb4ebaaa491d737 (diff) |
[ALSA] soc - DAPM - Bulk route registration
ASoC codecs and machine drivers that use DAPM routes all cut'n'paste a
loop iterating over a null terminated array of routes. Factor out this
into a bulk registration function, improving the error reporting for
most users, and deprecate the old API to help out of tree users pick up
the changes.
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Graeme Gregory <graeme@openmoko.org>
Cc: Frank Mandarino <fmandarino@endrelia.com>
Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Diffstat (limited to 'include')
-rw-r--r-- | include/sound/soc-dapm.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index 1f30616afe71..bf4cf0c1d37f 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -193,6 +193,7 @@ struct snd_soc_dapm_widget; | |||
193 | enum snd_soc_dapm_type; | 193 | enum snd_soc_dapm_type; |
194 | struct snd_soc_dapm_path; | 194 | struct snd_soc_dapm_path; |
195 | struct snd_soc_dapm_pin; | 195 | struct snd_soc_dapm_pin; |
196 | struct snd_soc_dapm_route; | ||
196 | 197 | ||
197 | /* dapm controls */ | 198 | /* dapm controls */ |
198 | int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, | 199 | int snd_soc_dapm_put_volsw(struct snd_kcontrol *kcontrol, |
@@ -210,10 +211,12 @@ int snd_soc_dapm_new_controls(struct snd_soc_codec *codec, | |||
210 | int num); | 211 | int num); |
211 | 212 | ||
212 | /* dapm path setup */ | 213 | /* dapm path setup */ |
213 | int snd_soc_dapm_connect_input(struct snd_soc_codec *codec, | 214 | int __deprecated snd_soc_dapm_connect_input(struct snd_soc_codec *codec, |
214 | const char *sink_name, const char *control_name, const char *src_name); | 215 | const char *sink_name, const char *control_name, const char *src_name); |
215 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); | 216 | int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec); |
216 | void snd_soc_dapm_free(struct snd_soc_device *socdev); | 217 | void snd_soc_dapm_free(struct snd_soc_device *socdev); |
218 | int snd_soc_dapm_add_routes(struct snd_soc_codec *codec, | ||
219 | const struct snd_soc_dapm_route *route, int num); | ||
217 | 220 | ||
218 | /* dapm events */ | 221 | /* dapm events */ |
219 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, | 222 | int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream, |
@@ -250,6 +253,18 @@ enum snd_soc_dapm_type { | |||
250 | snd_soc_dapm_post, /* machine specific post widget - exec last */ | 253 | snd_soc_dapm_post, /* machine specific post widget - exec last */ |
251 | }; | 254 | }; |
252 | 255 | ||
256 | /* | ||
257 | * DAPM audio route definition. | ||
258 | * | ||
259 | * Defines an audio route originating at source via control and finishing | ||
260 | * at sink. | ||
261 | */ | ||
262 | struct snd_soc_dapm_route { | ||
263 | const char *sink; | ||
264 | const char *control; | ||
265 | const char *source; | ||
266 | }; | ||
267 | |||
253 | /* dapm audio path between two widgets */ | 268 | /* dapm audio path between two widgets */ |
254 | struct snd_soc_dapm_path { | 269 | struct snd_soc_dapm_path { |
255 | char *name; | 270 | char *name; |