[alsa-devel] [PATCH 0/2] ASoC: tlv320dac33: small power handling updates
Hello,
While testing suspend, it has been noticed, that the driver would try to power off the codec more than once. Since this case handled in the driver, and results no functional defect we can lower the noise in the kernel log.
Also avoid the root cause of the multiple off calls by filtering BIAS_OFF request when the codec was already OFF.
--- Felipe Balbi (1): ASoC: tlv320dac33: Use dev_dbg in dac33_hard_power function
Peter Ujfalusi (1): ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF
sound/soc/codecs/tlv320dac33.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
From: Felipe Balbi felipe.balbi@nokia.com
Since the cases when the same power state would be set again handled gracefully, we do not need to use dev_warn.
Signed-off-by: Felipe Balbi felipe.balbi@nokia.com Signed-off-by: Peter Ujfalusi peter.ujfalusi@nokia.com --- sound/soc/codecs/tlv320dac33.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index 007fe83..ad1795a 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -352,7 +352,7 @@ static int dac33_hard_power(struct snd_soc_codec *codec, int power)
/* Safety check */ if (unlikely(power == dac33->chip_power)) { - dev_warn(codec->dev, "Trying to set the same power state: %s\n", + dev_dbg(codec->dev, "Trying to set the same power state: %s\n", power ? "ON" : "OFF"); goto exit; }
Avoid calling the dac33_hard_power when the codec was already in BIAS_OFF state. This could happen in device suspend and module removal time.
Signed-off-by: Peter Ujfalusi peter.ujfalusi@nokia.com --- sound/soc/codecs/tlv320dac33.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index ad1795a..bcf6d93 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c @@ -589,6 +589,9 @@ static int dac33_set_bias_level(struct snd_soc_codec *codec, } break; case SND_SOC_BIAS_OFF: + /* Do not power off, when the codec is already off */ + if (codec->bias_level == SND_SOC_BIAS_OFF) + return 0; ret = dac33_hard_power(codec, 0); if (ret != 0) return ret;
On Mon, May 17, 2010 at 02:21:44PM +0300, Peter Ujfalusi wrote:
Felipe Balbi (1): ASoC: tlv320dac33: Use dev_dbg in dac33_hard_power function
Peter Ujfalusi (1): ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF
Both
Acked-by: Mark Brown broonie@opensource.wolfsonmicro.com
On Mon, 2010-05-17 at 14:21 +0300, Peter Ujfalusi wrote:
Hello,
While testing suspend, it has been noticed, that the driver would try to power off the codec more than once. Since this case handled in the driver, and results no functional defect we can lower the noise in the kernel log.
Also avoid the root cause of the multiple off calls by filtering BIAS_OFF request when the codec was already OFF.
Felipe Balbi (1): ASoC: tlv320dac33: Use dev_dbg in dac33_hard_power function
Peter Ujfalusi (1): ASoC: tlv320dac33: Avoid powering off while in BIAS_OFF
sound/soc/codecs/tlv320dac33.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
Applied.
Thanks
Liam
participants (3)
-
Liam Girdwood
-
Mark Brown
-
Peter Ujfalusi