diff options
author | Liam Girdwood <lrg@ti.com> | 2011-07-04 17:10:51 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-07-05 14:07:34 -0400 |
commit | a491a5c84f34febfebd4cb0b8c9add97977efa97 (patch) | |
tree | 9592273ff0d88e02297c63b90d595bfc623e18b6 /sound/soc/soc-core.c | |
parent | 8a27bd9a33187a10c5157434b2274487f6679e49 (diff) |
ASoC: core - Add API call to register platform kcontrols.
In preparation for Dynamic PCM (AKA DSP) support.
Allow platform drivers to register kcontrols.
Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-core.c')
-rw-r--r-- | sound/soc/soc-core.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c index d08abf4e3eb3..16651814ecba 100644 --- a/sound/soc/soc-core.c +++ b/sound/soc/soc-core.c | |||
@@ -1949,6 +1949,36 @@ int snd_soc_add_controls(struct snd_soc_codec *codec, | |||
1949 | EXPORT_SYMBOL_GPL(snd_soc_add_controls); | 1949 | EXPORT_SYMBOL_GPL(snd_soc_add_controls); |
1950 | 1950 | ||
1951 | /** | 1951 | /** |
1952 | * snd_soc_add_platform_controls - add an array of controls to a platform. | ||
1953 | * Convienience function to add a list of controls. | ||
1954 | * | ||
1955 | * @platform: platform to add controls to | ||
1956 | * @controls: array of controls to add | ||
1957 | * @num_controls: number of elements in the array | ||
1958 | * | ||
1959 | * Return 0 for success, else error. | ||
1960 | */ | ||
1961 | int snd_soc_add_platform_controls(struct snd_soc_platform *platform, | ||
1962 | const struct snd_kcontrol_new *controls, int num_controls) | ||
1963 | { | ||
1964 | struct snd_card *card = platform->card->snd_card; | ||
1965 | int err, i; | ||
1966 | |||
1967 | for (i = 0; i < num_controls; i++) { | ||
1968 | const struct snd_kcontrol_new *control = &controls[i]; | ||
1969 | err = snd_ctl_add(card, snd_soc_cnew(control, platform, | ||
1970 | control->name, NULL)); | ||
1971 | if (err < 0) { | ||
1972 | dev_err(platform->dev, "Failed to add %s %d\n",control->name, err); | ||
1973 | return err; | ||
1974 | } | ||
1975 | } | ||
1976 | |||
1977 | return 0; | ||
1978 | } | ||
1979 | EXPORT_SYMBOL_GPL(snd_soc_add_platform_controls); | ||
1980 | |||
1981 | /** | ||
1952 | * snd_soc_info_enum_double - enumerated double mixer info callback | 1982 | * snd_soc_info_enum_double - enumerated double mixer info callback |
1953 | * @kcontrol: mixer control | 1983 | * @kcontrol: mixer control |
1954 | * @uinfo: control element information | 1984 | * @uinfo: control element information |