Received: by 10.192.165.148 with SMTP id m20csp1108039imm; Wed, 2 May 2018 14:19:03 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrarNiCtJButjLe31vb89e0b1spTKoQbh7wkJ6HzVotQlsNYNanskF3iLh4QFbfkKulrqqP X-Received: by 2002:a17:902:164:: with SMTP id 91-v6mr21708223plb.134.1525295943478; Wed, 02 May 2018 14:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525295943; cv=none; d=google.com; s=arc-20160816; b=yfuLy9/yJrcSyK00RGn4/XaTS6nVZ3ba+S4q9oPl/mTKbK4ogrOYyDbyrdpxjugWkJ p1280LDDaxZOhK0Osu7dWwmt81VV3zGnOZMHC483XViqIhlJsLa9KqN1uoiVCFOJ/NOx szhC2NJtROvFHiTwZ/hI0fM2ytqM3BRhmYJr+RKM4yBNGXMGpvs677rXmWMaouGcRXfX jVSp6Xulk3w11p9PON8ZQ+TY39m/hPPXtIsrGMxgiUpPWfXiVRbQBnr/ErwEaL+THHK8 H6jCjFCEatHLog1I81+aSBij53LIRfb2cc//An1O+M6mNPswD3o3p1AE+kyKosKbQsf3 qiIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:tags:references:in-reply-to:message-id :date:subject:to:from:arc-authentication-results; bh=QRc2zLO9pnIs0YhKWmoRrK2xX47x1tyaXI+gFs6cpF4=; b=T3xtMWcWCyWqc2vVKfxuh+lNUSWHH+bnvFE+p7E4kiw0cWwRJSh9RH6gUZbgrgIDTU wbLuPdDMh7w/2GmreBHGqgzG2Gb+tn2B/PWc1AEE0U1ikWTA4i35AQJwnBu/XraLvapP VJmtFXIiuVB2ijTIQo6pzY1haKFQc45W56jnmFKheyEHHb7NiI5rhHIdd0vREcayQibO OPlCMzvbEZOIXp5jGyRE3dnvCcUxIWgXhZpcjuDcRBVLPNie6+7Ea/DwaZS92/yRh4ru bUEq427OyJvdsQhgW7DnTFnGkdBfp2+mr7Knn9buDqtDlFQ4IWqe0VTQb4iZY+70IbI9 fX7A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a64-v6si12604106pla.530.2018.05.02.14.18.49; Wed, 02 May 2018 14:19:03 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035AbeEBVSQ (ORCPT + 99 others); Wed, 2 May 2018 17:18:16 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:42636 "EHLO dd26836.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751745AbeEBVR6 (ORCPT ); Wed, 2 May 2018 17:17:58 -0400 Received: from dayas.3.home (77.118.143.54.wireless.dyn.drei.com [77.118.143.54]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 68A533367BC0; Wed, 2 May 2018 23:08:19 +0200 (CEST) From: Danny Milosavljevic To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Maxime Ripard , Chen-Yu Tsai , Danny Milosavljevic , Andrea Bondavalli , Fabio Estevam , Icenowy Zheng , Philipp Zabel , Kuninori Morimoto , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Subject: [PATCH v14 1/8] ASoC: sun4i-codec: Add MIC2 Pre-Amplifier, Mic2, Mic Playback Volume Date: Wed, 2 May 2018 23:07:53 +0200 Message-Id: <20180502210800.1971-2-dannym@scratchpost.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180502210800.1971-1-dannym@scratchpost.org> References: <20180502210800.1971-1-dannym@scratchpost.org> Tags: patch Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add MIC2 Pre-Amplifier, Mic2 input and Mic Playback Volume for Allwinner A10 and Allwinner A20. Signed-off-by: Danny Milosavljevic --- sound/soc/sunxi/sun4i-codec.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 9a3cb7704810..060a40b45ab0 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -64,6 +64,7 @@ #define SUN4I_CODEC_DAC_ACTL_DACAENR (31) #define SUN4I_CODEC_DAC_ACTL_DACAENL (30) #define SUN4I_CODEC_DAC_ACTL_MIXEN (29) +#define SUN4I_CODEC_DAC_ACTL_MICG (20) #define SUN4I_CODEC_DAC_ACTL_LDACLMIXS (15) #define SUN4I_CODEC_DAC_ACTL_RDACRMIXS (14) #define SUN4I_CODEC_DAC_ACTL_LDACRMIXS (13) @@ -673,11 +674,16 @@ static const struct snd_kcontrol_new sun4i_codec_pa_mute = SUN4I_CODEC_DAC_ACTL_PA_MUTE, 1, 0); static DECLARE_TLV_DB_SCALE(sun4i_codec_pa_volume_scale, -6300, 100, 1); +static DECLARE_TLV_DB_SCALE(sun4i_codec_micin_loopback_gain_scale, -450, 150, + 0); static const struct snd_kcontrol_new sun4i_codec_controls[] = { SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL, SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0, sun4i_codec_pa_volume_scale), + SOC_SINGLE_TLV("Mic Playback Volume", SUN4I_CODEC_DAC_ACTL, + SUN4I_CODEC_DAC_ACTL_MICG, 7, 0, + sun4i_codec_micin_loopback_gain_scale), }; static const struct snd_kcontrol_new sun4i_codec_left_mixer_controls[] = { @@ -741,6 +747,8 @@ static const struct snd_soc_dapm_widget sun4i_codec_codec_dapm_widgets[] = { /* Mic Pre-Amplifiers */ SND_SOC_DAPM_PGA("MIC1 Pre-Amplifier", SUN4I_CODEC_ADC_ACTL, SUN4I_CODEC_ADC_ACTL_PREG1EN, 0, NULL, 0), + SND_SOC_DAPM_PGA("MIC2 Pre-Amplifier", SUN4I_CODEC_ADC_ACTL, + SUN4I_CODEC_ADC_ACTL_PREG2EN, 0, NULL, 0), /* Power Amplifier */ SND_SOC_DAPM_MIXER("Power Amplifier", SUN4I_CODEC_ADC_ACTL, @@ -751,6 +759,7 @@ static const struct snd_soc_dapm_widget sun4i_codec_codec_dapm_widgets[] = { &sun4i_codec_pa_mute), SND_SOC_DAPM_INPUT("Mic1"), + SND_SOC_DAPM_INPUT("Mic2"), SND_SOC_DAPM_OUTPUT("HP Right"), SND_SOC_DAPM_OUTPUT("HP Left"), @@ -790,6 +799,12 @@ static const struct snd_soc_dapm_route sun4i_codec_codec_dapm_routes[] = { { "Right ADC", NULL, "MIC1 Pre-Amplifier" }, { "MIC1 Pre-Amplifier", NULL, "Mic1"}, { "Mic1", NULL, "VMIC" }, + + /* Mic2 Routes */ + { "Left ADC", NULL, "MIC2 Pre-Amplifier" }, + { "Right ADC", NULL, "MIC2 Pre-Amplifier" }, + { "MIC2 Pre-Amplifier", NULL, "Mic2"}, + { "Mic2", NULL, "VMIC" }, }; static const struct snd_soc_component_driver sun4i_codec_codec = {