diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/codecs/twl6040.c | 23 | ||||
-rw-r--r-- | sound/soc/codecs/uda134x.c | 32 | ||||
-rw-r--r-- | sound/soc/codecs/uda1380.c | 20 | ||||
-rw-r--r-- | sound/soc/codecs/wl1273.c | 10 |
4 files changed, 8 insertions, 77 deletions
diff --git a/sound/soc/codecs/twl6040.c b/sound/soc/codecs/twl6040.c index 0f6067f04e29..5ff2b1e4638e 100644 --- a/sound/soc/codecs/twl6040.c +++ b/sound/soc/codecs/twl6040.c @@ -1095,25 +1095,6 @@ static struct snd_soc_dai_driver twl6040_dai[] = { }, }; -#ifdef CONFIG_PM -static int twl6040_suspend(struct snd_soc_codec *codec) -{ - twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); - - return 0; -} - -static int twl6040_resume(struct snd_soc_codec *codec) -{ - twl6040_set_bias_level(codec, SND_SOC_BIAS_STANDBY); - - return 0; -} -#else -#define twl6040_suspend NULL -#define twl6040_resume NULL -#endif - static int twl6040_probe(struct snd_soc_codec *codec) { struct twl6040_data *priv; @@ -1160,7 +1141,6 @@ static int twl6040_remove(struct snd_soc_codec *codec) struct twl6040_data *priv = snd_soc_codec_get_drvdata(codec); free_irq(priv->plug_irq, codec); - twl6040_set_bias_level(codec, SND_SOC_BIAS_OFF); return 0; } @@ -1168,11 +1148,10 @@ static int twl6040_remove(struct snd_soc_codec *codec) static struct snd_soc_codec_driver soc_codec_dev_twl6040 = { .probe = twl6040_probe, .remove = twl6040_remove, - .suspend = twl6040_suspend, - .resume = twl6040_resume, .read = twl6040_read, .write = twl6040_write, .set_bias_level = twl6040_set_bias_level, + .suspend_bias_off = true, .ignore_pmdown_time = true, .controls = twl6040_snd_controls, diff --git a/sound/soc/codecs/uda134x.c b/sound/soc/codecs/uda134x.c index 32b2f78aa62c..4056260a502e 100644 --- a/sound/soc/codecs/uda134x.c +++ b/sound/soc/codecs/uda134x.c @@ -518,11 +518,6 @@ static int uda134x_soc_probe(struct snd_soc_codec *codec) uda134x_reset(codec); - if (pd->is_powered_on_standby) - uda134x_set_bias_level(codec, SND_SOC_BIAS_ON); - else - uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); - if (pd->model == UDA134X_UDA1341) { widgets = uda1341_dapm_widgets; num_widgets = ARRAY_SIZE(uda1341_dapm_widgets); @@ -574,44 +569,21 @@ static int uda134x_soc_remove(struct snd_soc_codec *codec) { struct uda134x_priv *uda134x = snd_soc_codec_get_drvdata(codec); - uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); - uda134x_set_bias_level(codec, SND_SOC_BIAS_OFF); - kfree(uda134x); return 0; } -#if defined(CONFIG_PM) -static int uda134x_soc_suspend(struct snd_soc_codec *codec) -{ - uda134x_set_bias_level(codec, SND_SOC_BIAS_STANDBY); - uda134x_set_bias_level(codec, SND_SOC_BIAS_OFF); - return 0; -} - -static int uda134x_soc_resume(struct snd_soc_codec *codec) -{ - uda134x_set_bias_level(codec, SND_SOC_BIAS_PREPARE); - uda134x_set_bias_level(codec, SND_SOC_BIAS_ON); - return 0; -} -#else -#define uda134x_soc_suspend NULL -#define uda134x_soc_resume NULL -#endif /* CONFIG_PM */ - static struct snd_soc_codec_driver soc_codec_dev_uda134x = { .probe = uda134x_soc_probe, .remove = uda134x_soc_remove, - .suspend = uda134x_soc_suspend, - .resume = uda134x_soc_resume, .reg_cache_size = sizeof(uda134x_reg), .reg_word_size = sizeof(u8), .reg_cache_default = uda134x_reg, .reg_cache_step = 1, .read = uda134x_read_reg_cache, - .write = uda134x_write, .set_bias_level = uda134x_set_bias_level, + .suspend_bias_off = true, + .dapm_widgets = uda134x_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(uda134x_dapm_widgets), .dapm_routes = uda134x_dapm_routes, diff --git a/sound/soc/codecs/uda1380.c b/sound/soc/codecs/uda1380.c index e62e70781ec2..dc7778b6dd7f 100644 --- a/sound/soc/codecs/uda1380.c +++ b/sound/soc/codecs/uda1380.c @@ -693,18 +693,6 @@ static struct snd_soc_dai_driver uda1380_dai[] = { }, }; -static int uda1380_suspend(struct snd_soc_codec *codec) -{ - uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF); - return 0; -} - -static int uda1380_resume(struct snd_soc_codec *codec) -{ - uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY); - return 0; -} - static int uda1380_probe(struct snd_soc_codec *codec) { struct uda1380_platform_data *pdata =codec->dev->platform_data; @@ -739,8 +727,6 @@ static int uda1380_probe(struct snd_soc_codec *codec) INIT_WORK(&uda1380->work, uda1380_flush_work); - /* power on device */ - uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY); /* set clock input */ switch (pdata->dac_clk) { case UDA1380_DAC_CLK_SYSCLK: @@ -766,8 +752,6 @@ static int uda1380_remove(struct snd_soc_codec *codec) { struct uda1380_platform_data *pdata =codec->dev->platform_data; - uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF); - gpio_free(pdata->gpio_reset); gpio_free(pdata->gpio_power); @@ -777,11 +761,11 @@ static int uda1380_remove(struct snd_soc_codec *codec) static struct snd_soc_codec_driver soc_codec_dev_uda1380 = { .probe = uda1380_probe, .remove = uda1380_remove, - .suspend = uda1380_suspend, - .resume = uda1380_resume, .read = uda1380_read_reg_cache, .write = uda1380_write, .set_bias_level = uda1380_set_bias_level, + .suspend_bias_off = true, + .reg_cache_size = ARRAY_SIZE(uda1380_reg), .reg_word_size = sizeof(u16), .reg_cache_default = uda1380_reg, diff --git a/sound/soc/codecs/wl1273.c b/sound/soc/codecs/wl1273.c index f3d4e88d0b7b..00aea4100bb3 100644 --- a/sound/soc/codecs/wl1273.c +++ b/sound/soc/codecs/wl1273.c @@ -452,7 +452,6 @@ static int wl1273_probe(struct snd_soc_codec *codec) { struct wl1273_core **core = codec->dev->platform_data; struct wl1273_priv *wl1273; - int r; dev_dbg(codec->dev, "%s.\n", __func__); @@ -470,12 +469,7 @@ static int wl1273_probe(struct snd_soc_codec *codec) snd_soc_codec_set_drvdata(codec, wl1273); - r = snd_soc_add_codec_controls(codec, wl1273_controls, - ARRAY_SIZE(wl1273_controls)); - if (r) - kfree(wl1273); - - return r; + return 0; } static int wl1273_remove(struct snd_soc_codec *codec) @@ -492,6 +486,8 @@ static struct snd_soc_codec_driver soc_codec_dev_wl1273 = { .probe = wl1273_probe, .remove = wl1273_remove, + .controls = wl1273_controls, + .num_controls = ARRAY_SIZE(wl1273_controls), .dapm_widgets = wl1273_dapm_widgets, .num_dapm_widgets = ARRAY_SIZE(wl1273_dapm_widgets), .dapm_routes = wl1273_dapm_routes, |