[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 <[email protected]>
Cc: Graeme Gregory <[email protected]>
Cc: Frank Mandarino <[email protected]>
Cc: Jarkko Nikula <[email protected]>
Cc: Richard Purdie <[email protected]>
Signed-off-by: Takashi Iwai <[email protected]>
Signed-off-by: Jaroslav Kysela <[email protected]>
This commit is contained in:
Mark Brown 2008-05-13 14:52:19 +02:00 • committed by Jaroslav Kysela
commit 105f1c2844
2 changed files with 73 additions and 16 deletions

View file

@ -193,6 +193,7 @@ struct snd_soc_dapm_widget;
enum snd_soc_dapm_type;
struct snd_soc_dapm_path;
struct snd_soc_dapm_pin;
struct snd_soc_dapm_route;
/* dapm controls */
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,
int num);
/* dapm path setup */
int snd_soc_dapm_connect_input(struct snd_soc_codec *codec,
int __deprecated snd_soc_dapm_connect_input(struct snd_soc_codec *codec,
const char *sink_name, const char *control_name, const char *src_name);
int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec);
void snd_soc_dapm_free(struct snd_soc_device *socdev);
int snd_soc_dapm_add_routes(struct snd_soc_codec *codec,
const struct snd_soc_dapm_route *route, int num);
/* dapm events */
int snd_soc_dapm_stream_event(struct snd_soc_codec *codec, char *stream,
@ -250,6 +253,18 @@ enum snd_soc_dapm_type {
snd_soc_dapm_post, /* machine specific post widget - exec last */
};
/*
* DAPM audio route definition.
*
* Defines an audio route originating at source via control and finishing
* at sink.
*/
struct snd_soc_dapm_route {
const char *sink;
const char *control;
const char *source;
};
/* dapm audio path between two widgets */
struct snd_soc_dapm_path {
char *name;