diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2014-10-20 04:56:33 -0400 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-10-22 06:29:45 -0400 |
commit | a613cc4063a315efe36f233006f424e958ef4e67 (patch) | |
tree | cd1880a3e7ef61e6097f1243acb871979f068c30 | |
parent | f114040e3ea6e07372334ade75d1ee0775c355e1 (diff) |
ASoC: max98088: Cleanup manual bias level transitions
Set the CODEC driver's suspend_bias_off flag rather than manually going to
SND_SOC_BIAS_OFF in suspend and SND_SOC_BIAS_STANDBY in resume. This makes
the code a bit shorter and cleaner.
Since the ASoC core now takes care of setting the bias level to
SND_SOC_BIAS_OFF when removing the CODEC there is no need to do it manually
anymore either.
The manual transition to SND_SOC_BIAS_STANDBY at the end of CODEC probe()
can also be removed as the core will automatically do this after the CODEC
has been probed.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | sound/soc/codecs/max98088.c | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/sound/soc/codecs/max98088.c b/sound/soc/codecs/max98088.c index 2cd3e5427441..bb892b3178dc 100644 --- a/sound/soc/codecs/max98088.c +++ b/sound/soc/codecs/max98088.c | |||
@@ -1887,25 +1887,6 @@ static void max98088_handle_pdata(struct snd_soc_codec *codec) | |||
1887 | max98088_handle_eq_pdata(codec); | 1887 | max98088_handle_eq_pdata(codec); |
1888 | } | 1888 | } |
1889 | 1889 | ||
1890 | #ifdef CONFIG_PM | ||
1891 | static int max98088_suspend(struct snd_soc_codec *codec) | ||
1892 | { | ||
1893 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
1894 | |||
1895 | return 0; | ||
1896 | } | ||
1897 | |||
1898 | static int max98088_resume(struct snd_soc_codec *codec) | ||
1899 | { | ||
1900 | max98088_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
1901 | |||
1902 | return 0; | ||
1903 | } | ||
1904 | #else | ||
1905 | #define max98088_suspend NULL | ||
1906 | #define max98088_resume NULL | ||
1907 | #endif | ||
1908 | |||
1909 | static int max98088_probe(struct snd_soc_codec *codec) | 1890 | static int max98088_probe(struct snd_soc_codec *codec) |
1910 | { | 1891 | { |
1911 | struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); | 1892 | struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); |
@@ -1946,9 +1927,6 @@ static int max98088_probe(struct snd_soc_codec *codec) | |||
1946 | 1927 | ||
1947 | snd_soc_write(codec, M98088_REG_51_PWR_SYS, M98088_PWRSV); | 1928 | snd_soc_write(codec, M98088_REG_51_PWR_SYS, M98088_PWRSV); |
1948 | 1929 | ||
1949 | /* initialize registers cache to hardware default */ | ||
1950 | max98088_set_bias_level(codec, SND_SOC_BIAS_STANDBY); | ||
1951 | |||
1952 | snd_soc_write(codec, M98088_REG_0F_IRQ_ENABLE, 0x00); | 1930 | snd_soc_write(codec, M98088_REG_0F_IRQ_ENABLE, 0x00); |
1953 | 1931 | ||
1954 | snd_soc_write(codec, M98088_REG_22_MIX_DAC, | 1932 | snd_soc_write(codec, M98088_REG_22_MIX_DAC, |
@@ -1974,7 +1952,6 @@ static int max98088_remove(struct snd_soc_codec *codec) | |||
1974 | { | 1952 | { |
1975 | struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); | 1953 | struct max98088_priv *max98088 = snd_soc_codec_get_drvdata(codec); |
1976 | 1954 | ||
1977 | max98088_set_bias_level(codec, SND_SOC_BIAS_OFF); | ||
1978 | kfree(max98088->eq_texts); | 1955 | kfree(max98088->eq_texts); |
1979 | 1956 | ||
1980 | return 0; | 1957 | return 0; |
@@ -1983,9 +1960,9 @@ static int max98088_remove(struct snd_soc_codec *codec) | |||
1983 | static struct snd_soc_codec_driver soc_codec_dev_max98088 = { | 1960 | static struct snd_soc_codec_driver soc_codec_dev_max98088 = { |
1984 | .probe = max98088_probe, | 1961 | .probe = max98088_probe, |
1985 | .remove = max98088_remove, | 1962 | .remove = max98088_remove, |
1986 | .suspend = max98088_suspend, | ||
1987 | .resume = max98088_resume, | ||
1988 | .set_bias_level = max98088_set_bias_level, | 1963 | .set_bias_level = max98088_set_bias_level, |
1964 | .suspend_bias_off = true, | ||
1965 | |||
1989 | .controls = max98088_snd_controls, | 1966 | .controls = max98088_snd_controls, |
1990 | .num_controls = ARRAY_SIZE(max98088_snd_controls), | 1967 | .num_controls = ARRAY_SIZE(max98088_snd_controls), |
1991 | .dapm_widgets = max98088_dapm_widgets, | 1968 | .dapm_widgets = max98088_dapm_widgets, |