Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5966227imu; Wed, 30 Jan 2019 06:37:39 -0800 (PST) X-Google-Smtp-Source: ALg8bN40+atCDSAB5AGI7U2g95zwrAZPwt7YlrvvikU12llZWJ7EJ5LT9PQ6xEPPgpTJCPJpxePi X-Received: by 2002:aa7:810c:: with SMTP id b12mr30550226pfi.44.1548859059062; Wed, 30 Jan 2019 06:37:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548859059; cv=none; d=google.com; s=arc-20160816; b=pESsDf7/4wRAd1Njq8cX55/5HaTEtfp5AvKaUFKznaMOOuAc1Q/s3LJEHNGX++PyYo VZLrloMVjSVHAEOV0nYrG5Whubf6US9yX7Ra8d59FFeIAkNCpSNI3ByAvny/eiozxWuo ldvQ8xae/f2ARr/SG5YKCn3cUSaI60CrifL7wcAmqmEEKSuasm6hmTi/erVKclBebqm6 QHJcTdMkhJVtFWOstt29y0Qfq+khGi/ENMtTUqRRtWTtLL8Jd97HNKU1EM+TpBSpF8yr 0ZzuY9x9thcXAFv71+fMLq0k8ZBmfGv1ZlveJ8JAmqDiPCtFL4dQGvuyKScvojmDJ0rz HFjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:tags :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=MAkOn8HOwoth3uzl1vu4SrtHlWkytjgAjVbfbhmNOQU=; b=wFEyRsLavuJiO34cJr/Wc6q/+Z75496D56UWGJS56jKUxdFSphT7fnhmWU4Af/1NUi /CbjwEmSHBb/klC9jjgNW/6ut4LBAFqidLqd+hd6S2EYgfDF+TUfZwoGKD1Gu+tjG0I7 EnTb50xef/0nFt6253D1SO0tyQV2GCzHnJWqkWZPfeV2RSMdubzVDZd/eN4nqqrCcohq CF7oIK3Lz5l38tU6qNTXYoHxRm8mJJKMdTZq3cG4UV3weTX/WeGF98otTvaJNfD2kyEH LbqFk4oAwmF/1n5hSzEgq9l/sUP3Z1o50pdb4f5Xq/An6e1AuYcS6+9pAHQnIdH1vAnm ECuA== 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 i90si1701784pli.135.2019.01.30.06.37.23; Wed, 30 Jan 2019 06:37:39 -0800 (PST) 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 S1731341AbfA3Ofz (ORCPT + 99 others); Wed, 30 Jan 2019 09:35:55 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:48980 "EHLO dd26836.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727162AbfA3Ofy (ORCPT ); Wed, 30 Jan 2019 09:35:54 -0500 Received: from dayas.3.home (77.116.173.211.wireless.dyn.drei.com [77.116.173.211]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 7670F33622BE; Wed, 30 Jan 2019 15:26:01 +0100 (CET) From: Danny Milosavljevic To: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Maxime Ripard , Chen-Yu Tsai , Danny Milosavljevic , alsa-devel@alsa-project.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v15 1/8] ASoC: sun4i-codec: Add MIC2 Pre-Amplifier, Mic2 input Date: Wed, 30 Jan 2019 11:39:37 +0100 Message-Id: <20190130103945.26692-2-dannym@scratchpost.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190130103945.26692-1-dannym@scratchpost.org> References: <20190130103945.26692-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch Content-Transfer-Encoding: 8bit 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 for Allwinner A10 and Allwinner A20. Previously, there only the Mic1 input and MIC1 Pre-Amplifier was exposed. This exposes the Mic2 input and MIC2 Pre-Amplifier. Signed-off-by: Danny Milosavljevic --- sound/soc/sunxi/sun4i-codec.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 9a3cb7704..7b965bc50 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,6 +674,8 @@ 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, @@ -741,6 +744,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 +756,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 +796,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 = {