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: 735434 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3vbknz2kh6z9s83 for ; Mon, 6 Mar 2017 00:50:31 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IsiTxAOZ"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=aosc.xyz header.i=@aosc.xyz header.b="Ls/vRSTt"; dkim-atps=neutral DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Date:Message-Id:MIME-Version:Subject: References:In-Reply-To:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=XSIsFNWmR+cYb7sL2W4n0zp5YIuzkb5Z+jTTcVA8KsE=; b=IsiTxAOZ6kf+M9 xhtBvQNfXohA/42ZBu0gHxAhiKuQ2Pr8XoQf5JlQORK7uF/07WpOu2rtE0Ba46ox7r/0+L0sqxPwN MUr4TJGJWsDGRjE3ahOtQd93nDN/dWYEURPDbqMapPC26fWJMcgLtxi8wz1S7USP/BBKQncK6zB94 KSYTngsqNq+R9iQWNojkllajGYkLpRJCmT0JGFtr7GGkNqB0Sbos2s/iPuxSmXThBiPLeKOdnuX77 DOt1iLH1xKc6Bobqf3KY4Vzn3HR06C1TkmtCqC6ieu0J7M/I2t1th8tDh6RWmHo7DpEcWxu0W5jrB oUsK2EdKLw1I7XA6kCXg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ckWYP-0004l2-HT; Sun, 05 Mar 2017 13:50:29 +0000 Received: from forward2p.cmail.yandex.net ([2a02:6b8:0:1465::12]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ckWYK-0003Z1-3G for linux-arm-kernel@lists.infradead.org; Sun, 05 Mar 2017 13:50:27 +0000 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> Subject: Re: [PATCH v2 03/12] ASoC: sun8i-codec-analog: split out mbias 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170305_055025_237551_373B30B1 X-CRM114-Status: GOOD ( 13.13 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2a02:6b8:0:1465:0:0:0:12 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org List-Id: linux-imx-kernel.lists.patchwork.ozlabs.org 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; };