ASoC: Remove needless snd_soc_dapm_enable_pin() from machine driver inits
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Mon, 19 May 2014 13:17:27 +0000 (16:17 +0300)
committerMark Brown <broonie@linaro.org>
Mon, 19 May 2014 16:19:18 +0000 (17:19 +0100)
ALSA SoC core marks widgets as connected by default when they are
initialized in snd_soc_dapm_new_control() so there is no need to call
snd_soc_dapm_enable_pin() from machine driver init functions.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
15 files changed:
sound/soc/atmel/snd-soc-afeb9260.c
sound/soc/intel/byt-rt5640.c
sound/soc/intel/haswell.c
sound/soc/kirkwood/kirkwood-t5325.c
sound/soc/omap/ams-delta.c
sound/soc/pxa/brownstone.c
sound/soc/pxa/palm27x.c
sound/soc/pxa/poodle.c
sound/soc/pxa/ttc-dkb.c
sound/soc/samsung/h1940_uda1380.c
sound/soc/samsung/rx1950_uda1380.c
sound/soc/samsung/s3c24xx_simtec_hermes.c
sound/soc/samsung/s3c24xx_simtec_tlv320aic23.c
sound/soc/samsung/smartq_wm8987.c
sound/soc/samsung/smdk_wm8994.c

index f65f08beac31487248139e594f16d5f51381e08b..9579799ace5469af7bebbc0c320716fb92d5b433 100644 (file)
@@ -80,17 +80,6 @@ static const struct snd_soc_dapm_route afeb9260_audio_map[] = {
        {"MICIN", NULL, "Mic Jack"},
 };
 
-static int afeb9260_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
-{
-       struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
-       snd_soc_dapm_enable_pin(dapm, "Line In");
-       snd_soc_dapm_enable_pin(dapm, "Mic Jack");
-
-       return 0;
-}
 
 /* Digital audio interface glue - connects codec <--> CPU */
 static struct snd_soc_dai_link afeb9260_dai = {
@@ -100,7 +89,6 @@ static struct snd_soc_dai_link afeb9260_dai = {
        .codec_dai_name = "tlv320aic23-hifi",
        .platform_name = "atmel_pcm-audio",
        .codec_name = "tlv320aic23-codec.0-001a",
-       .init = afeb9260_tlv320aic23_init,
        .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_IF |
                   SND_SOC_DAIFMT_CBM_CFM,
        .ops = &afeb9260_ops,
index b3195bb24b72516b0c88652de65702d831ff8c22..10df4c8d78e654270f1015b2131c61538ef1d9c6 100644 (file)
@@ -100,11 +100,6 @@ static int byt_rt5640_init(struct snd_soc_pcm_runtime *runtime)
        snd_soc_dapm_ignore_suspend(dapm, "SPORP");
        snd_soc_dapm_ignore_suspend(dapm, "SPORN");
 
-       snd_soc_dapm_enable_pin(dapm, "Headset Mic");
-       snd_soc_dapm_enable_pin(dapm, "Headphone");
-       snd_soc_dapm_enable_pin(dapm, "Speaker");
-       snd_soc_dapm_enable_pin(dapm, "Internal Mic");
-
        return ret;
 }
 
index 54345a2a7386af14ec6d67748d56afec75a62fe1..94c2c33ffe490a08cb36a05f81730905d9ba2da2 100644 (file)
@@ -89,8 +89,6 @@ static struct snd_soc_ops haswell_rt5640_ops = {
 
 static int haswell_rtd_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
        struct sst_pdata *pdata = dev_get_platdata(rtd->platform->dev);
        struct sst_hsw *haswell = pdata->dsp;
        int ret;
@@ -104,10 +102,6 @@ static int haswell_rtd_init(struct snd_soc_pcm_runtime *rtd)
                return ret;
        }
 
-       /* always connected */
-       snd_soc_dapm_enable_pin(dapm, "Headphones");
-       snd_soc_dapm_enable_pin(dapm, "Mic");
-
        return 0;
 }
 
index d213832b0c72ee38b6ccf6f5c49867d6a8294888..844b8415a011ff85222e6f4c4e82ea8e27ea8e3b 100644 (file)
@@ -52,18 +52,6 @@ static const struct snd_soc_dapm_route t5325_route[] = {
        { "MIC2",               NULL,   "Mic Jack" },
 };
 
-static int t5325_dai_init(struct snd_soc_pcm_runtime *rtd)
-{
-       struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_enable_pin(dapm, "Mic Jack");
-       snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
-       snd_soc_dapm_enable_pin(dapm, "Speaker");
-
-       return 0;
-}
-
 static struct snd_soc_dai_link t5325_dai[] = {
 {
        .name = "ALC5621",
@@ -74,7 +62,6 @@ static struct snd_soc_dai_link t5325_dai[] = {
        .codec_name = "alc562x-codec.0-001a",
        .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_CBS_CFS,
        .ops = &t5325_ops,
-       .init = t5325_dai_init,
 },
 };
 
index 56a5219c0a00587fc412caf76927adf4d11799a5..44ae4561adcdec0f44b4a6d118fc3e0d7db2888b 100644 (file)
@@ -541,8 +541,6 @@ static int ams_delta_cx20442_init(struct snd_soc_pcm_runtime *rtd)
 
        /* Set up initial pin constellation */
        snd_soc_dapm_disable_pin(dapm, "Mouthpiece");
-       snd_soc_dapm_enable_pin(dapm, "Earpiece");
-       snd_soc_dapm_enable_pin(dapm, "Microphone");
        snd_soc_dapm_disable_pin(dapm, "Speaker");
        snd_soc_dapm_disable_pin(dapm, "AGCIN");
        snd_soc_dapm_disable_pin(dapm, "AGCOUT");
index 9c128d4c8cbfc8cceec46f593e6392422b8994c5..c8dd53f9c35dab262eaa0bb64c2d123910d421de 100644 (file)
@@ -50,11 +50,6 @@ static int brownstone_wm8994_init(struct snd_soc_pcm_runtime *rtd)
        struct snd_soc_codec *codec = rtd->codec;
        struct snd_soc_dapm_context *dapm = &codec->dapm;
 
-       snd_soc_dapm_enable_pin(dapm, "Ext Spk");
-       snd_soc_dapm_enable_pin(dapm, "Headset Stereophone");
-       snd_soc_dapm_enable_pin(dapm, "Headset Mic");
-       snd_soc_dapm_enable_pin(dapm, "Main Mic");
-
        /* set endpoints to not connected */
        snd_soc_dapm_nc_pin(dapm, "HPOUT2P");
        snd_soc_dapm_nc_pin(dapm, "HPOUT2N");
index 3284c4b901cbfa740e75d633ddb1580698fdafb5..17f9521ff6ea2bb4c7f8733a44081e9033ccb4fc 100644 (file)
@@ -79,14 +79,6 @@ static int palm27x_ac97_init(struct snd_soc_pcm_runtime *rtd)
        struct snd_soc_dapm_context *dapm = &codec->dapm;
        int err;
 
-       /* connected pins */
-       if (machine_is_palmld())
-               snd_soc_dapm_enable_pin(dapm, "MIC1");
-       snd_soc_dapm_enable_pin(dapm, "HPOUTL");
-       snd_soc_dapm_enable_pin(dapm, "HPOUTR");
-       snd_soc_dapm_enable_pin(dapm, "LOUT2");
-       snd_soc_dapm_enable_pin(dapm, "ROUT2");
-
        /* not connected pins */
        snd_soc_dapm_nc_pin(dapm, "OUT3");
        snd_soc_dapm_nc_pin(dapm, "MONOOUT");
index c6bdc6c0eff6007f1180d3908b3437600fc6446d..21f340065318599afce2b823f6463718f5c323e4 100644 (file)
@@ -230,7 +230,6 @@ static int poodle_wm8731_init(struct snd_soc_pcm_runtime *rtd)
 
        snd_soc_dapm_nc_pin(dapm, "LLINEIN");
        snd_soc_dapm_nc_pin(dapm, "RLINEIN");
-       snd_soc_dapm_enable_pin(dapm, "MICIN");
 
        return 0;
 }
index 0b535b570622d3ad1fcffef4a6be13753f817385..9d7c5b7e95399478b82c0f03d976a87aef9c6ca9 100644 (file)
@@ -78,10 +78,6 @@ static int ttc_pm860x_init(struct snd_soc_pcm_runtime *rtd)
        struct snd_soc_codec *codec = rtd->codec;
        struct snd_soc_dapm_context *dapm = &codec->dapm;
 
-       /* connected pins */
-       snd_soc_dapm_enable_pin(dapm, "Ext Speaker");
-       snd_soc_dapm_enable_pin(dapm, "Ext Mic 1");
-       snd_soc_dapm_enable_pin(dapm, "Ext Mic 3");
        snd_soc_dapm_disable_pin(dapm, "Headset Mic 2");
        snd_soc_dapm_disable_pin(dapm, "Headset Stereophone");
 
index 88b09e022503d94f6774dcfbc2822a2e054a0800..9f2fb69dbaaef222626332b7bca92140105cd963 100644 (file)
@@ -176,11 +176,6 @@ static struct platform_device *s3c24xx_snd_device;
 static int h1940_uda1380_init(struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
-       snd_soc_dapm_enable_pin(dapm, "Speaker");
-       snd_soc_dapm_enable_pin(dapm, "Mic Jack");
 
        snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE,
                &hp_jack);
index 2982d9e7f268f4ba4f8105e0016a9375721034b4..5b3e504d3a32f4782b1d8cf52371e185f89c226b 100644 (file)
@@ -221,11 +221,6 @@ static int rx1950_hw_params(struct snd_pcm_substream *substream,
 static int rx1950_uda1380_init(struct snd_soc_pcm_runtime *rtd)
 {
        struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
-       snd_soc_dapm_enable_pin(dapm, "Speaker");
-       snd_soc_dapm_enable_pin(dapm, "Mic Jack");
 
        snd_soc_jack_new(codec, "Headphone Jack", SND_JACK_HEADPHONE,
                &hp_jack);
index d8a0543cae5e8d19834f0c963a55d51a372d0dba..2d30b7b6818ad4253cf3b0b5d9dd3590d97a3aa6 100644 (file)
@@ -63,14 +63,6 @@ static const struct snd_soc_dapm_route base_map[] = {
 */
 static int simtec_hermes_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
-       snd_soc_dapm_enable_pin(dapm, "Line In");
-       snd_soc_dapm_enable_pin(dapm, "Line Out");
-       snd_soc_dapm_enable_pin(dapm, "Mic Jack");
-
        simtec_audio_init(rtd);
 
        return 0;
index 1ac0d7a63a3a0053170825af55c78fd7e599f590..83f6c7d49cd6c198aa5c368f51e4099d18fd646f 100644 (file)
@@ -52,14 +52,6 @@ static const struct snd_soc_dapm_route base_map[] = {
 */
 static int simtec_tlv320aic23_init(struct snd_soc_pcm_runtime *rtd)
 {
-       struct snd_soc_codec *codec = rtd->codec;
-       struct snd_soc_dapm_context *dapm = &codec->dapm;
-
-       snd_soc_dapm_enable_pin(dapm, "Headphone Jack");
-       snd_soc_dapm_enable_pin(dapm, "Line In");
-       snd_soc_dapm_enable_pin(dapm, "Line Out");
-       snd_soc_dapm_enable_pin(dapm, "Mic Jack");
-
        simtec_audio_init(rtd);
 
        return 0;
index c3b2adafb7b552900b30583dd83dc65d1eefccd6..df55db5d35543238b9824fc2271328fd8fe5ee06 100644 (file)
@@ -162,8 +162,6 @@ static int smartq_wm8987_init(struct snd_soc_pcm_runtime *rtd)
        snd_soc_dapm_nc_pin(dapm, "ROUT1");
 
        /* set endpoints to default off mode */
-       snd_soc_dapm_enable_pin(dapm, "Internal Speaker");
-       snd_soc_dapm_enable_pin(dapm, "Internal Mic");
        snd_soc_dapm_disable_pin(dapm, "Headphone Jack");
 
        /* Headphone jack detection */
index 682eb4f7ba0c61257ade6e96691ceafcb4d023a5..fc25cc00f0f2661fa6efd7b318cd1f522c6abb5c 100644 (file)
@@ -89,18 +89,6 @@ static int smdk_wm8994_init_paiftx(struct snd_soc_pcm_runtime *rtd)
        struct snd_soc_codec *codec = rtd->codec;
        struct snd_soc_dapm_context *dapm = &codec->dapm;
 
-       /* HeadPhone */
-       snd_soc_dapm_enable_pin(dapm, "HPOUT1R");
-       snd_soc_dapm_enable_pin(dapm, "HPOUT1L");
-
-       /* MicIn */
-       snd_soc_dapm_enable_pin(dapm, "IN1LN");
-       snd_soc_dapm_enable_pin(dapm, "IN1RN");
-
-       /* LineIn */
-       snd_soc_dapm_enable_pin(dapm, "IN2LN");
-       snd_soc_dapm_enable_pin(dapm, "IN2RN");
-
        /* Other pins NC */
        snd_soc_dapm_nc_pin(dapm, "HPOUT2P");
        snd_soc_dapm_nc_pin(dapm, "HPOUT2N");