]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
Merge remote-tracking branches 'asoc/topic/wm8350', 'asoc/topic/wm8400', 'asoc/topic...
authorMark Brown <broonie@kernel.org>
Mon, 8 Dec 2014 13:12:23 +0000 (13:12 +0000)
committerMark Brown <broonie@kernel.org>
Mon, 8 Dec 2014 13:12:23 +0000 (13:12 +0000)
sound/soc/codecs/wm8350.c
sound/soc/codecs/wm8400.c
sound/soc/codecs/wm8510.c
sound/soc/codecs/wm8523.c
sound/soc/codecs/wm8580.c

index 628ec774cf2296c56c7851fe773cacca3568b53f..87f664b9cc7d298063018bc5c649e913b0137300 100644 (file)
@@ -1242,19 +1242,6 @@ static int wm8350_set_bias_level(struct snd_soc_codec *codec,
        return 0;
 }
 
-static int wm8350_suspend(struct snd_soc_codec *codec)
-{
-       wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF);
-       return 0;
-}
-
-static int wm8350_resume(struct snd_soc_codec *codec)
-{
-       wm8350_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-       return 0;
-}
-
 static void wm8350_hp_work(struct wm8350_data *priv,
                           struct wm8350_jack_data *jack,
                           u16 mask)
@@ -1565,9 +1552,6 @@ static  int wm8350_codec_probe(struct snd_soc_codec *codec)
        wm8350_register_irq(wm8350, WM8350_IRQ_CODEC_MICD,
                            wm8350_mic_handler, 0, "Microphone detect", priv);
 
-
-       wm8350_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
        return 0;
 }
 
@@ -1596,8 +1580,6 @@ static int  wm8350_codec_remove(struct snd_soc_codec *codec)
         * wait for its completion */
        flush_delayed_work(&codec->dapm.delayed_work);
 
-       wm8350_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
        wm8350_clear_bits(wm8350, WM8350_POWER_MGMT_5, WM8350_CODEC_ENA);
 
        return 0;
@@ -1613,10 +1595,9 @@ static struct regmap *wm8350_get_regmap(struct device *dev)
 static struct snd_soc_codec_driver soc_codec_dev_wm8350 = {
        .probe =        wm8350_codec_probe,
        .remove =       wm8350_codec_remove,
-       .suspend =      wm8350_suspend,
-       .resume =       wm8350_resume,
        .get_regmap =   wm8350_get_regmap,
        .set_bias_level = wm8350_set_bias_level,
+       .suspend_bias_off = true,
 
        .controls = wm8350_snd_controls,
        .num_controls = ARRAY_SIZE(wm8350_snd_controls),
index 72471bef2e9a592da98fbea3f3a5db08471d39a2..385894f6e26433fd3226a5374c038a30e7bb9a20 100644 (file)
@@ -58,12 +58,10 @@ static struct regulator_bulk_data power[] = {
 
 /* codec private data */
 struct wm8400_priv {
-       struct snd_soc_codec *codec;
        struct wm8400 *wm8400;
        u16 fake_register;
        unsigned int sysclk;
        unsigned int pcmclk;
-       struct work_struct work;
        int fll_in, fll_out;
 };
 
@@ -1278,30 +1276,6 @@ static struct snd_soc_dai_driver wm8400_dai = {
        .ops = &wm8400_dai_ops,
 };
 
-static int wm8400_suspend(struct snd_soc_codec *codec)
-{
-       wm8400_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
-       return 0;
-}
-
-static int wm8400_resume(struct snd_soc_codec *codec)
-{
-       wm8400_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-       return 0;
-}
-
-static void wm8400_probe_deferred(struct work_struct *work)
-{
-       struct wm8400_priv *priv = container_of(work, struct wm8400_priv,
-                                               work);
-       struct snd_soc_codec *codec = priv->codec;
-
-       /* charge output caps */
-       wm8400_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-}
-
 static int wm8400_codec_probe(struct snd_soc_codec *codec)
 {
        struct wm8400 *wm8400 = dev_get_platdata(codec->dev);
@@ -1316,7 +1290,6 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)
 
        snd_soc_codec_set_drvdata(codec, priv);
        priv->wm8400 = wm8400;
-       priv->codec = codec;
 
        ret = devm_regulator_bulk_get(wm8400->dev,
                                 ARRAY_SIZE(power), &power[0]);
@@ -1325,8 +1298,6 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)
                return ret;
        }
 
-       INIT_WORK(&priv->work, wm8400_probe_deferred);
-
        wm8400_codec_reset(codec);
 
        reg = snd_soc_read(codec, WM8400_POWER_MANAGEMENT_1);
@@ -1343,8 +1314,6 @@ static int wm8400_codec_probe(struct snd_soc_codec *codec)
        snd_soc_write(codec, WM8400_LEFT_OUTPUT_VOLUME, 0x50 | (1<<8));
        snd_soc_write(codec, WM8400_RIGHT_OUTPUT_VOLUME, 0x50 | (1<<8));
 
-       if (!schedule_work(&priv->work))
-               return -EINVAL;
        return 0;
 }
 
@@ -1369,10 +1338,9 @@ static struct regmap *wm8400_get_regmap(struct device *dev)
 static struct snd_soc_codec_driver soc_codec_dev_wm8400 = {
        .probe =        wm8400_codec_probe,
        .remove =       wm8400_codec_remove,
-       .suspend =      wm8400_suspend,
-       .resume =       wm8400_resume,
        .get_regmap =   wm8400_get_regmap,
        .set_bias_level = wm8400_set_bias_level,
+       .suspend_bias_off = true,
 
        .controls = wm8400_snd_controls,
        .num_controls = ARRAY_SIZE(wm8400_snd_controls),
index e11127f9069e90d34f01a2d9fdd8fde241005fb6..8736ad094b248926051b3bf2590356c8db7ce3da 100644 (file)
@@ -575,41 +575,17 @@ static struct snd_soc_dai_driver wm8510_dai = {
        .symmetric_rates = 1,
 };
 
-static int wm8510_suspend(struct snd_soc_codec *codec)
-{
-       wm8510_set_bias_level(codec, SND_SOC_BIAS_OFF);
-       return 0;
-}
-
-static int wm8510_resume(struct snd_soc_codec *codec)
-{
-       wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-       return 0;
-}
-
 static int wm8510_probe(struct snd_soc_codec *codec)
 {
        wm8510_reset(codec);
 
-       /* power on device */
-       wm8510_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-       return 0;
-}
-
-/* power down chip */
-static int wm8510_remove(struct snd_soc_codec *codec)
-{
-       wm8510_set_bias_level(codec, SND_SOC_BIAS_OFF);
        return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_wm8510 = {
        .probe =        wm8510_probe,
-       .remove =       wm8510_remove,
-       .suspend =      wm8510_suspend,
-       .resume =       wm8510_resume,
        .set_bias_level = wm8510_set_bias_level,
+       .suspend_bias_off = true,
 
        .controls = wm8510_snd_controls,
        .num_controls = ARRAY_SIZE(wm8510_snd_controls),
index ec1f5740dbd0b9c1c7c4692c0776e6be623aa74e..b1cc94f5fc4b253282a71d167cbb1815861d99d1 100644 (file)
@@ -372,23 +372,6 @@ static struct snd_soc_dai_driver wm8523_dai = {
        .ops = &wm8523_dai_ops,
 };
 
-#ifdef CONFIG_PM
-static int wm8523_suspend(struct snd_soc_codec *codec)
-{
-       wm8523_set_bias_level(codec, SND_SOC_BIAS_OFF);
-       return 0;
-}
-
-static int wm8523_resume(struct snd_soc_codec *codec)
-{
-       wm8523_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-       return 0;
-}
-#else
-#define wm8523_suspend NULL
-#define wm8523_resume NULL
-#endif
-
 static int wm8523_probe(struct snd_soc_codec *codec)
 {
        struct wm8523_priv *wm8523 = snd_soc_codec_get_drvdata(codec);
@@ -402,23 +385,13 @@ static int wm8523_probe(struct snd_soc_codec *codec)
                            WM8523_DACR_VU, WM8523_DACR_VU);
        snd_soc_update_bits(codec, WM8523_DAC_CTRL3, WM8523_ZC, WM8523_ZC);
 
-       wm8523_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
-       return 0;
-}
-
-static int wm8523_remove(struct snd_soc_codec *codec)
-{
-       wm8523_set_bias_level(codec, SND_SOC_BIAS_OFF);
        return 0;
 }
 
 static struct snd_soc_codec_driver soc_codec_dev_wm8523 = {
        .probe =        wm8523_probe,
-       .remove =       wm8523_remove,
-       .suspend =      wm8523_suspend,
-       .resume =       wm8523_resume,
        .set_bias_level = wm8523_set_bias_level,
+       .suspend_bias_off = true,
 
        .controls = wm8523_controls,
        .num_controls = ARRAY_SIZE(wm8523_controls),
index 911605ee25b076ae621b651b0b285fc3a20fc293..0a887c5ec83a4c69edd6a0079cb17b676c46c774 100644 (file)
@@ -882,8 +882,6 @@ static int wm8580_probe(struct snd_soc_codec *codec)
                goto err_regulator_enable;
        }
 
-       wm8580_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
-
        return 0;
 
 err_regulator_enable:
@@ -897,8 +895,6 @@ static int wm8580_remove(struct snd_soc_codec *codec)
 {
        struct wm8580_priv *wm8580 = snd_soc_codec_get_drvdata(codec);
 
-       wm8580_set_bias_level(codec, SND_SOC_BIAS_OFF);
-
        regulator_bulk_disable(ARRAY_SIZE(wm8580->supplies), wm8580->supplies);
 
        return 0;