From patchwork Sat Oct 24 12:11:52 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Adam Sampson X-Patchwork-Id: 7507301 Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B3A939F40A for ; Wed, 28 Oct 2015 07:03:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6E4F20665 for ; Wed, 28 Oct 2015 07:03:44 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id 75C872065D for ; Wed, 28 Oct 2015 07:03:43 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 6DD61260440; Wed, 28 Oct 2015 08:03:41 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,NO_DNS_FOR_FROM, RCVD_IN_DNSWL_LOW, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 461C826044B; Wed, 28 Oct 2015 08:03:31 +0100 (CET) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id DD964265789; Sat, 24 Oct 2015 14:12:14 +0200 (CEST) Received: from b.a.painless.aa.net.uk (b.a.painless.aa.net.uk [81.187.30.65]) by alsa0.perex.cz (Postfix) with ESMTP id 0009826574E for ; Sat, 24 Oct 2015 14:12:07 +0200 (CEST) Received: from cartman.offog.org ([2001:8b0:83b:b53f::a]) by a.painless.aa.net.uk with esmtps (TLSv1:AES128-SHA:128) (Exim 4.77) (envelope-from ) id 1Zpxg1-0006bj-7u; Sat, 24 Oct 2015 13:12:03 +0100 Received: from ats by cartman.offog.org with local (Exim 4.86) (envelope-from ) id 1Zpxfy-0008K3-S6; Sat, 24 Oct 2015 13:11:58 +0100 From: Adam Sampson To: Maxime Ripard Date: Sat, 24 Oct 2015 13:11:52 +0100 Message-Id: <1445688712-31951-1-git-send-email-ats@offog.org> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 X-Mailman-Approved-At: Wed, 28 Oct 2015 08:03:29 +0100 Cc: alsa-devel@alsa-project.org, emilio@elopez.com.ar, lgirdwood@gmail.com, Adam Sampson , linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, broonie@kernel.org, linux-arm-kernel@lists.infradead.org Subject: [alsa-devel] [PATCH] ASoC: sun4i-codec: use consistent names for PA controls X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP The power amplifier for the headphone output is called "the PA" and "the headphone amplifier" in Allwinner's documentation for the A10 and A20. sun4i-codec calls it "PA" in some places and "Pre-Amplifier" (which isn't really accurate) in others, leading to user-visible controls with different names referring to the same device. When this driver implements audio input, it'll also need to expose controls for the line and mic input preamps, so just referring to "the Pre-Amplifier" will be ambiguous. Change it to use "PA" consistently for the power amplifier. Signed-off-by: Adam Sampson --- sound/soc/sunxi/sun4i-codec.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index bcbf4da..ff3304d 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -2,6 +2,7 @@ * Copyright 2014 Emilio López * Copyright 2014 Jon Smirl * Copyright 2015 Maxime Ripard + * Copyright 2015 Adam Sampson * * Based on the Allwinner SDK driver, released under the GPL. * @@ -452,12 +453,12 @@ static const struct snd_soc_dapm_widget sun4i_codec_dapm_widgets[] = { SND_SOC_DAPM_SUPPLY("Mixer Enable", SUN4I_CODEC_DAC_ACTL, SUN4I_CODEC_DAC_ACTL_MIXEN, 0, NULL, 0), - /* Pre-Amplifier */ - SND_SOC_DAPM_MIXER("Pre-Amplifier", SUN4I_CODEC_ADC_ACTL, + /* Headphone output power amplifier */ + SND_SOC_DAPM_MIXER("PA", SUN4I_CODEC_ADC_ACTL, SUN4I_CODEC_ADC_ACTL_PA_EN, 0, sun4i_codec_pa_mixer_controls, ARRAY_SIZE(sun4i_codec_pa_mixer_controls)), - SND_SOC_DAPM_SWITCH("Pre-Amplifier Mute", SND_SOC_NOPM, 0, 0, + SND_SOC_DAPM_SWITCH("PA Mute", SND_SOC_NOPM, 0, 0, &sun4i_codec_pa_mute), SND_SOC_DAPM_OUTPUT("HP Right"), @@ -480,16 +481,16 @@ static const struct snd_soc_dapm_route sun4i_codec_dapm_routes[] = { { "Left Mixer", NULL, "Mixer Enable" }, { "Left Mixer", "Left DAC Playback Switch", "Left DAC" }, - /* Pre-Amplifier Mixer Routes */ - { "Pre-Amplifier", "Mixer Playback Switch", "Left Mixer" }, - { "Pre-Amplifier", "Mixer Playback Switch", "Right Mixer" }, - { "Pre-Amplifier", "DAC Playback Switch", "Left DAC" }, - { "Pre-Amplifier", "DAC Playback Switch", "Right DAC" }, + /* PA Mixer Routes */ + { "PA", "Mixer Playback Switch", "Left Mixer" }, + { "PA", "Mixer Playback Switch", "Right Mixer" }, + { "PA", "DAC Playback Switch", "Left DAC" }, + { "PA", "DAC Playback Switch", "Right DAC" }, /* PA -> HP path */ - { "Pre-Amplifier Mute", "Switch", "Pre-Amplifier" }, - { "HP Right", NULL, "Pre-Amplifier Mute" }, - { "HP Left", NULL, "Pre-Amplifier Mute" }, + { "PA Mute", "Switch", "PA" }, + { "HP Right", NULL, "PA Mute" }, + { "HP Left", NULL, "PA Mute" }, }; static struct snd_soc_codec_driver sun4i_codec_codec = {