]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
ASoC: core: Add support for DAI and machine kcontrols.
authorLiam Girdwood <lrg@ti.com>
Fri, 3 Feb 2012 17:43:09 +0000 (17:43 +0000)
committerMark Brown <broonie@opensource.wolfsonmicro.com>
Sat, 4 Feb 2012 12:40:11 +0000 (12:40 +0000)
Currently ASoC can only add kcontrols using codec and platform component device
handles. It's also desirable to add kcontrols for DAIs (i.e. McBSP) and for
SoC card machine drivers too. This allows the kcontrol to have a direct handle to
the parent ASoC component DAI/SoC Card/Platform/Codec device and hence easily
get it's private data.

This change makes snd_soc_add_controls() static and wraps it in the folowing
calls (card and dai are new) :-

snd_soc_add_card_controls()
snd_soc_add_codec_controls()
snd_soc_add_dai_controls()
snd_soc_add_platform_controls()

This patch also does a lot of small mechanical changes in individual codec drivers
to replace snd_soc_add_controls() with snd_soc_add_codec_controls().

It also updates the McBSP DAI driver to use snd_soc_add_dai_controls().

Finally, it updates the existing machine drivers that register controls to either :-

1) Use snd_soc_add_card_controls() where no direct codec control is required.
2) Use snd_soc_add_codec_controls() where there is direct codec control.

In the case of 1) above we also update the machine drivers to get the correct
component data pointers from the kcontrol (rather than getting the machine pointer
via the codec pointer).

Signed-off-by: Liam Girdwood <lrg@ti.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
60 files changed:
include/sound/soc.h
sound/soc/codecs/ad1836.c
sound/soc/codecs/ad1980.c
sound/soc/codecs/adau1373.c
sound/soc/codecs/ak4535.c
sound/soc/codecs/ak4642.c
sound/soc/codecs/ak4671.c
sound/soc/codecs/alc5623.c
sound/soc/codecs/alc5632.c
sound/soc/codecs/cq93vc.c
sound/soc/codecs/cs4270.c
sound/soc/codecs/cs4271.c
sound/soc/codecs/lm4857.c
sound/soc/codecs/max98088.c
sound/soc/codecs/max98095.c
sound/soc/codecs/max9877.c
sound/soc/codecs/sn95031.c
sound/soc/codecs/ssm2602.c
sound/soc/codecs/stac9766.c
sound/soc/codecs/tlv320aic23.c
sound/soc/codecs/tlv320aic26.c
sound/soc/codecs/tlv320aic32x4.c
sound/soc/codecs/tlv320aic3x.c
sound/soc/codecs/tlv320dac33.c
sound/soc/codecs/tpa6130a2.c
sound/soc/codecs/uda134x.c
sound/soc/codecs/wl1273.c
sound/soc/codecs/wm8737.c
sound/soc/codecs/wm8770.c
sound/soc/codecs/wm8904.c
sound/soc/codecs/wm8940.c
sound/soc/codecs/wm8958-dsp2.c
sound/soc/codecs/wm8960.c
sound/soc/codecs/wm8961.c
sound/soc/codecs/wm8962.c
sound/soc/codecs/wm8990.c
sound/soc/codecs/wm8991.c
sound/soc/codecs/wm8993.c
sound/soc/codecs/wm8994.c
sound/soc/codecs/wm8995.c
sound/soc/codecs/wm8996.c
sound/soc/codecs/wm9081.c
sound/soc/codecs/wm9090.c
sound/soc/codecs/wm9705.c
sound/soc/codecs/wm9712.c
sound/soc/codecs/wm9713.c
sound/soc/codecs/wm_hubs.c
sound/soc/mid-x86/mfld_machine.c
sound/soc/omap/ams-delta.c
sound/soc/omap/n810.c
sound/soc/omap/omap-mcbsp.c
sound/soc/omap/omap-mcbsp.h
sound/soc/omap/rx51.c
sound/soc/pxa/corgi.c
sound/soc/pxa/magician.c
sound/soc/pxa/poodle.c
sound/soc/pxa/tosa.c
sound/soc/samsung/neo1973_wm8753.c
sound/soc/samsung/s3c24xx_simtec.c
sound/soc/soc-core.c

index 2f687edd4fde4eab517ab27bbc8191d030853a10..9348bed86b1e5cbe58ecbb89475fed7b90ed6c68 100644 (file)
@@ -368,10 +368,14 @@ void snd_soc_free_ac97_codec(struct snd_soc_codec *codec);
 struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
                                  void *data, char *long_name,
                                  const char *prefix);
-int snd_soc_add_controls(struct snd_soc_codec *codec,
+int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
        const struct snd_kcontrol_new *controls, int num_controls);
 int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
        const struct snd_kcontrol_new *controls, int num_controls);
+int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
+       const struct snd_kcontrol_new *controls, int num_controls);
+int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
+       const struct snd_kcontrol_new *controls, int num_controls);
 int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_info *uinfo);
 int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
index 982d201c2e8699589ab049544e517d2f69db3678..12e3b4118557388b5cbb1a62fc0dea3264ba082f 100644 (file)
@@ -277,7 +277,7 @@ static int ad1836_probe(struct snd_soc_codec *codec)
        if (ad1836->type == AD1836) {
                /* left/right diff:PGA/MUX */
                snd_soc_write(codec, AD1836_ADC_CTRL3, 0x3A);
-               ret = snd_soc_add_controls(codec, ad1836_controls,
+               ret = snd_soc_add_codec_controls(codec, ad1836_controls,
                                ARRAY_SIZE(ad1836_controls));
                if (ret)
                        return ret;
@@ -285,11 +285,11 @@ static int ad1836_probe(struct snd_soc_codec *codec)
                snd_soc_write(codec, AD1836_ADC_CTRL3, 0x00);
        }
 
-       ret = snd_soc_add_controls(codec, ad183x_dac_controls, num_dacs * 2);
+       ret = snd_soc_add_codec_controls(codec, ad183x_dac_controls, num_dacs * 2);
        if (ret)
                return ret;
 
-       ret = snd_soc_add_controls(codec, ad183x_adc_controls, num_adcs);
+       ret = snd_soc_add_codec_controls(codec, ad183x_adc_controls, num_adcs);
        if (ret)
                return ret;
 
index 9bba7f849464391778e5c33f0076c0e20b3ea44f..8c39dddd7d0063d90adcf587c5e6dc19c37f73ad 100644 (file)
@@ -228,7 +228,7 @@ static int ad1980_soc_probe(struct snd_soc_codec *codec)
        ext_status = ac97_read(codec, AC97_EXTENDED_STATUS);
        ac97_write(codec, AC97_EXTENDED_STATUS, ext_status&~0x3800);
 
-       snd_soc_add_controls(codec, ad1980_snd_ac97_controls,
+       snd_soc_add_codec_controls(codec, ad1980_snd_ac97_controls,
                                ARRAY_SIZE(ad1980_snd_ac97_controls));
 
        return 0;
index facda33db1c06c8848a8db29fa450a52b9ec17b6..44f59064d8de11247187a8d124661361e7913e65 100644 (file)
@@ -1257,7 +1257,7 @@ static int adau1373_probe(struct snd_soc_codec *codec)
                                pdata->drc_setting[i]);
                }
 
-               snd_soc_add_controls(codec, adau1373_drc_controls,
+               snd_soc_add_codec_controls(codec, adau1373_drc_controls,
                        pdata->num_drc);
 
                val = 0;
@@ -1282,7 +1282,7 @@ static int adau1373_probe(struct snd_soc_codec *codec)
        }
 
        if (!lineout_differential) {
-               snd_soc_add_controls(codec, adau1373_lineout2_controls,
+               snd_soc_add_codec_controls(codec, adau1373_lineout2_controls,
                        ARRAY_SIZE(adau1373_lineout2_controls));
        }
 
index 9e809e05d06644aa52fb11bf4ad96867c5c63aef..dd15516763ed9450242cf678000815a1111e1e36 100644 (file)
@@ -382,7 +382,7 @@ static int ak4535_probe(struct snd_soc_codec *codec)
        /* power on device */
        ak4535_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
-       snd_soc_add_controls(codec, ak4535_snd_controls,
+       snd_soc_add_codec_controls(codec, ak4535_snd_controls,
                                ARRAY_SIZE(ak4535_snd_controls));
        return 0;
 }
index 5ef70b5d27e4eae85f6e4e1a1c310ea273e0eb60..16bd1e7d2384f8115b2bf2f02c19ceb4143d9ee1 100644 (file)
@@ -476,7 +476,7 @@ static int ak4642_probe(struct snd_soc_codec *codec)
                return ret;
        }
 
-       snd_soc_add_controls(codec, ak4642_snd_controls,
+       snd_soc_add_codec_controls(codec, ak4642_snd_controls,
                             ARRAY_SIZE(ak4642_snd_controls));
 
        ak4642_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
index a53b152e6a07a529fc4e1298fc33bc4ccb3abdb2..5fb7c2a80e6daa5e8e68948a09b95a852fba778e 100644 (file)
@@ -628,7 +628,7 @@ static int ak4671_probe(struct snd_soc_codec *codec)
                return ret;
        }
 
-       snd_soc_add_controls(codec, ak4671_snd_controls,
+       snd_soc_add_codec_controls(codec, ak4671_snd_controls,
                             ARRAY_SIZE(ak4671_snd_controls));
 
        ak4671_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
index 08f24198c8dafc8d5dfffd9e8ff29c5b068b02d0..d47b62ddb210dbf68b5eeb4b4e0dc4abadc5556d 100644 (file)
@@ -925,22 +925,22 @@ static int alc5623_probe(struct snd_soc_codec *codec)
 
        switch (alc5623->id) {
        case 0x21:
-               snd_soc_add_controls(codec, alc5621_vol_snd_controls,
+               snd_soc_add_codec_controls(codec, alc5621_vol_snd_controls,
                        ARRAY_SIZE(alc5621_vol_snd_controls));
                break;
        case 0x22:
-               snd_soc_add_controls(codec, alc5622_vol_snd_controls,
+               snd_soc_add_codec_controls(codec, alc5622_vol_snd_controls,
                        ARRAY_SIZE(alc5622_vol_snd_controls));
                break;
        case 0x23:
-               snd_soc_add_controls(codec, alc5623_vol_snd_controls,
+               snd_soc_add_codec_controls(codec, alc5623_vol_snd_controls,
                        ARRAY_SIZE(alc5623_vol_snd_controls));
                break;
        default:
                return -EINVAL;
        }
 
-       snd_soc_add_controls(codec, alc5623_snd_controls,
+       snd_soc_add_codec_controls(codec, alc5623_snd_controls,
                        ARRAY_SIZE(alc5623_snd_controls));
 
        snd_soc_dapm_new_controls(dapm, alc5623_dapm_widgets,
index af9c27ae02f0834b3c06ec30e38cdbe1875db5cf..f69fb426ad0a650bd48de2252407aa171e3d5838 100644 (file)
@@ -994,7 +994,7 @@ static int alc5632_probe(struct snd_soc_codec *codec)
 
        switch (alc5632->id) {
        case 0x5c:
-               snd_soc_add_controls(codec, alc5632_vol_snd_controls,
+               snd_soc_add_codec_controls(codec, alc5632_vol_snd_controls,
                        ARRAY_SIZE(alc5632_vol_snd_controls));
                break;
        default:
index 06d2ea18a54caf7c1936925682f072062b8d404d..064cd6a935163ebf4fa0619b80f67154e1733528 100644 (file)
@@ -157,7 +157,7 @@ static int cq93vc_probe(struct snd_soc_codec *codec)
        codec->control_data = davinci_vc;
 
        /* Set controls */
-       snd_soc_add_controls(codec, cq93vc_snd_controls,
+       snd_soc_add_codec_controls(codec, cq93vc_snd_controls,
                             ARRAY_SIZE(cq93vc_snd_controls));
 
        /* Off, with power on */
index 055536645da917e15308cd4abb17d13f2a43bf67..6baccd285df1dd3eefd351e4eb39964405d47869 100644 (file)
@@ -521,7 +521,7 @@ static int cs4270_probe(struct snd_soc_codec *codec)
        }
 
        /* Add the non-DAPM controls */
-       ret = snd_soc_add_controls(codec, cs4270_snd_controls,
+       ret = snd_soc_add_codec_controls(codec, cs4270_snd_controls,
                                ARRAY_SIZE(cs4270_snd_controls));
        if (ret < 0) {
                dev_err(codec->dev, "failed to add controls\n");
index f6fe846b6a6c3d76f8778140261c96b0ed7a65eb..bf7141280a747ab25b311c083b06b82bc8e7ad9e 100644 (file)
@@ -513,7 +513,7 @@ static int cs4271_probe(struct snd_soc_codec *codec)
        /* Power-up sequence requires 85 uS */
        udelay(85);
 
-       return snd_soc_add_controls(codec, cs4271_snd_controls,
+       return snd_soc_add_codec_controls(codec, cs4271_snd_controls,
                ARRAY_SIZE(cs4271_snd_controls));
 }
 
index 319039240e0fafe25412110e81fc548b011df072..ba4fafb93e5624d2aff10f6e20cf81ad34066ea9 100644 (file)
@@ -179,7 +179,7 @@ static int lm4857_probe(struct snd_soc_codec *codec)
 
        codec->control_data = lm4857->i2c;
 
-       ret = snd_soc_add_controls(codec, lm4857_controls,
+       ret = snd_soc_add_codec_controls(codec, lm4857_controls,
                        ARRAY_SIZE(lm4857_controls));
        if (ret)
                return ret;
index 006efcfe6dda84b486330bb79cdb0d36b8389efe..af7324b79dd0a8c8ae900277a7bf4abf2a98995a 100644 (file)
@@ -1908,7 +1908,7 @@ static void max98088_handle_eq_pdata(struct snd_soc_codec *codec)
        max98088->eq_enum.texts = max98088->eq_texts;
        max98088->eq_enum.max = max98088->eq_textcnt;
 
-       ret = snd_soc_add_controls(codec, controls, ARRAY_SIZE(controls));
+       ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
        if (ret != 0)
                dev_err(codec->dev, "Failed to add EQ control: %d\n", ret);
 }
@@ -2030,7 +2030,7 @@ static int max98088_probe(struct snd_soc_codec *codec)
 
        max98088_handle_pdata(codec);
 
-       snd_soc_add_controls(codec, max98088_snd_controls,
+       snd_soc_add_codec_controls(codec, max98088_snd_controls,
                             ARRAY_SIZE(max98088_snd_controls));
 
 err_access:
index fcfa7497d7b74aac4777def9e7b7d186ec7c58ef..0bb511a0388de84cfec32f1794dd0a77be63ba1d 100644 (file)
@@ -1284,7 +1284,7 @@ static const struct snd_soc_dapm_route max98095_audio_map[] = {
 
 static int max98095_add_widgets(struct snd_soc_codec *codec)
 {
-       snd_soc_add_controls(codec, max98095_snd_controls,
+       snd_soc_add_codec_controls(codec, max98095_snd_controls,
                             ARRAY_SIZE(max98095_snd_controls));
 
        return 0;
@@ -1984,7 +1984,7 @@ static void max98095_handle_eq_pdata(struct snd_soc_codec *codec)
        max98095->eq_enum.texts = max98095->eq_texts;
        max98095->eq_enum.max = max98095->eq_textcnt;
 
-       ret = snd_soc_add_controls(codec, controls, ARRAY_SIZE(controls));
+       ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
        if (ret != 0)
                dev_err(codec->dev, "Failed to add EQ control: %d\n", ret);
 }
@@ -2139,7 +2139,7 @@ static void max98095_handle_bq_pdata(struct snd_soc_codec *codec)
        max98095->bq_enum.texts = max98095->bq_texts;
        max98095->bq_enum.max = max98095->bq_textcnt;
 
-       ret = snd_soc_add_controls(codec, controls, ARRAY_SIZE(controls));
+       ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
        if (ret != 0)
                dev_err(codec->dev, "Failed to add Biquad control: %d\n", ret);
 }
index dcf6f2a1600ae5726a60d0a7e11ef6e53d57d466..3a2ba3d8fd6de13ec21f8e5b6ed67df85af77256 100644 (file)
@@ -253,7 +253,7 @@ static const struct snd_kcontrol_new max9877_controls[] = {
 /* This function is called from ASoC machine driver */
 int max9877_add_controls(struct snd_soc_codec *codec)
 {
-       return snd_soc_add_controls(codec, max9877_controls,
+       return snd_soc_add_codec_controls(codec, max9877_controls,
                        ARRAY_SIZE(max9877_controls));
 }
 EXPORT_SYMBOL_GPL(max9877_add_controls);
index aa0392360da9fa4fbb4ca701861ee41926a87e23..50dbdb9357ead627961f08a170d8430b99faca07 100644 (file)
@@ -869,7 +869,7 @@ static int sn95031_codec_probe(struct snd_soc_codec *codec)
        snd_soc_write(codec, SN95031_SSR2, 0x10);
        snd_soc_write(codec, SN95031_SSR3, 0x40);
 
-       snd_soc_add_controls(codec, sn95031_snd_controls,
+       snd_soc_add_codec_controls(codec, sn95031_snd_controls,
                             ARRAY_SIZE(sn95031_snd_controls));
 
        return 0;
index 333dd98af39ce538868d706a2281f2e7514152ab..de2b20544ceb01cb8ecbecaae507d6b33826e53f 100644 (file)
@@ -548,7 +548,7 @@ static int ssm2602_probe(struct snd_soc_codec *codec)
        snd_soc_update_bits(codec, SSM2602_ROUT1V,
                            ROUT1V_RLHP_BOTH, ROUT1V_RLHP_BOTH);
 
-       ret = snd_soc_add_controls(codec, ssm2602_snd_controls,
+       ret = snd_soc_add_codec_controls(codec, ssm2602_snd_controls,
                        ARRAY_SIZE(ssm2602_snd_controls));
        if (ret)
                return ret;
index cc0566c22ec12ecfcf3f67d486b6330fea448f47..982e437799a8e62aa8085a9d5b509fa4d8f8a387 100644 (file)
@@ -355,7 +355,7 @@ static int stac9766_codec_probe(struct snd_soc_codec *codec)
 
        stac9766_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
-       snd_soc_add_controls(codec, stac9766_snd_ac97_controls,
+       snd_soc_add_codec_controls(codec, stac9766_snd_ac97_controls,
                             ARRAY_SIZE(stac9766_snd_ac97_controls));
 
        return 0;
index dfa41a96599b8c61884c04392c6a878e7e715372..16d55f91a6535e088dff5999ee9bae408999dd7e 100644 (file)
@@ -593,7 +593,7 @@ static int tlv320aic23_probe(struct snd_soc_codec *codec)
 
        snd_soc_write(codec, TLV320AIC23_ACTIVE, 0x1);
 
-       snd_soc_add_controls(codec, tlv320aic23_snd_controls,
+       snd_soc_add_codec_controls(codec, tlv320aic23_snd_controls,
                                ARRAY_SIZE(tlv320aic23_snd_controls));
 
        return 0;
index a038daec682bfba9dd6997b9acfbb4e0c4855ca2..802064b5030d0b910736ae05d5365941a9d0b74c 100644 (file)
@@ -389,7 +389,7 @@ static int aic26_probe(struct snd_soc_codec *codec)
 
        /* register controls */
        dev_dbg(codec->dev, "Registering controls\n");
-       err = snd_soc_add_controls(codec, aic26_snd_controls,
+       err = snd_soc_add_codec_controls(codec, aic26_snd_controls,
                        ARRAY_SIZE(aic26_snd_controls));
        WARN_ON(err < 0);
 
index 372b0b83bd9f191c104dd18dcff3a7756021f1dc..b0a73d37ed52b4dfb52fb97a367e03f37a6df291 100644 (file)
@@ -671,7 +671,7 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
        }
 
        aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-       snd_soc_add_controls(codec, aic32x4_snd_controls,
+       snd_soc_add_codec_controls(codec, aic32x4_snd_controls,
                             ARRAY_SIZE(aic32x4_snd_controls));
        aic32x4_add_widgets(codec);
 
index 285b7a22dc1042eb10eb53f0b4415c6ed72ce634..0bb7cb8815c835ae6a9867a33373955e4add6c7a 100644 (file)
@@ -1425,10 +1425,10 @@ static int aic3x_probe(struct snd_soc_codec *codec)
                              (aic3x->setup->gpio_func[1] & 0xf) << 4);
        }
 
-       snd_soc_add_controls(codec, aic3x_snd_controls,
+       snd_soc_add_codec_controls(codec, aic3x_snd_controls,
                             ARRAY_SIZE(aic3x_snd_controls));
        if (aic3x->model == AIC3X_MODEL_3007)
-               snd_soc_add_controls(codec, &aic3x_classd_amp_gain_ctrl, 1);
+               snd_soc_add_codec_controls(codec, &aic3x_classd_amp_gain_ctrl, 1);
 
        aic3x_add_widgets(codec);
        list_add(&aic3x->list, &reset_list);
index 2c957c8457099217324f6b7c394b91d654236374..4587ddd0fbf8c2e30fa01600dcbd17aed9545e90 100644 (file)
@@ -1437,7 +1437,7 @@ static int dac33_soc_probe(struct snd_soc_codec *codec)
 
        /* Only add the FIFO controls, if we have valid IRQ number */
        if (dac33->irq >= 0)
-               snd_soc_add_controls(codec, dac33_mode_snd_controls,
+               snd_soc_add_codec_controls(codec, dac33_mode_snd_controls,
                                     ARRAY_SIZE(dac33_mode_snd_controls));
 
 err_power:
index 363b99dad8e9539e09cc29134e7d215243dddbc8..6fe4aa3ac54401da4210df65ead54e0a1fe537b2 100644 (file)
@@ -351,10 +351,10 @@ int tpa6130a2_add_controls(struct snd_soc_codec *codec)
        data = i2c_get_clientdata(tpa6130a2_client);
 
        if (data->id == TPA6140A2)
-               return snd_soc_add_controls(codec, tpa6140a2_controls,
+               return snd_soc_add_codec_controls(codec, tpa6140a2_controls,
                                                ARRAY_SIZE(tpa6140a2_controls));
        else
-               return snd_soc_add_controls(codec, tpa6130a2_controls,
+               return snd_soc_add_codec_controls(codec, tpa6130a2_controls,
                                                ARRAY_SIZE(tpa6130a2_controls));
 }
 EXPORT_SYMBOL_GPL(tpa6130a2_add_controls);
index 8f4f469d64115cb52ae8c58fd60fcc78d9669e50..797b0dde2c68620910a5870f7e341731aaf3380b 100644 (file)
@@ -531,15 +531,15 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec)
        switch (pd->model) {
        case UDA134X_UDA1340:
        case UDA134X_UDA1344:
-               ret = snd_soc_add_controls(codec, uda1340_snd_controls,
+               ret = snd_soc_add_codec_controls(codec, uda1340_snd_controls,
                                        ARRAY_SIZE(uda1340_snd_controls));
        break;
        case UDA134X_UDA1341:
-               ret = snd_soc_add_controls(codec, uda1341_snd_controls,
+               ret = snd_soc_add_codec_controls(codec, uda1341_snd_controls,
                                        ARRAY_SIZE(uda1341_snd_controls));
        break;
        case UDA134X_UDA1345:
-               ret = snd_soc_add_controls(codec, uda1345_snd_controls,
+               ret = snd_soc_add_codec_controls(codec, uda1345_snd_controls,
                                        ARRAY_SIZE(uda1345_snd_controls));
        break;
        default:
index 44aacf927ba99d6a533524b39859eac9d565c265..3d868dc400921cc22d21ef1ede114fb643dcd6e1 100644 (file)
@@ -464,7 +464,7 @@ static int wl1273_probe(struct snd_soc_codec *codec)
 
        snd_soc_codec_set_drvdata(codec, wl1273);
 
-       r = snd_soc_add_controls(codec, wl1273_controls,
+       r = snd_soc_add_codec_controls(codec, wl1273_controls,
                                 ARRAY_SIZE(wl1273_controls));
        if (r)
                kfree(wl1273);
index ff95e62c56b9a7ae211c3f2d508d9cff94132931..4fe9d191e2774ab7fad2e00a5ba7542b51580669 100644 (file)
@@ -599,7 +599,7 @@ static int wm8737_probe(struct snd_soc_codec *codec)
        /* Bias level configuration will have done an extra enable */
        regulator_bulk_disable(ARRAY_SIZE(wm8737->supplies), wm8737->supplies);
 
-       snd_soc_add_controls(codec, wm8737_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8737_snd_controls,
                             ARRAY_SIZE(wm8737_snd_controls));
        wm8737_add_widgets(codec);
 
index bd60f847762c906eb6e6943e745c998b26876a4f..a5127b4ff9e1881dd49b5d588d3cd354d33cc746 100644 (file)
@@ -641,7 +641,7 @@ static int wm8770_probe(struct snd_soc_codec *codec)
        /* mute all DACs */
        snd_soc_update_bits(codec, WM8770_DACMUTE, 0x10, 0x10);
 
-       snd_soc_add_controls(codec, wm8770_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8770_snd_controls,
                             ARRAY_SIZE(wm8770_snd_controls));
        snd_soc_dapm_new_controls(&codec->dapm, wm8770_dapm_widgets,
                                  ARRAY_SIZE(wm8770_dapm_widgets));
index 37079eace412eee6f6fefbc83f58e81f6ce95ed2..65d525d74c549ee9d83bbb1f1ca0a982a103a567 100644 (file)
@@ -1176,11 +1176,11 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)
 
        switch (wm8904->devtype) {
        case WM8904:
-               snd_soc_add_controls(codec, wm8904_adc_snd_controls,
+               snd_soc_add_codec_controls(codec, wm8904_adc_snd_controls,
                                     ARRAY_SIZE(wm8904_adc_snd_controls));
-               snd_soc_add_controls(codec, wm8904_dac_snd_controls,
+               snd_soc_add_codec_controls(codec, wm8904_dac_snd_controls,
                                     ARRAY_SIZE(wm8904_dac_snd_controls));
-               snd_soc_add_controls(codec, wm8904_snd_controls,
+               snd_soc_add_codec_controls(codec, wm8904_snd_controls,
                                     ARRAY_SIZE(wm8904_snd_controls));
 
                snd_soc_dapm_new_controls(dapm, wm8904_adc_dapm_widgets,
@@ -1201,7 +1201,7 @@ static int wm8904_add_widgets(struct snd_soc_codec *codec)
                break;
 
        case WM8912:
-               snd_soc_add_controls(codec, wm8904_dac_snd_controls,
+               snd_soc_add_codec_controls(codec, wm8904_dac_snd_controls,
                                     ARRAY_SIZE(wm8904_dac_snd_controls));
 
                snd_soc_dapm_new_controls(dapm, wm8904_dac_dapm_widgets,
@@ -2020,7 +2020,7 @@ static void wm8904_handle_retune_mobile_pdata(struct snd_soc_codec *codec)
        wm8904->retune_mobile_enum.max = wm8904->num_retune_mobile_texts;
        wm8904->retune_mobile_enum.texts = wm8904->retune_mobile_texts;
 
-       ret = snd_soc_add_controls(codec, &control, 1);
+       ret = snd_soc_add_codec_controls(codec, &control, 1);
        if (ret != 0)
                dev_err(codec->dev,
                        "Failed to add ReTune Mobile control: %d\n", ret);
@@ -2033,7 +2033,7 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
        int ret, i;
 
        if (!pdata) {
-               snd_soc_add_controls(codec, wm8904_eq_controls,
+               snd_soc_add_codec_controls(codec, wm8904_eq_controls,
                                     ARRAY_SIZE(wm8904_eq_controls));
                return;
        }
@@ -2061,7 +2061,7 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
                wm8904->drc_enum.max = pdata->num_drc_cfgs;
                wm8904->drc_enum.texts = wm8904->drc_texts;
 
-               ret = snd_soc_add_controls(codec, &control, 1);
+               ret = snd_soc_add_codec_controls(codec, &control, 1);
                if (ret != 0)
                        dev_err(codec->dev,
                                "Failed to add DRC mode control: %d\n", ret);
@@ -2075,7 +2075,7 @@ static void wm8904_handle_pdata(struct snd_soc_codec *codec)
        if (pdata->num_retune_mobile_cfgs)
                wm8904_handle_retune_mobile_pdata(codec);
        else
-               snd_soc_add_controls(codec, wm8904_eq_controls,
+               snd_soc_add_codec_controls(codec, wm8904_eq_controls,
                                     ARRAY_SIZE(wm8904_eq_controls));
 }
 
index ae1933ed3e071a75b194ec6428ebb9372584dea4..d2883affea3b2421508c474732d3fdf92192bdb2 100644 (file)
@@ -717,7 +717,7 @@ static int wm8940_probe(struct snd_soc_codec *codec)
                        return ret;
        }
 
-       ret = snd_soc_add_controls(codec, wm8940_snd_controls,
+       ret = snd_soc_add_codec_controls(codec, wm8940_snd_controls,
                             ARRAY_SIZE(wm8940_snd_controls));
        if (ret)
                return ret;
index 40ac888faf3d7633f433257ab96e2f190d6f4174..1332692ef81bc9628e8cad04ccf65cd972c7fb8c 100644 (file)
@@ -920,11 +920,11 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
 
        wm8994->dsp_active = -1;
 
-       snd_soc_add_controls(codec, wm8958_mbc_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8958_mbc_snd_controls,
                             ARRAY_SIZE(wm8958_mbc_snd_controls));
-       snd_soc_add_controls(codec, wm8958_vss_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8958_vss_snd_controls,
                             ARRAY_SIZE(wm8958_vss_snd_controls));
-       snd_soc_add_controls(codec, wm8958_enh_eq_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8958_enh_eq_snd_controls,
                             ARRAY_SIZE(wm8958_enh_eq_snd_controls));
 
 
@@ -958,7 +958,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
                wm8994->mbc_enum.max = pdata->num_mbc_cfgs;
                wm8994->mbc_enum.texts = wm8994->mbc_texts;
 
-               ret = snd_soc_add_controls(wm8994->codec, control, 1);
+               ret = snd_soc_add_codec_controls(wm8994->codec, control, 1);
                if (ret != 0)
                        dev_err(wm8994->codec->dev,
                                "Failed to add MBC mode controls: %d\n", ret);
@@ -986,7 +986,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
                wm8994->vss_enum.max = pdata->num_vss_cfgs;
                wm8994->vss_enum.texts = wm8994->vss_texts;
 
-               ret = snd_soc_add_controls(wm8994->codec, control, 1);
+               ret = snd_soc_add_codec_controls(wm8994->codec, control, 1);
                if (ret != 0)
                        dev_err(wm8994->codec->dev,
                                "Failed to add VSS mode controls: %d\n", ret);
@@ -1015,7 +1015,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
                wm8994->vss_hpf_enum.max = pdata->num_vss_hpf_cfgs;
                wm8994->vss_hpf_enum.texts = wm8994->vss_hpf_texts;
 
-               ret = snd_soc_add_controls(wm8994->codec, control, 1);
+               ret = snd_soc_add_codec_controls(wm8994->codec, control, 1);
                if (ret != 0)
                        dev_err(wm8994->codec->dev,
                                "Failed to add VSS HPFmode controls: %d\n",
@@ -1045,7 +1045,7 @@ void wm8958_dsp2_init(struct snd_soc_codec *codec)
                wm8994->enh_eq_enum.max = pdata->num_enh_eq_cfgs;
                wm8994->enh_eq_enum.texts = wm8994->enh_eq_texts;
 
-               ret = snd_soc_add_controls(wm8994->codec, control, 1);
+               ret = snd_soc_add_codec_controls(wm8994->codec, control, 1);
                if (ret != 0)
                        dev_err(wm8994->codec->dev,
                                "Failed to add enhanced EQ controls: %d\n",
index e5caae32e5419a695f0533b833fb3d719ccbbf4c..840d72086d04c7c3cf8dcf7d813c9a4f8ee149d7 100644 (file)
@@ -940,7 +940,7 @@ static int wm8960_probe(struct snd_soc_codec *codec)
        snd_soc_update_bits(codec, WM8960_LOUT2, 0x100, 0x100);
        snd_soc_update_bits(codec, WM8960_ROUT2, 0x100, 0x100);
 
-       snd_soc_add_controls(codec, wm8960_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8960_snd_controls,
                                     ARRAY_SIZE(wm8960_snd_controls));
        wm8960_add_widgets(codec);
 
index 4f20c72a0f1d329a824ee2255f6003ef741c07da..05ea7c2740933b0ff4b2cbfedc3be54515670fa8 100644 (file)
@@ -1022,7 +1022,7 @@ static int wm8961_probe(struct snd_soc_codec *codec)
 
        wm8961_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
 
-       snd_soc_add_controls(codec, wm8961_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8961_snd_controls,
                                ARRAY_SIZE(wm8961_snd_controls));
        snd_soc_dapm_new_controls(dapm, wm8961_dapm_widgets,
                                  ARRAY_SIZE(wm8961_dapm_widgets));
index b6fcdcc4341efe0b483c92c3267705f39be46407..25b6baed3a29003459329f8e0c68902c555d1b3f 100644 (file)
@@ -2405,13 +2405,13 @@ static int wm8962_add_widgets(struct snd_soc_codec *codec)
        struct wm8962_pdata *pdata = dev_get_platdata(codec->dev);
        struct snd_soc_dapm_context *dapm = &codec->dapm;
 
-       snd_soc_add_controls(codec, wm8962_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8962_snd_controls,
                             ARRAY_SIZE(wm8962_snd_controls));
        if (pdata && pdata->spk_mono)
-               snd_soc_add_controls(codec, wm8962_spk_mono_controls,
+               snd_soc_add_codec_controls(codec, wm8962_spk_mono_controls,
                                     ARRAY_SIZE(wm8962_spk_mono_controls));
        else
-               snd_soc_add_controls(codec, wm8962_spk_stereo_controls,
+               snd_soc_add_codec_controls(codec, wm8962_spk_stereo_controls,
                                     ARRAY_SIZE(wm8962_spk_stereo_controls));
 
 
index e538edaae1f0dbd6d9cdd82f34bb8bc232b7b549..9d242351e6e837211c70ffb37033874830ccb8b3 100644 (file)
@@ -1356,7 +1356,7 @@ static int wm8990_probe(struct snd_soc_codec *codec)
        snd_soc_write(codec, WM8990_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8));
        snd_soc_write(codec, WM8990_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8));
 
-       snd_soc_add_controls(codec, wm8990_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8990_snd_controls,
                                ARRAY_SIZE(wm8990_snd_controls));
        wm8990_add_widgets(codec);
 
index 7ee40da8dbb52021db9427ec84f7b2751236b7d5..9ac31ba9b82e1ad635167baa38563da16d1e6ee2 100644 (file)
@@ -1297,7 +1297,7 @@ static int wm8991_probe(struct snd_soc_codec *codec)
        snd_soc_write(codec, WM8991_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8));
        snd_soc_write(codec, WM8991_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8));
 
-       snd_soc_add_controls(codec, wm8991_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8991_snd_controls,
                             ARRAY_SIZE(wm8991_snd_controls));
 
        snd_soc_dapm_new_controls(&codec->dapm, wm8991_dapm_widgets,
index db51007a6a436d01d96e17e9010e260b0ea3b13b..f814d2711b5592c6000fa09fa63a7e5128ca713e 100644 (file)
@@ -1604,13 +1604,13 @@ static int wm8993_probe(struct snd_soc_codec *codec)
        if (ret != 0)
                return ret;
 
-       snd_soc_add_controls(codec, wm8993_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8993_snd_controls,
                             ARRAY_SIZE(wm8993_snd_controls));
        if (wm8993->pdata.num_retune_configs != 0) {
                dev_dbg(codec->dev, "Using ReTune Mobile\n");
        } else {
                dev_dbg(codec->dev, "No ReTune Mobile, using normal EQ\n");
-               snd_soc_add_controls(codec, wm8993_eq_controls,
+               snd_soc_add_codec_controls(codec, wm8993_eq_controls,
                                     ARRAY_SIZE(wm8993_eq_controls));
        }
 
index c26291844e5d33fb827bdddc1cfa0a459805a705..8ae6585edbe0ce518d2228c8d2b7f7db75ac32ee 100644 (file)
@@ -2867,7 +2867,7 @@ static void wm8994_handle_retune_mobile_pdata(struct wm8994_priv *wm8994)
        wm8994->retune_mobile_enum.max = wm8994->num_retune_mobile_texts;
        wm8994->retune_mobile_enum.texts = wm8994->retune_mobile_texts;
 
-       ret = snd_soc_add_controls(wm8994->codec, controls,
+       ret = snd_soc_add_codec_controls(wm8994->codec, controls,
                                   ARRAY_SIZE(controls));
        if (ret != 0)
                dev_err(wm8994->codec->dev,
@@ -2920,7 +2920,7 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
                wm8994->drc_enum.max = pdata->num_drc_cfgs;
                wm8994->drc_enum.texts = wm8994->drc_texts;
 
-               ret = snd_soc_add_controls(wm8994->codec, controls,
+               ret = snd_soc_add_codec_controls(wm8994->codec, controls,
                                           ARRAY_SIZE(controls));
                if (ret != 0)
                        dev_err(wm8994->codec->dev,
@@ -2936,7 +2936,7 @@ static void wm8994_handle_pdata(struct wm8994_priv *wm8994)
        if (pdata->num_retune_mobile_cfgs)
                wm8994_handle_retune_mobile_pdata(wm8994);
        else
-               snd_soc_add_controls(wm8994->codec, wm8994_eq_controls,
+               snd_soc_add_codec_controls(wm8994->codec, wm8994_eq_controls,
                                     ARRAY_SIZE(wm8994_eq_controls));
 
        for (i = 0; i < ARRAY_SIZE(pdata->micbias); i++) {
@@ -3652,7 +3652,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
        wm8994_handle_pdata(wm8994);
 
        wm_hubs_add_analogue_controls(codec);
-       snd_soc_add_controls(codec, wm8994_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8994_snd_controls,
                             ARRAY_SIZE(wm8994_snd_controls));
        snd_soc_dapm_new_controls(dapm, wm8994_dapm_widgets,
                                  ARRAY_SIZE(wm8994_dapm_widgets));
@@ -3678,7 +3678,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
                }
                break;
        case WM8958:
-               snd_soc_add_controls(codec, wm8958_snd_controls,
+               snd_soc_add_codec_controls(codec, wm8958_snd_controls,
                                     ARRAY_SIZE(wm8958_snd_controls));
                snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets,
                                          ARRAY_SIZE(wm8958_dapm_widgets));
@@ -3700,7 +3700,7 @@ static int wm8994_codec_probe(struct snd_soc_codec *codec)
                break;
 
        case WM1811:
-               snd_soc_add_controls(codec, wm8958_snd_controls,
+               snd_soc_add_codec_controls(codec, wm8958_snd_controls,
                                     ARRAY_SIZE(wm8958_snd_controls));
                snd_soc_dapm_new_controls(dapm, wm8958_dapm_widgets,
                                          ARRAY_SIZE(wm8958_dapm_widgets));
index 89a864287c13ff3b5ab7b6489f7574e2a5cd5d9f..28c89b094c6ee6a5af57bab43a4a7f1c7d84f1f7 100644 (file)
@@ -2136,7 +2136,7 @@ static int wm8995_probe(struct snd_soc_codec *codec)
 
        wm8995_update_class_w(codec);
 
-       snd_soc_add_controls(codec, wm8995_snd_controls,
+       snd_soc_add_codec_controls(codec, wm8995_snd_controls,
                             ARRAY_SIZE(wm8995_snd_controls));
        snd_soc_dapm_new_controls(&codec->dapm, wm8995_dapm_widgets,
                                  ARRAY_SIZE(wm8995_dapm_widgets));
index 10f41c888884b398b1e51ffc0f50087f413660b4..86f449ccf813ed3dabfa271d7ba3b001da54d3fa 100644 (file)
@@ -2771,7 +2771,7 @@ static void wm8996_retune_mobile_pdata(struct snd_soc_codec *codec)
        wm8996->retune_mobile_enum.max = wm8996->num_retune_mobile_texts;
        wm8996->retune_mobile_enum.texts = wm8996->retune_mobile_texts;
 
-       ret = snd_soc_add_controls(codec, controls, ARRAY_SIZE(controls));
+       ret = snd_soc_add_codec_controls(codec, controls, ARRAY_SIZE(controls));
        if (ret != 0)
                dev_err(codec->dev,
                        "Failed to add ReTune Mobile controls: %d\n", ret);
@@ -2966,7 +2966,7 @@ static int wm8996_probe(struct snd_soc_codec *codec)
        if (wm8996->pdata.num_retune_mobile_cfgs)
                wm8996_retune_mobile_pdata(codec);
        else
-               snd_soc_add_controls(codec, wm8996_eq_controls,
+               snd_soc_add_codec_controls(codec, wm8996_eq_controls,
                                     ARRAY_SIZE(wm8996_eq_controls));
 
        /* If the TX LRCLK pins are not in LRCLK mode configure the
index a6bab392700e94bfe138e8ae2322f1df47d3a70d..7b09b1f86dbbdeca0ddfaae44ac4fe994a38f830 100644 (file)
@@ -1287,7 +1287,7 @@ static int wm9081_probe(struct snd_soc_codec *codec)
        if (!wm9081->pdata.num_retune_configs) {
                dev_dbg(codec->dev,
                        "No ReTune Mobile data, using normal EQ\n");
-               snd_soc_add_controls(codec, wm9081_eq_controls,
+               snd_soc_add_codec_controls(codec, wm9081_eq_controls,
                                     ARRAY_SIZE(wm9081_eq_controls));
        }
 
index a2b9208a08f0c1cfb2d387686e650b6cd5514e3d..e8280eecd4c9691acb74bedf8ec16dde121cbe89 100644 (file)
@@ -433,7 +433,7 @@ static int wm9090_add_controls(struct snd_soc_codec *codec)
 
        snd_soc_dapm_add_routes(dapm, audio_map, ARRAY_SIZE(audio_map));
 
-       snd_soc_add_controls(codec, wm9090_controls,
+       snd_soc_add_codec_controls(codec, wm9090_controls,
                             ARRAY_SIZE(wm9090_controls));
 
        if (wm9090->pdata.lin1_diff) {
@@ -442,7 +442,7 @@ static int wm9090_add_controls(struct snd_soc_codec *codec)
        } else {
                snd_soc_dapm_add_routes(dapm, audio_map_in1_se,
                                        ARRAY_SIZE(audio_map_in1_se));
-               snd_soc_add_controls(codec, wm9090_in1_se_controls,
+               snd_soc_add_codec_controls(codec, wm9090_in1_se_controls,
                                     ARRAY_SIZE(wm9090_in1_se_controls));
        }
 
@@ -452,7 +452,7 @@ static int wm9090_add_controls(struct snd_soc_codec *codec)
        } else {
                snd_soc_dapm_add_routes(dapm, audio_map_in2_se,
                                        ARRAY_SIZE(audio_map_in2_se));
-               snd_soc_add_controls(codec, wm9090_in2_se_controls,
+               snd_soc_add_codec_controls(codec, wm9090_in2_se_controls,
                                     ARRAY_SIZE(wm9090_in2_se_controls));
        }
 
index 40c92ead85a34526e4ce5d49c09e43595b8ae6c1..cacc6a86b46f05b1fd5ea54b08fae3d4ad7eb4be 100644 (file)
@@ -351,7 +351,7 @@ static int wm9705_soc_probe(struct snd_soc_codec *codec)
        if (ret)
                goto reset_err;
 
-       snd_soc_add_controls(codec, wm9705_snd_ac97_controls,
+       snd_soc_add_codec_controls(codec, wm9705_snd_ac97_controls,
                                ARRAY_SIZE(wm9705_snd_ac97_controls));
 
        return 0;
index 7291eabb0eb1b5cb3c570bad0848feecb9a0bd91..b342ae50bcd6e294b5fe017f2bb7cdb77f4440ab 100644 (file)
@@ -637,7 +637,7 @@ static int wm9712_soc_probe(struct snd_soc_codec *codec)
        ac97_write(codec, AC97_VIDEO, ac97_read(codec, AC97_VIDEO) | 0x3000);
 
        wm9712_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-       snd_soc_add_controls(codec, wm9712_snd_ac97_controls,
+       snd_soc_add_codec_controls(codec, wm9712_snd_ac97_controls,
                                ARRAY_SIZE(wm9712_snd_ac97_controls));
 
        return 0;
index 2b8479bfcd93b822c48daa1f4e6797cf679d8cec..2d22cc70d5362d72c2372710597318e1cae61e6b 100644 (file)
@@ -1216,7 +1216,7 @@ static int wm9713_soc_probe(struct snd_soc_codec *codec)
        reg = ac97_read(codec, AC97_CD) & 0x7fff;
        ac97_write(codec, AC97_CD, reg);
 
-       snd_soc_add_controls(codec, wm9713_snd_ac97_controls,
+       snd_soc_add_codec_controls(codec, wm9713_snd_ac97_controls,
                                ARRAY_SIZE(wm9713_snd_ac97_controls));
 
        return 0;
index ec7d49033d4c2884d8f8cdb47733a4bd5fc39199..c509911a59fc9ab0084063dd41d1cfd3bd506e8a 100644 (file)
@@ -895,7 +895,7 @@ int wm_hubs_add_analogue_controls(struct snd_soc_codec *codec)
                            WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU,
                            WM8993_MIXOUTR_ZC | WM8993_MIXOUT_VU);
 
-       snd_soc_add_controls(codec, analogue_snd_controls,
+       snd_soc_add_codec_controls(codec, analogue_snd_controls,
                             ARRAY_SIZE(analogue_snd_controls));
 
        snd_soc_dapm_new_controls(dapm, analogue_dapm_widgets,
index 6f77eef0f13164b08507c15a1c554e9a1f35c9dc..2937e54da49ef596f52243cbce586a4cbba8712b 100644 (file)
@@ -235,7 +235,7 @@ static int mfld_init(struct snd_soc_pcm_runtime *runtime)
        snd_soc_dapm_enable_pin(dapm, "Headphones");
        snd_soc_dapm_enable_pin(dapm, "Mic");
 
-       ret_val = snd_soc_add_controls(codec, mfld_snd_controls,
+       ret_val = snd_soc_add_codec_controls(codec, mfld_snd_controls,
                                ARRAY_SIZE(mfld_snd_controls));
        if (ret_val) {
                pr_err("soc_add_controls failed %d", ret_val);
index a67f4370bc9f8fc0096e92abb8ba6cbc3771c220..78563bbbbf018078fefa0744ec27b1d6277ac0a0 100644 (file)
@@ -570,7 +570,7 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
        snd_soc_dapm_disable_pin(dapm, "AGCOUT");
 
        /* Add virtual switch */
-       ret = snd_soc_add_controls(codec, ams_delta_audio_controls,
+       ret = snd_soc_add_codec_controls(codec, ams_delta_audio_controls,
                                        ARRAY_SIZE(ams_delta_audio_controls));
        if (ret)
                dev_warn(card->dev,
index 597be412f1e40080336be9604940cbfab72012fd..1490227cd37915a72f3cedee0bd83624ab329a2e 100644 (file)
@@ -55,9 +55,8 @@ static int n810_spk_func;
 static int n810_jack_func;
 static int n810_dmic_func;
 
-static void n810_ext_control(struct snd_soc_codec *codec)
+static void n810_ext_control(struct snd_soc_dapm_context *dapm)
 {
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
        int hp = 0, line1l = 0;
 
        switch (n810_jack_func) {
@@ -102,7 +101,7 @@ static int n810_startup(struct snd_pcm_substream *substream)
        snd_pcm_hw_constraint_minmax(runtime,
                                     SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2);
 
-       n810_ext_control(codec);
+       n810_ext_control(&codec->dapm);
        return clk_enable(sys_clkout2);
 }
 
@@ -142,13 +141,13 @@ static int n810_get_spk(struct snd_kcontrol *kcontrol,
 static int n810_set_spk(struct snd_kcontrol *kcontrol,
                        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec =  snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card =  snd_kcontrol_chip(kcontrol);
 
        if (n810_spk_func == ucontrol->value.integer.value[0])
                return 0;
 
        n810_spk_func = ucontrol->value.integer.value[0];
-       n810_ext_control(codec);
+       n810_ext_control(&card->dapm);
 
        return 1;
 }
@@ -164,13 +163,13 @@ static int n810_get_jack(struct snd_kcontrol *kcontrol,
 static int n810_set_jack(struct snd_kcontrol *kcontrol,
                         struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec =  snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card =  snd_kcontrol_chip(kcontrol);
 
        if (n810_jack_func == ucontrol->value.integer.value[0])
                return 0;
 
        n810_jack_func = ucontrol->value.integer.value[0];
-       n810_ext_control(codec);
+       n810_ext_control(&card->dapm);
 
        return 1;
 }
@@ -186,7 +185,7 @@ static int n810_get_input(struct snd_kcontrol *kcontrol,
 static int n810_set_input(struct snd_kcontrol *kcontrol,
                          struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec =  snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card =  snd_kcontrol_chip(kcontrol);
 
        if (n810_dmic_func == ucontrol->value.integer.value[0])
                return 0;
index 017371913ec3cf0629acbdc549d8bbe99d5f7ea7..1287b870f2212f348ac5115e9c447a093dceee82 100644 (file)
@@ -744,17 +744,17 @@ static const struct snd_kcontrol_new omap_mcbsp3_st_controls[] = {
                                      omap_mcbsp3_set_st_ch1_volume),
 };
 
-int omap_mcbsp_st_add_controls(struct snd_soc_codec *codec, int mcbsp_id)
+int omap_mcbsp_st_add_controls(struct snd_soc_dai *dai)
 {
        if (!cpu_is_omap34xx())
                return -ENODEV;
 
-       switch (mcbsp_id) {
+       switch (dai->id) {
        case 1: /* McBSP 2 */
-               return snd_soc_add_controls(codec, omap_mcbsp2_st_controls,
+               return snd_soc_add_dai_controls(dai, omap_mcbsp2_st_controls,
                                        ARRAY_SIZE(omap_mcbsp2_st_controls));
        case 2: /* McBSP 3 */
-               return snd_soc_add_controls(codec, omap_mcbsp3_st_controls,
+               return snd_soc_add_dai_controls(dai, omap_mcbsp3_st_controls,
                                        ARRAY_SIZE(omap_mcbsp3_st_controls));
        default:
                break;
index 65cde9d3807b5ffc11c4072dcd8fb606c3e1fb12..476fe2add703611ccc677c05c3346e2553f5e017 100644 (file)
@@ -59,6 +59,6 @@ enum omap_mcbsp_div {
 #define NUM_LINKS      5
 #endif
 
-int omap_mcbsp_st_add_controls(struct snd_soc_codec *codec, int mcbsp_id);
+int omap_mcbsp_st_add_controls(struct snd_soc_dai *dai);
 
 #endif
index fada6ef43eeae736750ef60de289efb0fa48af1d..58936c730a877a22ee3cb5767c1e5a35d6d525f7 100644 (file)
@@ -59,9 +59,8 @@ static int rx51_spk_func;
 static int rx51_dmic_func;
 static int rx51_jack_func;
 
-static void rx51_ext_control(struct snd_soc_codec *codec)
+static void rx51_ext_control(struct snd_soc_dapm_context *dapm)
 {
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
        int hp = 0, hs = 0, tvout = 0;
 
        switch (rx51_jack_func) {
@@ -102,11 +101,11 @@ static int rx51_startup(struct snd_pcm_substream *substream)
 {
        struct snd_pcm_runtime *runtime = substream->runtime;
        struct snd_soc_pcm_runtime *rtd = substream->private_data;
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_card *card = rtd->card;
 
        snd_pcm_hw_constraint_minmax(runtime,
                                     SNDRV_PCM_HW_PARAM_CHANNELS, 2, 2);
-       rx51_ext_control(codec);
+       rx51_ext_control(&card->dapm);
 
        return 0;
 }
@@ -138,13 +137,13 @@ static int rx51_get_spk(struct snd_kcontrol *kcontrol,
 static int rx51_set_spk(struct snd_kcontrol *kcontrol,
                        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
 
        if (rx51_spk_func == ucontrol->value.integer.value[0])
                return 0;
 
        rx51_spk_func = ucontrol->value.integer.value[0];
-       rx51_ext_control(codec);
+       rx51_ext_control(&card->dapm);
 
        return 1;
 }
@@ -184,13 +183,13 @@ static int rx51_get_input(struct snd_kcontrol *kcontrol,
 static int rx51_set_input(struct snd_kcontrol *kcontrol,
                          struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
 
        if (rx51_dmic_func == ucontrol->value.integer.value[0])
                return 0;
 
        rx51_dmic_func = ucontrol->value.integer.value[0];
-       rx51_ext_control(codec);
+       rx51_ext_control(&card->dapm);
 
        return 1;
 }
@@ -206,13 +205,13 @@ static int rx51_get_jack(struct snd_kcontrol *kcontrol,
 static int rx51_set_jack(struct snd_kcontrol *kcontrol,
                         struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
 
        if (rx51_jack_func == ucontrol->value.integer.value[0])
                return 0;
 
        rx51_jack_func = ucontrol->value.integer.value[0];
-       rx51_ext_control(codec);
+       rx51_ext_control(&card->dapm);
 
        return 1;
 }
@@ -297,7 +296,7 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
        snd_soc_dapm_nc_pin(dapm, "LINE1R");
 
        /* Add RX-51 specific controls */
-       err = snd_soc_add_controls(codec, aic34_rx51_controls,
+       err = snd_soc_add_card_controls(rtd->card, aic34_rx51_controls,
                                   ARRAY_SIZE(aic34_rx51_controls));
        if (err < 0)
                return err;
@@ -314,7 +313,7 @@ static int rx51_aic34_init(struct snd_soc_pcm_runtime *rtd)
                return err;
        snd_soc_limit_volume(codec, "TPA6130A2 Headphone Playback Volume", 42);
 
-       err = omap_mcbsp_st_add_controls(codec, 1);
+       err = omap_mcbsp_st_add_controls(rtd->cpu_dai);
        if (err < 0)
                return err;
 
@@ -335,7 +334,7 @@ static int rx51_aic34b_init(struct snd_soc_dapm_context *dapm)
 {
        int err;
 
-       err = snd_soc_add_controls(dapm->codec, aic34_rx51_controlsb,
+       err = snd_soc_add_card_controls(dapm->card, aic34_rx51_controlsb,
                                   ARRAY_SIZE(aic34_rx51_controlsb));
        if (err < 0)
                return err;
index bc21944851c4c69f274fc4df418dd499e45a0bdd..863367ad89ce6aa1b173914f8c2541903d4f9846 100644 (file)
 static int corgi_jack_func;
 static int corgi_spk_func;
 
-static void corgi_ext_control(struct snd_soc_codec *codec)
+static void corgi_ext_control(struct snd_soc_dapm_context *dapm)
 {
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
        /* set up jack connection */
        switch (corgi_jack_func) {
        case CORGI_HP:
@@ -104,7 +102,7 @@ static int corgi_startup(struct snd_pcm_substream *substream)
        mutex_lock(&codec->mutex);
 
        /* check the jack status at stream startup */
-       corgi_ext_control(codec);
+       corgi_ext_control(&codec->dapm);
 
        mutex_unlock(&codec->mutex);
 
@@ -173,13 +171,13 @@ static int corgi_get_jack(struct snd_kcontrol *kcontrol,
 static int corgi_set_jack(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec = snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card = snd_kcontrol_chip(kcontrol);
 
        if (corgi_jack_func == ucontrol->value.integer.value[0])
                return 0;
 
        corgi_jack_func = ucontrol->value.integer.value[0];
-       corgi_ext_control(codec);
+       corgi_ext_control(&card->dapm);
        return 1;
 }
 
@@ -193,13 +191,13 @@ static int corgi_get_spk(struct snd_kcontrol *kcontrol,
 static int corgi_set_spk(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec =  snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card =  snd_kcontrol_chip(kcontrol);
 
        if (corgi_spk_func == ucontrol->value.integer.value[0])
                return 0;
 
        corgi_spk_func = ucontrol->value.integer.value[0];
-       corgi_ext_control(codec);
+       corgi_ext_control(&card->dapm);
        return 1;
 }
 
index 3f7a8ecb97206b875469d5de5a2bf21410dd9034..aace19e0fe2c217f734dbd0164b4d242a93be1d1 100644 (file)
@@ -411,7 +411,7 @@ static int magician_uda1380_init(struct snd_soc_pcm_runtime *rtd)
        snd_soc_dapm_nc_pin(dapm, "VINR");
 
        /* Add magician specific controls */
-       err = snd_soc_add_controls(codec, uda1380_magician_controls,
+       err = snd_soc_add_codec_controls(codec, uda1380_magician_controls,
                                ARRAY_SIZE(uda1380_magician_controls));
        if (err < 0)
                return err;
index fd0ed10c6fe7346065ee18c65d0cb02f4cee6724..d2cc81735036ea8dd6a1aff7f61465caa29fd2fd 100644 (file)
 static int poodle_jack_func;
 static int poodle_spk_func;
 
-static void poodle_ext_control(struct snd_soc_codec *codec)
+static void poodle_ext_control(struct snd_soc_dapm_context *dapm)
 {
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
        /* set up jack connection */
        if (poodle_jack_func == POODLE_HP) {
                /* set = unmute headphone */
@@ -81,7 +79,7 @@ static int poodle_startup(struct snd_pcm_substream *substream)
        mutex_lock(&codec->mutex);
 
        /* check the jack status at stream startup */
-       poodle_ext_control(codec);
+       poodle_ext_control(&codec->dapm);
 
        mutex_unlock(&codec->mutex);
 
@@ -152,13 +150,13 @@ static int poodle_get_jack(struct snd_kcontrol *kcontrol,
 static int poodle_set_jack(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec =  snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card =  snd_kcontrol_chip(kcontrol);
 
        if (poodle_jack_func == ucontrol->value.integer.value[0])
                return 0;
 
        poodle_jack_func = ucontrol->value.integer.value[0];
-       poodle_ext_control(codec);
+       poodle_ext_control(&card->dapm);
        return 1;
 }
 
@@ -172,13 +170,13 @@ static int poodle_get_spk(struct snd_kcontrol *kcontrol,
 static int poodle_set_spk(struct snd_kcontrol *kcontrol,
        struct snd_ctl_elem_value *ucontrol)
 {
-       struct snd_soc_codec *codec =  snd_kcontrol_chip(kcontrol);
+       struct snd_soc_card *card =  snd_kcontrol_chip(kcontrol);
 
        if (poodle_spk_func == ucontrol->value.integer.value[0])
                return 0;
 
        poodle_spk_func = ucontrol->value.integer.value[0];
-       poodle_ext_control(codec);
+       poodle_ext_control(&card->dapm);
        return 1;
 }
 
index 564ef08a89f2d410efae0d45dcdc1691d9e32b5d..2aec63f3706acf826f8f9424fa496a1a479814ab 100644 (file)
@@ -197,7 +197,7 @@ static int tosa_ac97_init(struct snd_soc_pcm_runtime *rtd)
        snd_soc_dapm_nc_pin(dapm, "MONOOUT");
 
        /* add tosa specific controls */
-       err = snd_soc_add_controls(codec, tosa_controls,
+       err = snd_soc_add_codec_controls(codec, tosa_controls,
                                ARRAY_SIZE(tosa_controls));
        if (err < 0)
                return err;
index 7ac0ba2025c337b5f313996f00a04c52975cb9a5..e34f4e8034241a13d49aa9b3ec848d19fd85608f 100644 (file)
@@ -298,7 +298,7 @@ static int neo1973_gta02_wm8753_init(struct snd_soc_codec *codec)
        if (ret)
                return ret;
 
-       ret = snd_soc_add_controls(codec, neo1973_gta02_wm8753_controls,
+       ret = snd_soc_add_card_controls(codec->card, neo1973_gta02_wm8753_controls,
                        ARRAY_SIZE(neo1973_gta02_wm8753_controls));
        if (ret)
                return ret;
@@ -338,7 +338,7 @@ static int neo1973_wm8753_init(struct snd_soc_pcm_runtime *rtd)
                return ret;
 
        /* add neo1973 specific controls */
-       ret = snd_soc_add_controls(codec, neo1973_wm8753_controls,
+       ret = snd_soc_add_card_controls(rtd->card, neo1973_wm8753_controls,
                        ARRAY_SIZE(neo1973_wm8753_controls));
        if (ret)
                return ret;
index a253bcc1646aabee42c7b4844bcf960578f49b1b..656d5afe4ca945a944b2d7efdca3e7a78c197228 100644 (file)
@@ -134,18 +134,18 @@ static const struct snd_kcontrol_new amp_unmute_controls[] = {
 
 void simtec_audio_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_codec *codec = rtd->codec;
+       struct snd_soc_card *card = rtd->card;
 
        if (pdata->amp_gpio > 0) {
                pr_debug("%s: adding amp routes\n", __func__);
 
-               snd_soc_add_controls(codec, amp_unmute_controls,
+               snd_soc_add_card_controls(card, amp_unmute_controls,
                                     ARRAY_SIZE(amp_unmute_controls));
        }
 
        if (pdata->amp_gain[0] > 0) {
                pr_debug("%s: adding amp controls\n", __func__);
-               snd_soc_add_controls(codec, amp_gain_controls,
+               snd_soc_add_card_controls(card, amp_gain_controls,
                                     ARRAY_SIZE(amp_gain_controls));
        }
 }
index 091d5f37ae647a74856a4b23f3e32f70adba2bcc..a3a47cdaac8fa22c28a3371e579d1560b6bcf128 100644 (file)
@@ -996,7 +996,7 @@ static int soc_probe_codec(struct snd_soc_card *card,
        }
 
        if (driver->controls)
-               snd_soc_add_controls(codec, driver->controls,
+               snd_soc_add_codec_controls(codec, driver->controls,
                                     driver->num_controls);
        if (driver->dapm_routes)
                snd_soc_dapm_add_routes(&codec->dapm, driver->dapm_routes,
@@ -1457,13 +1457,8 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
                }
        }
 
-       /* We should have a non-codec control add function but we don't */
        if (card->controls)
-               snd_soc_add_controls(list_first_entry(&card->codec_dev_list,
-                                                     struct snd_soc_codec,
-                                                     card_list),
-                                    card->controls,
-                                    card->num_controls);
+               snd_soc_add_card_controls(card, card->controls, card->num_controls);
 
        if (card->dapm_routes)
                snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
@@ -2015,9 +2010,28 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
 }
 EXPORT_SYMBOL_GPL(snd_soc_cnew);
 
+static int snd_soc_add_controls(struct snd_card *card, struct device *dev,
+       const struct snd_kcontrol_new *controls, int num_controls,
+       const char *prefix, void *data)
+{
+       int err, i;
+
+       for (i = 0; i < num_controls; i++) {
+               const struct snd_kcontrol_new *control = &controls[i];
+               err = snd_ctl_add(card, snd_soc_cnew(control, data,
+                                                    control->name, prefix));
+               if (err < 0) {
+                       dev_err(dev, "Failed to add %s: %d\n", control->name, err);
+                       return err;
+               }
+       }
+
+       return 0;
+}
+
 /**
- * snd_soc_add_controls - add an array of controls to a codec.
- * Convienience function to add a list of controls. Many codecs were
+ * snd_soc_add_codec_controls - add an array of controls to a codec.
+ * Convenience function to add a list of controls. Many codecs were
  * duplicating this code.
  *
  * @codec: codec to add controls to
@@ -2026,31 +2040,19 @@ EXPORT_SYMBOL_GPL(snd_soc_cnew);
  *
  * Return 0 for success, else error.
  */
-int snd_soc_add_controls(struct snd_soc_codec *codec,
+int snd_soc_add_codec_controls(struct snd_soc_codec *codec,
        const struct snd_kcontrol_new *controls, int num_controls)
 {
        struct snd_card *card = codec->card->snd_card;
-       int err, i;
 
-       for (i = 0; i < num_controls; i++) {
-               const struct snd_kcontrol_new *control = &controls[i];
-               err = snd_ctl_add(card, snd_soc_cnew(control, codec,
-                                                    control->name,
-                                                    codec->name_prefix));
-               if (err < 0) {
-                       dev_err(codec->dev, "%s: Failed to add %s: %d\n",
-                               codec->name, control->name, err);
-                       return err;
-               }
-       }
-
-       return 0;
+       return snd_soc_add_controls(card, codec->dev, controls, num_controls,
+                       codec->name_prefix, codec);
 }
-EXPORT_SYMBOL_GPL(snd_soc_add_controls);
+EXPORT_SYMBOL_GPL(snd_soc_add_codec_controls);
 
 /**
  * snd_soc_add_platform_controls - add an array of controls to a platform.
- * Convienience function to add a list of controls.
+ * Convenience function to add a list of controls.
  *
  * @platform: platform to add controls to
  * @controls: array of controls to add
@@ -2062,22 +2064,52 @@ int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
        const struct snd_kcontrol_new *controls, int num_controls)
 {
        struct snd_card *card = platform->card->snd_card;
-       int err, i;
 
-       for (i = 0; i < num_controls; i++) {
-               const struct snd_kcontrol_new *control = &controls[i];
-               err = snd_ctl_add(card, snd_soc_cnew(control, platform,
-                               control->name, NULL));
-               if (err < 0) {
-                       dev_err(platform->dev, "Failed to add %s %d\n",control->name, err);
-                       return err;
-               }
-       }
-
-       return 0;
+       return snd_soc_add_controls(card, platform->dev, controls, num_controls,
+                       NULL, platform);
 }
 EXPORT_SYMBOL_GPL(snd_soc_add_platform_controls);
 
+/**
+ * snd_soc_add_card_controls - add an array of controls to a SoC card.
+ * Convenience function to add a list of controls.
+ *
+ * @soc_card: SoC card to add controls to
+ * @controls: array of controls to add
+ * @num_controls: number of elements in the array
+ *
+ * Return 0 for success, else error.
+ */
+int snd_soc_add_card_controls(struct snd_soc_card *soc_card,
+       const struct snd_kcontrol_new *controls, int num_controls)
+{
+       struct snd_card *card = soc_card->snd_card;
+
+       return snd_soc_add_controls(card, soc_card->dev, controls, num_controls,
+                       NULL, soc_card);
+}
+EXPORT_SYMBOL_GPL(snd_soc_add_card_controls);
+
+/**
+ * snd_soc_add_dai_controls - add an array of controls to a DAI.
+ * Convienience function to add a list of controls.
+ *
+ * @dai: DAI to add controls to
+ * @controls: array of controls to add
+ * @num_controls: number of elements in the array
+ *
+ * Return 0 for success, else error.
+ */
+int snd_soc_add_dai_controls(struct snd_soc_dai *dai,
+       const struct snd_kcontrol_new *controls, int num_controls)
+{
+       struct snd_card *card = dai->card->snd_card;
+
+       return snd_soc_add_controls(card, dai->dev, controls, num_controls,
+                       NULL, dai);
+}
+EXPORT_SYMBOL_GPL(snd_soc_add_dai_controls);
+
 /**
  * snd_soc_info_enum_double - enumerated double mixer info callback
  * @kcontrol: mixer control