Skip to contentSkip to conversation

ASoC: rt286: set idle_bias_off to false

PATCH In review Bard Liao 3 participants 8 messages Jan 28, 2015 – Feb 7, 2015

Subsystems (3)
lore
Share & tools
lore

Bard Liao

author
#0 lore raw

PATCH 1/1 ASoC: rt286: set idle_bias_off to false

We do the power down process at bias level STANDBY. And do nothing at bias level OFF. As a result, the register setting is the same between bias level STANDBY and OFF. So we don't need to set idle_bias_off true.

---
 sound/soc/codecs/rt286.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/rt286.c +1 -1
index 847cc4b..81bdd276 100644
@@ -1144,7 +1144,7 @@ static struct snd_soc_codec_driver soc_codec_dev_rt286 = {
 	.suspend = rt286_suspend,
 	.resume = rt286_resume,
 	.set_bias_level = rt286_set_bias_level,
-	.idle_bias_off = true,
+	.idle_bias_off = false,
 	.controls = rt286_snd_controls,
 	.num_controls = ARRAY_SIZE(rt286_snd_controls),
 	.dapm_widgets = rt286_dapm_widgets,
Signature · 1 line
1.8.1.1.439.g50a6b54
maintainer
#1 lore raw

sound/soc/codecs/rt286.c static struct snd_soc_codec_driver soc_codec_dev_rt286 = { · line 1147

Quoted 7 lines · Bard Liao

We do the power down process at bias level STANDBY. And do nothing at bias level OFF. As a result, the register setting is the same between bias level STANDBY and OFF. So we don't need to set idle_bias_off true.

sound/soc/codecs/rt286.c +1 -1
-	.idle_bias_off = true,
+	.idle_bias_off = false,

There is no need to set false explicitly, it's the default. It also seems better to keep the flag if it's true, even if we don't actively do anything at the minute we may in future (either in the framework or in the driver) so the information seems useful.

author
#2 lore raw
Quoted 14 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Wednesday, January 28, 2015 7:36 PM
To: Bard Liao
Cc: [email protected]; [email protected]; Flove; Oder Chiou; [email protected]
Subject: Re: [PATCH] ASoC: rt286: set idle_bias_off to false

Quoted 4 lines · Bard Liao

We do the power down process at bias level STANDBY. And do nothing at bias level OFF. As a result, the register setting is the same between bias level STANDBY and OFF. So we don't need to set idle_bias_off true.

Quoted 7 lines

sound/soc/codecs/rt286.c static struct snd_soc_codec_driver soc_codec_dev_rt286 = { · line 1147

Quoted 2 lines
sound/soc/codecs/rt286.c +1 -1
-	.idle_bias_off = true,
+	.idle_bias_off = false,

There is no need to set false explicitly, it's the default. It also seems better to keep the flag if it's true, even if we don't actively do anything at the minute we may in future (either in the framework or in the driver) so the information seems useful.

Actually, we meet an issue. We use force enable in rt286_jack_detect. If a headset is inserted, the bias_level will not be OFF due to some widgets are ON. If idle_bias_off is true, rt286_suspend will not be invoked in suspend. And I "guess" rt286's power will be cut off in suspend. That's what we handle in rt286_suspend/resume functions. If rt286 's power is cut off and don't re-sync the cache, it will cause some unexpected issues.

Is there any good way to fix such issues?

Thanks.

Quoted 2 lines

------Please consider the environment before printing this e-mail.

maintainer
#3 lore raw
Quoted 9 lines · Bard Liao
Quoted 7 lines

sound/soc/codecs/rt286.c static struct snd_soc_codec_driver soc_codec_dev_rt286 = { · line 1147

Quoted 2 lines
sound/soc/codecs/rt286.c +1 -1
-	.idle_bias_off = true,
+	.idle_bias_off = false,

There is no need to set false explicitly, it's the default. It also seems better to keep the flag if it's true, even if we don't actively do anything at the minute we may in future (either in the framework or in the driver) so the information seems useful.

Actually, we meet an issue. We use force enable in rt286_jack_detect. If

So, this is one of the reasons why people ask for good, clear changelogs...

Quoted 7 lines

a headset is inserted, the bias_level will not be OFF due to some widgets are ON. If idle_bias_off is true, rt286_suspend will not be invoked in suspend. And I "guess" rt286's power will be cut off in suspend. That's what we handle in rt286_suspend/resume functions. If rt286 's power is cut off and don't re-sync the cache, it will cause some unexpected issues.

Is there any good way to fix such issues?

If jack detection should be disabled over suspend the machine driver should do that (eg, by setting a NULL jack). It's actually common for systems to leave jack detection up over suspend as in systems like phones the jack can be a wake source, the hook switch is commonly expected to always be operational.

#4 lore raw

~Keyon

Quoted 28 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Thursday, January 29, 2015 4:10 AM
To: Bard Liao
Cc: [email protected]; [email protected]; Flove; Oder Chiou; Jie, Yang
Subject: Re: [PATCH] ASoC: rt286: set idle_bias_off to false

Quoted 10 lines · Bard Liao
Quoted 7 lines

sound/soc/codecs/rt286.c static struct snd_soc_codec_driver soc_codec_dev_rt286 = { · line 1147

Quoted 2 lines
sound/soc/codecs/rt286.c +1 -1
-	.idle_bias_off = true,
+	.idle_bias_off = false,

There is no need to set false explicitly, it's the default. It also seems better to keep the flag if it's true, even if we don't actively do anything at the minute we may in future (either in the framework or in the driver) so the information seems useful.

Actually, we meet an issue. We use force enable in rt286_jack_detect. If

So, this is one of the reasons why people ask for good, clear changelogs...

Quoted 5 lines

a headset is inserted, the bias_level will not be OFF due to some widgets are ON. If idle_bias_off is true, rt286_suspend will not be invoked in suspend. And I "guess" rt286's power will be cut off in suspend. That's what we handle in rt286_suspend/resume functions. If rt286 's power is cut off and don't re-sync the cache, it will cause some

Quoted 7 lines

unexpected issues.

Quoted 1 line

Is there any good way to fix such issues?

If jack detection should be disabled over suspend the machine driver should do that (eg, by setting a NULL jack). It's actually common for systems to leave jack detection up over suspend as in systems like phones the jack can be a wake

[Keyon] as my understanding, setting idle_bias_off to false won't disable jack detection over suspend, only the action that poweroff the codec will disable it, Bard, is it correct?

setting idle_bias_off to false is the easiest solution for us, it is also reasonable here, because rt286 don't need soc core to set BIAS OFF specially when in idle status, (BIAS_OFF and BIAS_STANDBY are same for it), and seems no side effect here.

Quoted 1 line

source, the hook switch is commonly expected to always be operational.

maintainer
#5 lore raw

On Thu, Jan 29, 2015 at 09:07:08AM +0000, Jie, Yang wrote:

Please fix your mailer to word wrap within paragraphs, your mails are very hard to read.

Quoted 6 lines
Quoted 3 lines

If jack detection should be disabled over suspend the machine driver should do that (eg, by setting a NULL jack). It's actually common for systems to leave jack detection up over suspend as in systems like phones the jack can be a wake

[Keyon] as my understanding, setting idle_bias_off to false won't disable jack detection over suspend, only the action that poweroff the codec will disable it, Bard, is it correct?

Right, you've got it the wrong way round - the goal is turn off the widgets that are holding the device on.

Quoted 3 lines

setting idle_bias_off to false is the easiest solution for us, it is also reasonable here, because rt286 don't need soc core to set BIAS OFF specially when in idle status, (BIAS_OFF and BIAS_STANDBY are same for it), and seems no side effect here.

Currently. And to be honest I would have expected that the behaviour would be the same with widgets on regardless of the bias level so we probably want to fix that which would cause the same problem resurface even if it were bodged around for now.

#6 lore raw
Quoted 9 lines

-----Original Message-----
From: Mark Brown [mailto:[email protected]]
Sent: Thursday, January 29, 2015 6:52 PM
To: Jie, Yang
Cc: Bard Liao; [email protected]; [email protected]; Flove; Oder Chiou
Subject: Re: [PATCH] ASoC: rt286: set idle_bias_off to false

Quoted 4 lines

On Thu, Jan 29, 2015 at 09:07:08AM +0000, Jie, Yang wrote:

Please fix your mailer to word wrap within paragraphs, your mails are very hard to read.

[Keyon] sorry for that, should fix it this time.

Quoted 16 lines
Quoted 8 lines
Quoted 5 lines

If jack detection should be disabled over suspend the machine driver should do that (eg, by setting a NULL jack). It's actually common for systems to leave jack detection up over suspend as in systems like phones the jack can be a wake

[Keyon] as my understanding, setting idle_bias_off to false won't disable jack detection over suspend, only the action that poweroff the codec

will disable it, Bard, is it correct?

Right, you've got it the wrong way round - the goal is turn off the widgets that are holding the device on.

Quoted 3 lines

setting idle_bias_off to false is the easiest solution for us, it is also reasonable here, because rt286 don't need soc core to set BIAS OFF specially when in idle status, (BIAS_OFF and BIAS_STANDBY are same for

Quoted 6 lines

it), and seems no side effect here.

Currently. And to be honest I would have expected that the behaviour would be the same with widgets on regardless of the bias level so we probably want to fix that which would cause the same problem resurface even if it were bodged around for now.

[Keyon] OK, then I will try disable jack detection in the machine driver before calling snd_soc_suspend(), can you share example about how to set a NULL jack?

maintainer
#7 lore raw
Quoted 11 lines · Yang
Quoted 9 lines
Quoted 3 lines

setting idle_bias_off to false is the easiest solution for us, it is also reasonable here, because rt286 don't need soc core to set BIAS OFF specially when in idle status, (BIAS_OFF and BIAS_STANDBY are same for

it), and seems no side effect here.

Currently. And to be honest I would have expected that the behaviour would be the same with widgets on regardless of the bias level so we probably want to fix that which would cause the same problem resurface even if it were bodged around for now.

[Keyon] OK, then I will try disable jack detection in the machine driver before calling snd_soc_suspend(), can you share example about how to set a NULL jack?

Several of the Wolfson drivers support setting a NULL jack to disable detection, I can't think of any boards that currently use it due to the need to use detection in suspend on platforms.

Looks like word wrapping is still not working in your mailer BTW.