Turn off Microphone bias for AMIC2 (Yocto)

Hello!

I am trying to turn off the mic bias for AMIC2 (https://github.com/torvalds/linux/blob/master/arch/arm64/boot/dts/qcom/apq8016-sbc.dts#L356). I imagined it would be as simple as changing this value but I was wrong. I went into the driver and changed the values around in that as well.

I am using a custom kernel based around 5.5. Any advice?

@danielt @ljking Sorry to bother you. any ideas?

@srini Sorry to bother you. any ideas?

As per dts AMIC2 is connected to MICBIAS2, this should only be ON when AMIC2 is active(i.e recording)
If this is not the case, you could update the routing in the dts to reflect board specific wiring.

Could you tell the reason why you want to disable this?
–srini

I am seeing a bias even with AMIC2 not active. is the area you are talking about in the “qcom,audio-routing”? and with that I would change AMIC to an external bias? when I tried that I was still seeing a bias on the board.

The reason I am turning it off is with the project I am working on that line has a mic that does not need a bias. The circuit I am playing with has an external bias after the audio jack and its creating issues with audio quality.

This “AMIC2”, “MIC BIAS Internal2” entry in qcom,audio-routing is saying that when AMIC2 is used switch on “MIC BIAS Internal2” .
Can you try to remove this line in dts and see if it helps.

@srini I just started the build of testing the change of removing the amic2 entry. What is the difference in removing it vs changing it from “AMIC2”, “MIC BIAS Internal2” to “AMIC2”, “MIC BIAS External2”?

"AMIC2”, “MIC BIAS Internal2” will turn on Internal switch from internal MICBIAS
“AMIC2”, “MIC BIAS External2” this will not turn on the internal switch expecting that the micbias is supplied from another external source, You could add DAPM widgets to name that external source in your board file and add routing to AMIC2.

@srini
I finish the talk spoke about above. I am still seeing a bias with the amic2 with "AMIC2”, “MIC BIAS Internal2” removed as well as with the code switched to external. The odd thing to me is I see the bias as long as something is plugged into the jack.

I went back to an old kernel (4.4) from some really early builds I started playing with and that line had no bias. so I know its not the hardware.

I went into the msm8916-wcd-analog.c file and changed all of the bool values for “micbias_enabled” to false hoping that that would never let it change. Still see the bias.

Any other ideas for me to test?

Can you try commenting out call to pm8916_wcd_setup_mbhc(), looks like we are enabling MICBIAS Method for MBHC by default, we could internal current source instead of MICBIAS.
I can dig up more info on how to handle this properly.

–srini

commenting that function out does disable the bias. Thank you