linux/sound
Stephan Gerhold 65fe457e7b
ASoC: msm8916-wcd-analog: Simplify MIC BIAS Internal
At the moment, MIC BIAS Internal* and MIC BIAS External* both reference
the same register, and have a part of their initialization sequence
duplicated.

For example, the sequence for enabling MIC BIAS Internal1 is:
  I1. Enable MIC_BIAS1 supply (MICB_EN bit in CDC_A_MICB_1_EN)
  I2. Enable internal RBIAS (TX1_INT_RBIAS_EN bit in CDC_A_MICB_1_INT_RBIAS)

The sequence for enabling MIC BIAS External1 is:
  E1. Enable MIC_BIAS1 supply (MICB_EN bit in CDC_A_MICB_1_EN)
  (E2. Ideally, make sure internal RBIAS is disabled. However, this should
   not happen in practice because DAPM will disable unused supplies...)

Right now we have:
  SND_SOC_DAPM_SUPPLY("MIC BIAS Internal1", CDC_A_MICB_1_EN, 7, 0, ...) // I1
  SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0, ...) // E1
and I2 is done in the PM event handler (pm8916_wcd_analog_enable_micbias_int1).

We can simplify this by defining a common DAPM supply for I1/E1 ("MIC_BIAS1"),
and one DAPM supply for I2 ("MIC BIAS Internal1"). Additional DAPM routes
ensure that we also enable the MIC_BIAS1 supply for the internal and external
pull up resistor.

Another advantage of this is that we now disable the internal RBIAS
when it is not needed. This makes it much easier to add support for
MIC BIAS Internal3 as a next step.

Tested-by: Nikita Travkin <nikitos.tr@gmail.com> # longcheer-l8150
Cc: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Signed-off-by: Stephan Gerhold <stephan@gerhold.net>
Reviewed-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org>
Link: https://lore.kernel.org/r/20200114181229.42302-1-stephan@gerhold.net
Signed-off-by: Mark Brown <broonie@kernel.org>
2020-01-17 15:39:32 +00:00
..
ac97
aoa ALSA: aoa: Avoid non-standard macro usage 2019-11-06 15:47:43 +01:00
arm ASoC: pxa: remove snd_pcm_ops 2019-10-08 13:47:20 +01:00
atmel
core sound updates #2 for 5.5-rc1 2019-12-06 13:06:14 -08:00
drivers ALSA: aloop: Avoid pointer dereference before null-check 2019-11-27 12:16:00 +01:00
firewire Merge branch 'for-linus' into for-next 2019-11-07 16:27:55 +01:00
hda ALSA: hda: Modify stream stripe mask only when needed 2019-12-03 07:46:30 +01:00
i2c
isa ALSA: cs4236: fix error return comparison of an unsigned integer 2019-11-22 14:21:27 +01:00
mips ALSA: mips: Convert to the common vmalloc memalloc 2019-11-06 15:47:43 +01:00
oss compat_ioctl: remove translation for sound ioctls 2019-10-23 17:23:45 +02:00
parisc
pci ALSA: hda: hdmi - Keep old slot assignment behavior for Intel platforms 2019-12-03 20:33:05 +01:00
pcmcia ALSA: pdaudiocf: Convert to the common vmalloc memalloc 2019-11-06 15:47:42 +01:00
ppc
sh ALSA: sh: Remove superfluous snd_dma_continuous_data() 2019-11-06 15:47:41 +01:00
soc ASoC: msm8916-wcd-analog: Simplify MIC BIAS Internal 2020-01-17 15:39:32 +00:00
sparc ALSA: sparc: Remove superfluous snd_dma_continuous_data() 2019-11-06 15:47:41 +01:00
spi
synth
usb ALSA: usb-audio: Fix Focusrite Scarlett 6i6 gen1 - input handling 2019-11-25 16:49:35 +01:00
x86 ALSA: intel_hdmi: Remove dev_err() on platform_get_irq() failure 2019-10-25 14:43:23 +02:00
xen
ac97_bus.c
Kconfig
last.c
Makefile
sound_core.c sound: fix a memory leak bug 2019-08-08 08:18:32 +02:00