aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/uda1380.c
diff options
context:
space:
mode:
authorLars-Peter Clausen <lars@metafoo.de>2014-11-23 09:04:14 -0500
committerMark Brown <broonie@kernel.org>2014-11-24 13:05:08 -0500
commite8125f04421f7757df0017a59cd9b756148ee769 (patch)
treeb311b832777bcbc74ea9b335aa66569934645d9f /sound/soc/codecs/uda1380.c
parentf114040e3ea6e07372334ade75d1ee0775c355e1 (diff)
ASoC: uda1380: 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>
Diffstat (limited to 'sound/soc/codecs/uda1380.c')
-rw-r--r--sound/soc/codecs/uda1380.c20
1 files changed, 2 insertions, 18 deletions
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[] = {
693}, 693},
694}; 694};
695 695
696static int uda1380_suspend(struct snd_soc_codec *codec)
697{
698 uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF);
699 return 0;
700}
701
702static int uda1380_resume(struct snd_soc_codec *codec)
703{
704 uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
705 return 0;
706}
707
708static int uda1380_probe(struct snd_soc_codec *codec) 696static int uda1380_probe(struct snd_soc_codec *codec)
709{ 697{
710 struct uda1380_platform_data *pdata =codec->dev->platform_data; 698 struct uda1380_platform_data *pdata =codec->dev->platform_data;
@@ -739,8 +727,6 @@ static int uda1380_probe(struct snd_soc_codec *codec)
739 727
740 INIT_WORK(&uda1380->work, uda1380_flush_work); 728 INIT_WORK(&uda1380->work, uda1380_flush_work);
741 729
742 /* power on device */
743 uda1380_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
744 /* set clock input */ 730 /* set clock input */
745 switch (pdata->dac_clk) { 731 switch (pdata->dac_clk) {
746 case UDA1380_DAC_CLK_SYSCLK: 732 case UDA1380_DAC_CLK_SYSCLK:
@@ -766,8 +752,6 @@ static int uda1380_remove(struct snd_soc_codec *codec)
766{ 752{
767 struct uda1380_platform_data *pdata =codec->dev->platform_data; 753 struct uda1380_platform_data *pdata =codec->dev->platform_data;
768 754
769 uda1380_set_bias_level(codec, SND_SOC_BIAS_OFF);
770
771 gpio_free(pdata->gpio_reset); 755 gpio_free(pdata->gpio_reset);
772 gpio_free(pdata->gpio_power); 756 gpio_free(pdata->gpio_power);
773 757
@@ -777,11 +761,11 @@ static int uda1380_remove(struct snd_soc_codec *codec)
777static struct snd_soc_codec_driver soc_codec_dev_uda1380 = { 761static struct snd_soc_codec_driver soc_codec_dev_uda1380 = {
778 .probe = uda1380_probe, 762 .probe = uda1380_probe,
779 .remove = uda1380_remove, 763 .remove = uda1380_remove,
780 .suspend = uda1380_suspend,
781 .resume = uda1380_resume,
782 .read = uda1380_read_reg_cache, 764 .read = uda1380_read_reg_cache,
783 .write = uda1380_write, 765 .write = uda1380_write,
784 .set_bias_level = uda1380_set_bias_level, 766 .set_bias_level = uda1380_set_bias_level,
767 .suspend_bias_off = true,
768
785 .reg_cache_size = ARRAY_SIZE(uda1380_reg), 769 .reg_cache_size = ARRAY_SIZE(uda1380_reg),
786 .reg_word_size = sizeof(u16), 770 .reg_word_size = sizeof(u16),
787 .reg_cache_default = uda1380_reg, 771 .reg_cache_default = uda1380_reg,