From patchwork Sun Mar 5 13:49:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 9604623 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 63F2460414 for ; Sun, 5 Mar 2017 13:50:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4B1CF283B3 for ; Sun, 5 Mar 2017 13:50:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3E83E2843F; Sun, 5 Mar 2017 13:50:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=no version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2EDD1283B3 for ; Sun, 5 Mar 2017 13:50:13 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 5D2AC266BBC; Sun, 5 Mar 2017 14:50:11 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id 34476266BE6; Sun, 5 Mar 2017 14:50:09 +0100 (CET) Received: from forward2p.cmail.yandex.net (forward2p.cmail.yandex.net [77.88.31.17]) by alsa0.perex.cz (Postfix) with ESMTP id 8244A26686A for ; Sun, 5 Mar 2017 14:50:00 +0100 (CET) Received: from mxback2g.mail.yandex.net (mxback2g.mail.yandex.net [IPv6:2a02:6b8:0:1472:2741:0:8b7:163]) by forward2p.cmail.yandex.net (Yandex) with ESMTP id 6E6CD21386; Sun, 5 Mar 2017 16:50:00 +0300 (MSK) Received: from web16g.yandex.ru (web16g.yandex.ru [95.108.252.116]) by mxback2g.mail.yandex.net (nwsmtp/Yandex) with ESMTP id aiuXUBZL7z-nxpeICkn; Sun, 05 Mar 2017 16:49:59 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aosc.xyz; s=mail; t=1488721799; bh=q6JpvcLFSrL6ouvWNr2yhTpfYLaRxRtmYkbTTzWDg3I=; h=From:To:Cc:In-Reply-To:References:Subject:Message-Id:Date; b=Ls/vRSTtp2KJSKK84oDnJ46E61nUdI0dcxfWtOSUi9URDyKisopixI5fCVZGmYdoh WXYy80dQ+M8ZcKfJ+uk2bUTzRHwsBYRlOMgjrUjr6Mu+mYDtebDG4BM/JXLuQUMG56 g5Pg5VIesIe4Meho3Dkus8+B6tMMljS3e0OADq5s= Authentication-Results: mxback2g.mail.yandex.net; dkim=pass header.i=@aosc.xyz Received: by web16g.yandex.ru with HTTP; Sun, 05 Mar 2017 16:49:59 +0300 From: Icenowy Zheng To: Vinod Koul , Rob Herring , Maxime Ripard , Chen-Yu Tsai , Mark Brown In-Reply-To: <20170305133709.6288-4-icenowy@aosc.xyz> References: <20170305133709.6288-1-icenowy@aosc.xyz> <20170305133709.6288-4-icenowy@aosc.xyz> MIME-Version: 1.0 Message-Id: <6803451488721799@web16g.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Sun, 05 Mar 2017 21:49:59 +0800 Cc: "devicetree@vger.kernel.org" , "alsa-devel@alsa-project.org" , "linux-kernel@vger.kernel.org" , "linux-sunxi@googlegroups.com" , "dmaengine@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [alsa-devel] [PATCH v2 03/12] ASoC: sun8i-codec-analog: split out mbias X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 05.03.2017, 21:38, "Icenowy Zheng" : > Allwinner V3s features an analog codec without MBIAS pin. > > Split out this part, in order to prepare for the V3s analog codec. > > Signed-off-by: Icenowy Zheng > --- >  sound/soc/sunxi/sun8i-codec-analog.c | 34 +++++++++++++++++++++++++++++----- >  1 file changed, 29 insertions(+), 5 deletions(-) > Sorry a definiation of has_mbias is mising in the patch... It's > diff --git a/sound/soc/sunxi/sun8i-codec-analog.c b/sound/soc/sunxi/sun8i-codec-analog.c > index 6c17c99c2c8d..af56afe5c403 100644 > --- a/sound/soc/sunxi/sun8i-codec-analog.c > +++ b/sound/soc/sunxi/sun8i-codec-analog.c > @@ -289,11 +289,6 @@ static const struct snd_soc_dapm_widget sun8i_codec_common_widgets[] = { >          /* Microphone input */ >          SND_SOC_DAPM_INPUT("MIC1"), > > - /* Microphone Bias */ > - SND_SOC_DAPM_SUPPLY("MBIAS", SUN8I_ADDA_MIC1G_MICBIAS_CTRL, > - SUN8I_ADDA_MIC1G_MICBIAS_CTRL_MMICBIASEN, > - 0, NULL, 0), > - >          /* Mic input path */ >          SND_SOC_DAPM_PGA("Mic1 Amplifier", SUN8I_ADDA_MIC1G_MICBIAS_CTRL, >                           SUN8I_ADDA_MIC1G_MICBIAS_CTRL_MIC1AMPEN, 0, NULL, 0), > @@ -453,6 +448,27 @@ static int sun8i_codec_add_headphone(struct snd_soc_component *cmpnt) >          return 0; >  } > > +/* mbias specific widget */ > +static const struct snd_soc_dapm_widget sun8i_codec_mbias_widgets[] = { > + SND_SOC_DAPM_SUPPLY("MBIAS", SUN8I_ADDA_MIC1G_MICBIAS_CTRL, > + SUN8I_ADDA_MIC1G_MICBIAS_CTRL_MMICBIASEN, > + 0, NULL, 0), > +}; > + > +static int sun8i_codec_add_mbias(struct snd_soc_component *cmpnt) > +{ > + struct snd_soc_dapm_context *dapm = snd_soc_component_get_dapm(cmpnt); > + struct device *dev = cmpnt->dev; > + int ret; > + > + ret = snd_soc_dapm_new_controls(dapm, sun8i_codec_mbias_widgets, > + ARRAY_SIZE(sun8i_codec_mbias_widgets)); > + if (ret) > + dev_err(dev, "Failed to add MBIAS DAPM widgets: %d\n", ret); > + > + return ret; > +} > + >  /* hmic specific widget */ >  static const struct snd_soc_dapm_widget sun8i_codec_hmic_widgets[] = { >          SND_SOC_DAPM_SUPPLY("HBIAS", SUN8I_ADDA_MIC1G_MICBIAS_CTRL, > @@ -686,12 +702,14 @@ static const struct sun8i_codec_analog_quirks sun8i_a23_quirks = { >          .has_headphone = true, >          .has_hmic = true, >          .has_linein = true, > + .has_mbias = true, >          .has_mic2 = true, >  }; > >  static const struct sun8i_codec_analog_quirks sun8i_h3_quirks = { >          .has_linein = true, >          .has_lineout = true, > + .has_mbias = true, >          .has_mic2 = true, >  }; > > @@ -734,6 +752,12 @@ static int sun8i_codec_analog_cmpnt_probe(struct snd_soc_component *cmpnt) >                          return ret; >          } > > + if (quirks->has_mbias) { > + ret = sun8i_codec_add_mbias(cmpnt); > + if (ret) > + return ret; > + } > + >          if (quirks->has_mic2) { >                  ret = sun8i_codec_add_mic2(cmpnt); >                  if (ret) > -- > 2.11.1 Acked-by: Chen-Yu Tsai diff --git a/sound/soc/sunxi/sun8i-codec-analog.c b/sound/soc/sunxi/sun8i-codec-analog.c index af56afe5c403..edcc3eb7cd9a 100644 --- a/sound/soc/sunxi/sun8i-codec-analog.c +++ b/sound/soc/sunxi/sun8i-codec-analog.c @@ -695,6 +695,7 @@ struct sun8i_codec_analog_quirks { bool has_hmic; bool has_linein; bool has_lineout; + bool has_mbias; bool has_mic2; };