Received: by 10.192.165.148 with SMTP id m20csp1107616imm; Wed, 2 May 2018 14:18:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrxfqyKCLSCEOlFNUisTlJfDp0eDLRCFAro5aVPStbRz1+y7fnyW1ro2zh/pu4KPev0zkSH X-Received: by 10.98.133.15 with SMTP id u15mr20627922pfd.160.1525295913736; Wed, 02 May 2018 14:18:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525295913; cv=none; d=google.com; s=arc-20160816; b=MR3h7URhG0hcZG46W8Cz6tEBJ/paTAYBJ9yfagJd29c8z4UXiYu6wecf4Mvy8SPLas KgcWPJHdyMQtUaWg0ENBap/CQAODvA7Q7my4Fom9S8SSdikvcrWW1D2iHskpcVtorZ/m 4kGsFz1ifh44w2jVWZ5YQLBgvuotZxXkRde+w4J736nUjBT4YV5DIEAnOuNY/aGCZGva l3ea+lPa/14HHJeV9voZZiO2GanchlnKANHbRa6F6mroRiVNhvwVdIiWZ8MRfNMqhWme nT99G7+MBIHoSeSJ0pT/DhsgdgHQXiV6e8xEcwMjmvy/8IPk0j9sBlif6LAd+vpW7Dku UXBQ== 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=HEMYBui08/rsKKSVGvPmlvoSxO60FiJAf0v447xL6Ho=; b=ZdjjX/77b6TlTJMv4DVkHC9MX6tL257QoY73ALpZqFg2MJsrThxzByqWZivUyDEuk6 gErkVQQpvCCqvqAtK74dqnq+MLSDJjXTJ5wflS2PAKn9GSaIrtJfzu9e3Qpb8MULwz2i aVLNPLndVf9mho4d2h5rESsz2dS6lqyaglid1oJKvhMhGyLmb6MsZhdwX3iGRPU7GxDd W8nild1CfFzyO8udMqcKrdGkVz/+wvW5sUwOJV2ncpglYmTM0pMwwiMWUB6bZpBppH/i TPzVOkxKhcJkXyFKKl3GYFAhl0/bbpBWcBLclxxncZe37kOmL3cw5wwR5VmtRNBqEOVD Of3A== 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 b3-v6si12344943pld.2.2018.05.02.14.18.19; Wed, 02 May 2018 14:18:33 -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 S1751968AbeEBVSL (ORCPT + 99 others); Wed, 2 May 2018 17:18:11 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:42634 "EHLO dd26836.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751454AbeEBVR6 (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 1AA293367D7B; Wed, 2 May 2018 23:08:32 +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 7/8] ASoC: sun4i-codec: Add Differential Line Source Date: Wed, 2 May 2018 23:07:59 +0200 Message-Id: <20180502210800.1971-8-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 Differential Line Source for Allwinner A10 and Allwinner A20. Signed-off-by: Danny Milosavljevic --- sound/soc/sunxi/sun4i-codec.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 4125d9ef0eb6..45dcb80a1da9 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -110,6 +110,7 @@ #define SUN4I_CODEC_ADC_ACTL_VADCG (20) #define SUN4I_CODEC_ADC_ACTL_ADCIS (17) #define SUN4I_CODEC_ADC_ACTL_LNPREG (13) +#define SUN4I_CODEC_ADC_ACTL_LNRDF (16) #define SUN4I_CODEC_ADC_ACTL_PA_EN (4) #define SUN4I_CODEC_ADC_ACTL_DDE (3) #define SUN4I_CODEC_ADC_DEBUG (0x2c) @@ -705,6 +706,20 @@ 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 char * const sun4i_codec_difflinein_source[] = { + "Stereo", + "Differential", +}; + +static SOC_ENUM_SINGLE_DECL(sun4i_codec_enum_difflinein_source, + SUN4I_CODEC_ADC_ACTL, + SUN4I_CODEC_ADC_ACTL_LNRDF, + sun4i_codec_difflinein_source); + +static const struct snd_kcontrol_new sun4i_codec_difflinein_source_controls = + SOC_DAPM_ENUM("Differential Line Source", + sun4i_codec_enum_difflinein_source); + 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, @@ -825,6 +840,11 @@ static const struct snd_soc_dapm_widget sun4i_codec_codec_dapm_widgets[] = { SND_SOC_DAPM_SWITCH("Power Amplifier Mute", SND_SOC_NOPM, 0, 0, &sun4i_codec_pa_mute), + /* MUX */ + SND_SOC_DAPM_MUX("Differential Line Source", SND_SOC_NOPM, + 0, 0, + &sun4i_codec_difflinein_source_controls), + SND_SOC_DAPM_INPUT("Line Right"), SND_SOC_DAPM_INPUT("Line Left"), SND_SOC_DAPM_INPUT("FM Right"), @@ -884,6 +904,10 @@ static const struct snd_soc_dapm_route sun4i_codec_codec_dapm_routes[] = { { "Right ADC", NULL, "MIC2 Pre-Amplifier" }, { "MIC2 Pre-Amplifier", NULL, "Mic2"}, { "Mic2", NULL, "VMIC" }, + + /* LNRDF Routes */ + { "Differential Line Source", "Differential", "Line Left" }, + { "Differential Line Source", "Differential", "Line Right" }, }; struct sun4i_codec_quirks {