Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5965185imu; Wed, 30 Jan 2019 06:36:35 -0800 (PST) X-Google-Smtp-Source: ALg8bN65oaC1TpTqt+uU8ZOJ57mLPskU9BKhnq4g2jM93IIbeGXn0fSkdhRlZoUJX7Ztz52TiQ63 X-Received: by 2002:a17:902:2c03:: with SMTP id m3mr29196492plb.6.1548858995430; Wed, 30 Jan 2019 06:36:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548858995; cv=none; d=google.com; s=arc-20160816; b=RWGgOH16DKlH68vc1K86oSyO6hTB4uJS2OEJ4AsxF8xwCfKnmkycqr1/VWtt0bF9hA bfcabD7KggQTRb45nDYSOE4Y8kX236RDXblvF1k71K+bortrC/lRMrGPuWyZ7cW8vz9L GHiSRFpL2IiA8tru1mU1a+VJUlbn/KaVhgUpAlvtF/Ltl1uQCyCLCWTPOpElsq0+qEJ3 dfisUuStym9nseF2JFXXpqQ3h5bo+rsjkZai4veFsMlWJ8vJPOIAhhxm989N/MP+DD6e 1phVZSmseY25dY1cIpEziLhy4b0WpnUkdNV/XIfbCpwbS+LWo1vt4sjqhCwzc9oUIFmU ZENA== 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=bTmnimdhEiO8teDyU9taI5zXZx3os8oXdkm88becdBU=; b=L4/bKm19rs7TageIyQ+ohz60lwRrK3S/NnXOdBbhqaJy1VkvbnIlVe/7SYc6iTzLW3 lEwh6j7gitjgApGy8KvgFRBOndhV9Rikyen9A/DER+gnbBimg57mTbCFAEYJEJPA3wNb LSxDD5qAk15r+1L05lTxrgo0fYSSO+aUnolUvtwxskwoZatIp7ZlohHQUfBnJzV1F+a5 UPWiF+HVpjVH10XtTsXQGZqy1UEbsiZIpnbSSicmkAnTH9FJZTcWZ+XyYwgso1HYNc1w ospj9U6nVbIhUfN0zBC51+aj+5vulJF3p3g13cXjul0LEVmD7/6CCpdckzxyAp/fBJ4v 7z5A== 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 p64si1683570pfg.79.2019.01.30.06.36.19; Wed, 30 Jan 2019 06:36:35 -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 S1731408AbfA3Of4 (ORCPT + 99 others); Wed, 30 Jan 2019 09:35:56 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:48998 "EHLO dd26836.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731243AbfA3Ofy (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 26E3A3362F7D; Wed, 30 Jan 2019 15:26:08 +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 4/8] ASoC: sun4i-codec: Add Mic1 Boost Volume, Mic2 Boost Volume Date: Wed, 30 Jan 2019 11:39:40 +0100 Message-Id: <20190130103945.26692-5-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 Mic1 Boost Volume and Mic2 Boost Volume for Allwinner A10 and for Allwinner A20. Those controls are in different registers per chip model, so put the Allwinner A10 controls and the Allwinner A20 controls into the newly split sun4i_codec_controls and sun7i_codec_controls, respectively. Signed-off-by: Danny Milosavljevic --- sound/soc/sunxi/sun4i-codec.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 52453c46b..9d509ede2 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -95,6 +95,8 @@ #define SUN4I_CODEC_ADC_ACTL_PREG1EN (29) #define SUN4I_CODEC_ADC_ACTL_PREG2EN (28) #define SUN4I_CODEC_ADC_ACTL_VMICEN (27) +#define SUN4I_CODEC_ADC_ACTL_PREG1 (25) +#define SUN4I_CODEC_ADC_ACTL_PREG2 (23) #define SUN4I_CODEC_ADC_ACTL_VADCG (20) #define SUN4I_CODEC_ADC_ACTL_ADCIS (17) #define SUN4I_CODEC_ADC_ACTL_PA_EN (4) @@ -111,6 +113,9 @@ /* Microphone controls (sun7i only) */ #define SUN7I_CODEC_AC_MIC_PHONE_CAL (0x3c) +#define SUN7I_CODEC_AC_MIC_PHONE_CAL_PREG1 (29) +#define SUN7I_CODEC_AC_MIC_PHONE_CAL_PREG2 (26) + /* * sun6i specific registers * @@ -676,6 +681,12 @@ static const struct snd_kcontrol_new sun4i_codec_pa_mute = 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 DECLARE_TLV_DB_RANGE(sun4i_codec_micin_preamp_gain_scale, + 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), + 1, 7, TLV_DB_SCALE_ITEM(3500, 300, 0)); +static DECLARE_TLV_DB_RANGE(sun7i_codec_micin_preamp_gain_scale, + 0, 0, TLV_DB_SCALE_ITEM(0, 0, 0), + 1, 7, TLV_DB_SCALE_ITEM(2400, 300, 0)); static const struct snd_kcontrol_new sun4i_codec_controls[] = { SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL, @@ -684,6 +695,12 @@ static const struct snd_kcontrol_new sun4i_codec_controls[] = { SOC_SINGLE_TLV("Mic Playback Volume", SUN4I_CODEC_DAC_ACTL, SUN4I_CODEC_DAC_ACTL_MICG, 7, 0, sun4i_codec_micin_loopback_gain_scale), + SOC_SINGLE_TLV("Mic1 Boost Volume", SUN4I_CODEC_ADC_ACTL, + SUN4I_CODEC_ADC_ACTL_PREG1, 3, 0, + sun4i_codec_micin_preamp_gain_scale), + SOC_SINGLE_TLV("Mic2 Boost Volume", SUN4I_CODEC_ADC_ACTL, + SUN4I_CODEC_ADC_ACTL_PREG2, 3, 0, + sun4i_codec_micin_preamp_gain_scale), }; static const struct snd_kcontrol_new sun7i_codec_controls[] = { @@ -693,6 +710,12 @@ static const struct snd_kcontrol_new sun7i_codec_controls[] = { SOC_SINGLE_TLV("Mic Playback Volume", SUN4I_CODEC_DAC_ACTL, SUN4I_CODEC_DAC_ACTL_MICG, 7, 0, sun4i_codec_micin_loopback_gain_scale), + SOC_SINGLE_TLV("Mic1 Boost Volume", SUN7I_CODEC_AC_MIC_PHONE_CAL, + SUN7I_CODEC_AC_MIC_PHONE_CAL_PREG1, 7, 0, + sun7i_codec_micin_preamp_gain_scale), + SOC_SINGLE_TLV("Mic2 Boost Volume", SUN7I_CODEC_AC_MIC_PHONE_CAL, + SUN7I_CODEC_AC_MIC_PHONE_CAL_PREG2, 7, 0, + sun7i_codec_micin_preamp_gain_scale), }; static const struct snd_kcontrol_new sun4i_codec_left_mixer_controls[] = {