Skip to contentSkip to conversation

ASoC: twl6040: Workaround for headset DC offset caused pop noise

PATCH Superseded Peter Ujfalusi 2 participants 7 messages Oct 11, 2011 – Oct 12, 2011

Subsystems (3)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ASoC: twl6040: Workaround for headset DC offset caused pop noise

Both Headset DAC need to be enabled at the same time, before any of the output drivers are enabled.

---
 include/linux/mfd/twl6040.h |    1 +
 sound/soc/codecs/twl6040.c  |   42 ++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 41 insertions(+), 2 deletions(-)
include/linux/mfd/twl6040.h +1 -0
index d9e05ea..0bbb1e7 100644
@@ -122,6 +122,7 @@
 
 /* HSLCTL/R (0x10/0x11) fields */
 
+#define TWL6040_HSDACENA		(1 << 0)
 #define TWL6040_HSDACMODE		(1 << 1)
 #define TWL6040_HSDRVMODE		(1 << 3)
 
sound/soc/codecs/twl6040.c +40 -2

63 lines not on this page · raw message

Signature · 1 line
1.7.7
#1 lore raw
Quoted 2 lines · Peter Ujfalusi

Both Headset DAC need to be enabled at the same time, before any of the output drivers are enabled.

This sounds like you should be using a supply widget to do the reference counting here?

#2 lore raw
Quoted 6 lines · On Tuesday 11 October 2011 14:29:21 Mark Brown wrote:
Quoted 2 lines · Peter Ujfalusi

Both Headset DAC need to be enabled at the same time, before any of the output drivers are enabled.

This sounds like you should be using a supply widget to do the reference counting here?

Probably it is better to move the whole thing to be handled by a supply widget (attached to the HS DACs).
It will not mess up the sequence, and I'm not going to need to count in the driver.
Will rewrite the patch.

Thanks for the suggestion,
Péter

#3 lore raw
Quoted 8 lines · On Wednesday 12 October 2011 11:18:50 Péter Ujfalusi wrote:
Quoted 2 lines

This sounds like you should be using a supply widget to do the reference counting here?

Probably it is better to move the whole thing to be handled by a supply widget (attached to the HS DACs).
It will not mess up the sequence, and I'm not going to need to count in the driver.
Will rewrite the patch.

I can not move the HS DAC power on/off to be handled by a supply widget... Refcounting in a supply widget will not work for the power down, since the supply widget will be turned off after the DAC widget. At time when the DAC receives the PMD event the attached supply is still on.
I can update the commit message to explicitly say that we need to turn on both HS DAC at the same time, and we need to turn tem off at the same time.

--
Péter

#4 lore raw
Quoted 6 lines · Péter Ujfalusi

I can not move the HS DAC power on/off to be handled by a supply widget... Refcounting in a supply widget will not work for the power down, since the supply widget will be turned off after the DAC widget. At time when the DAC receives the PMD event the attached supply is still on.
I can update the commit message to explicitly say that we need to turn on both HS DAC at the same time, and we need to turn tem off at the same time.

I still don't understand what the problem is. If nothing else you can do random register writes from an event on a supply widget...

#5 lore raw
Quoted 11 lines · On Wednesday 12 October 2011 10:46:25 Mark Brown wrote:
Quoted 8 lines · Péter Ujfalusi

I can not move the HS DAC power on/off to be handled by a supply widget... Refcounting in a supply widget will not work for the power down, since the supply widget will be turned off after the DAC widget. At time when the DAC receives the PMD event the attached supply is still on.
I can update the commit message to explicitly say that we need to turn on both HS DAC at the same time, and we need to turn tem off at the same time.

I still don't understand what the problem is. If nothing else you can do random register writes from an event on a supply widget...

I still have the code for the out of order McPDM shutdown which is using a supply widget attached to the codec's DAC/ADC.
The ordering of the two supply is not written in stone when both are attached to the same DAC.
Yes, I'm evaluating the possibility of the reordering the shutdown sequence in the core as you have suggested a while back.

For this patch: I will merge the two DAC to one, and handle both of them in a single DAC widget. I have tested this and works fine.

--
Péter

#6 lore raw
Quoted 9 lines · Péter Ujfalusi
Quoted 2 lines · On Wednesday 12 October 2011 10:46:25 Mark Brown wrote:

I still don't understand what the problem is. If nothing else you can do random register writes from an event on a supply widget...

I still have the code for the out of order McPDM shutdown which is using a supply widget attached to the codec's DAC/ADC.
The ordering of the two supply is not written in stone when both are attached to the same DAC.

SUPPLY_S.