lkml.org 
[lkml]   [2016]   [Aug]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [linux-sunxi] Re: [PATCH v9 2/2] Add mixer controls: Line-In, FM-In, Mic 2, Capture Source, Differential Line-In.
On Wed, Aug 31, 2016 at 3:40 PM, Danny Milosavljevic
<dannym@scratchpost.org> wrote:
>> And what about microphone bias?
>
> Would this be OK?
>
> static int sun4i_codec_handle_mic_bias_event(struct snd_soc_dapm_widget *w,
> struct snd_kcontrol *k, int event)
> {
> struct sun4i_codec *scodec = snd_soc_card_get_drvdata(w->dapm->card);
> if (SND_SOC_DAPM_EVENT_ON(event))
> regmap_update_bits(scodec->regmap,
> SUN4I_CODEC_ADC_ACTL,
> BIT(SUN4I_CODEC_ADC_ACTL_VMICEN),
> BIT(SUN4I_CODEC_ADC_ACTL_VMICEN));
> else
> regmap_update_bits(scodec->regmap,
> SUN4I_CODEC_ADC_ACTL,
> BIT(SUN4I_CODEC_ADC_ACTL_VMICEN),
> 0);
> }
>
> static const struct snd_soc_dapm_widget sun4i_codec_codec_dapm_widgets[] = {
> ...
> SND_SOC_DAPM_MIC("Mic1", sun4i_codec_handle_mic_bias_event),
> SND_SOC_DAPM_MIC("Mic2", sun4i_codec_handle_mic_bias_event),
>
> Do I then remove
>
> SND_SOC_DAPM_SUPPLY("VMIC", SUN4I_CODEC_ADC_ACTL,
> SUN4I_CODEC_ADC_ACTL_VMICEN, 0, NULL, 0),
>
> completely? What about the routes?

My apologies. I didn't notice that VMIC was already in the driver.
In that your original patch did everything right.

ChenYu

\
 
 \ /
  Last update: 2016-09-17 09:58    [W:2.228 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site