summaryrefslogtreecommitdiffstats
path: root/sound/soc/pxa
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/pxa')
-rw-r--r--sound/soc/pxa/corgi.c12
-rw-r--r--sound/soc/pxa/palm27x.c13
-rw-r--r--sound/soc/pxa/poodle.c12
-rw-r--r--sound/soc/pxa/spitz.c12
-rw-r--r--sound/soc/pxa/tosa.c12
5 files changed, 25 insertions, 36 deletions
diff --git a/sound/soc/pxa/corgi.c b/sound/soc/pxa/corgi.c
index 146973a..02263e5 100644
--- a/sound/soc/pxa/corgi.c
+++ b/sound/soc/pxa/corgi.c
@@ -276,18 +276,16 @@ static const struct snd_kcontrol_new wm8731_corgi_controls[] = {
*/
static int corgi_wm8731_init(struct snd_soc_codec *codec)
{
- int i, err;
+ int err;
snd_soc_dapm_nc_pin(codec, "LLINEIN");
snd_soc_dapm_nc_pin(codec, "RLINEIN");
/* Add corgi specific controls */
- for (i = 0; i < ARRAY_SIZE(wm8731_corgi_controls); i++) {
- err = snd_ctl_add(codec->card,
- snd_soc_cnew(&wm8731_corgi_controls[i], codec, NULL));
- if (err < 0)
- return err;
- }
+ err = snd_soc_add_controls(codec, wm8731_corgi_controls,
+ ARRAY_SIZE(wm8731_corgi_controls));
+ if (err < 0)
+ return err;
/* Add corgi specific widgets */
snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets,
diff --git a/sound/soc/pxa/palm27x.c b/sound/soc/pxa/palm27x.c
index 29958cd..48a73f6 100644
--- a/sound/soc/pxa/palm27x.c
+++ b/sound/soc/pxa/palm27x.c
@@ -146,19 +146,16 @@ static const struct snd_kcontrol_new palm27x_controls[] = {
static int palm27x_ac97_init(struct snd_soc_codec *codec)
{
- int i, err;
+ int err;
snd_soc_dapm_nc_pin(codec, "OUT3");
snd_soc_dapm_nc_pin(codec, "MONOOUT");
/* add palm27x specific controls */
- for (i = 0; i < ARRAY_SIZE(palm27x_controls); i++) {
- err = snd_ctl_add(codec->card,
- snd_soc_cnew(&palm27x_controls[i],
- codec, NULL));
- if (err < 0)
- return err;
- }
+ err = snd_soc_add_controls(codec, palm27x_controls,
+ ARRAY_SIZE(palm27x_controls));
+ if (err < 0)
+ return err;
/* add palm27x specific widgets */
snd_soc_dapm_new_controls(codec, palm27x_dapm_widgets,
diff --git a/sound/soc/pxa/poodle.c b/sound/soc/pxa/poodle.c
index fb17a0a..ef7c6c8 100644
--- a/sound/soc/pxa/poodle.c
+++ b/sound/soc/pxa/poodle.c
@@ -241,19 +241,17 @@ static const struct snd_kcontrol_new wm8731_poodle_controls[] = {
*/
static int poodle_wm8731_init(struct snd_soc_codec *codec)
{
- int i, err;
+ int err;
snd_soc_dapm_nc_pin(codec, "LLINEIN");
snd_soc_dapm_nc_pin(codec, "RLINEIN");
snd_soc_dapm_enable_pin(codec, "MICIN");
/* Add poodle specific controls */
- for (i = 0; i < ARRAY_SIZE(wm8731_poodle_controls); i++) {
- err = snd_ctl_add(codec->card,
- snd_soc_cnew(&wm8731_poodle_controls[i], codec, NULL));
- if (err < 0)
- return err;
- }
+ err = snd_soc_add_controls(codec, wm8731_poodle_controls,
+ ARRAY_SIZE(wm8731_poodle_controls));
+ if (err < 0)
+ return err;
/* Add poodle specific widgets */
snd_soc_dapm_new_controls(codec, wm8731_dapm_widgets,
diff --git a/sound/soc/pxa/spitz.c b/sound/soc/pxa/spitz.c
index 1aafd8c..6ca9f53 100644
--- a/sound/soc/pxa/spitz.c
+++ b/sound/soc/pxa/spitz.c
@@ -278,7 +278,7 @@ static const struct snd_kcontrol_new wm8750_spitz_controls[] = {
*/
static int spitz_wm8750_init(struct snd_soc_codec *codec)
{
- int i, err;
+ int err;
/* NC codec pins */
snd_soc_dapm_nc_pin(codec, "RINPUT1");
@@ -290,12 +290,10 @@ static int spitz_wm8750_init(struct snd_soc_codec *codec)
snd_soc_dapm_nc_pin(codec, "MONO1");
/* Add spitz specific controls */
- for (i = 0; i < ARRAY_SIZE(wm8750_spitz_controls); i++) {
- err = snd_ctl_add(codec->card,
- snd_soc_cnew(&wm8750_spitz_controls[i], codec, NULL));
- if (err < 0)
- return err;
- }
+ err = snd_soc_add_controls(codec, wm8750_spitz_controls,
+ ARRAY_SIZE(wm8750_spitz_controls));
+ if (err < 0)
+ return err;
/* Add spitz specific widgets */
snd_soc_dapm_new_controls(codec, wm8750_dapm_widgets,
diff --git a/sound/soc/pxa/tosa.c b/sound/soc/pxa/tosa.c
index 09b5bad..fc78137 100644
--- a/sound/soc/pxa/tosa.c
+++ b/sound/soc/pxa/tosa.c
@@ -188,18 +188,16 @@ static const struct snd_kcontrol_new tosa_controls[] = {
static int tosa_ac97_init(struct snd_soc_codec *codec)
{
- int i, err;
+ int err;
snd_soc_dapm_nc_pin(codec, "OUT3");
snd_soc_dapm_nc_pin(codec, "MONOOUT");
/* add tosa specific controls */
- for (i = 0; i < ARRAY_SIZE(tosa_controls); i++) {
- err = snd_ctl_add(codec->card,
- snd_soc_cnew(&tosa_controls[i],codec, NULL));
- if (err < 0)
- return err;
- }
+ err = snd_soc_add_controls(codec, tosa_controls,
+ ARRAY_SIZE(tosa_controls));
+ if (err < 0)
+ return err;
/* add tosa specific widgets */
snd_soc_dapm_new_controls(codec, tosa_dapm_widgets,
OpenPOWER on IntegriCloud