Received: by 10.192.165.148 with SMTP id m20csp1109396imm; Wed, 2 May 2018 14:20:50 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpnwusVGQgzL8+OE6r2k2ekkgNDURvzWOcrelDwJOvVPe3IIOiUYYn1OznH6BUBJ5ifXC61 X-Received: by 2002:a63:ab45:: with SMTP id k5-v6mr3842010pgp.199.1525296050629; Wed, 02 May 2018 14:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525296050; cv=none; d=google.com; s=arc-20160816; b=I+zzLsIdNJXt4CQYCCyuupkqnZhNTklNo5TON1u5MrxmlMBxmtmFxchUkli38pKgcv jtRUsmC0AT6eQtXODDD7s+ZYgb06UEayW0TVk4TX/yhkKjo2GOOL2EAZetbCIWe3viBV CnvB8A31oZAhJt+vfAP8kJrHXUFw22f7w1CZV2LPrZYmmDRu5iOB8JZCeQrQ0fJHIC+l W5WxYTCT1MM4M8OuOa5flCL71bBH63nxCngXoPVJPHX+b2EjJvJCAcTisAcYZ5+sHaFn 5oXVm6fLfHOBOm5OfeH+wUkcqKPUddtfOHNxjUEHHAR8oPKVe/iSrNjXeHtnsNl9d3jv h1Uw== 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=9VZO+aa1x/+/gAnzf2ji/Bprou9+Dy/pfnMDiCZNaUA=; b=mQ8cXjJy9GP/rv5kxGDiLB/RDpD2XgY9hOHVgaoSPhBgNlTQuz2lf0cKBP62EMIuDo aq4vl7S2cIP0mknNksnhQMgHCuhA8zxuTPygn7xkA+uCOB1r3D06HvzZ2yJ0HiLLAZYd v/O6o6tIm84EgcXZEALDp0jhOihS+Emn49LARVQFbwu904Gnwtt7f2TCJ21lMEPIVKI3 7+tg+54fqBxgPrrOWllnoFe86Jy0pg4QHQAn8STcY11NF9gFC6Aqomy0AlYyY+bDt7rP UuaAv9ztDUPc0p+QrbAFhi4NBGn8KhBQSJfY9wbsVCU8V7b9UcPoA6xUwObZNBdLpEHI 7sQg== 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 m39-v6si12354341plg.570.2018.05.02.14.20.36; Wed, 02 May 2018 14:20:50 -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 S1751880AbeEBVSH (ORCPT + 99 others); Wed, 2 May 2018 17:18:07 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:42628 "EHLO dd26836.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751828AbeEBVR4 (ORCPT ); Wed, 2 May 2018 17:17:56 -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 6633F3367C45; Wed, 2 May 2018 23:08:24 +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 3/8] ASoC: sun4i-codec: Merge sun4i_codec_left_mixer_controls and sun4i_codec_right_mixer_controls into sun4i_codec_mixer_controls Date: Wed, 2 May 2018 23:07:55 +0200 Message-Id: <20180502210800.1971-4-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 Since it's now possible to have a DAPM mixer control with multiple channels, use it to cut down the total number of controls. Keep "Left Mixer Left DAC Playback Switch" and "Right Mixer Right DAC Playback Switch" name & layout the same as before for compatibility. Signed-off-by: Danny Milosavljevic --- sound/soc/sunxi/sun4i-codec.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 4af286f44a67..b62af407967f 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -715,15 +715,15 @@ static const struct snd_kcontrol_new sun7i_codec_extra_controls[] = { sun7i_codec_micin_preamp_gain_scale), }; -static const struct snd_kcontrol_new sun4i_codec_left_mixer_controls[] = { - SOC_DAPM_SINGLE("Left DAC Playback Switch", SUN4I_CODEC_DAC_ACTL, - SUN4I_CODEC_DAC_ACTL_LDACLMIXS, 1, 0), -}; - -static const struct snd_kcontrol_new sun4i_codec_right_mixer_controls[] = { - SOC_DAPM_SINGLE("Right DAC Playback Switch", SUN4I_CODEC_DAC_ACTL, - SUN4I_CODEC_DAC_ACTL_RDACRMIXS, 1, 0), - SOC_DAPM_SINGLE("Left DAC Playback Switch", SUN4I_CODEC_DAC_ACTL, +static const struct snd_kcontrol_new sun4i_codec_mixer_controls[] = { + SOC_DAPM_SINGLE("Left Mixer Left DAC Playback Switch", + SUN4I_CODEC_DAC_ACTL, SUN4I_CODEC_DAC_ACTL_LDACLMIXS, + 1, 0), + SOC_DAPM_SINGLE("Right Mixer Right DAC Playback Switch", + SUN4I_CODEC_DAC_ACTL, SUN4I_CODEC_DAC_ACTL_RDACRMIXS, + 1, 0), + SOC_DAPM_SINGLE("Right Mixer Left DAC Playback Switch", + SUN4I_CODEC_DAC_ACTL, SUN4I_CODEC_DAC_ACTL_LDACRMIXS, 1, 0), }; @@ -759,11 +759,11 @@ static const struct snd_soc_dapm_widget sun4i_codec_codec_dapm_widgets[] = { /* Mixers */ SND_SOC_DAPM_MIXER("Left Mixer", SND_SOC_NOPM, 0, 0, - sun4i_codec_left_mixer_controls, - ARRAY_SIZE(sun4i_codec_left_mixer_controls)), + sun4i_codec_mixer_controls, + ARRAY_SIZE(sun4i_codec_mixer_controls)), SND_SOC_DAPM_MIXER("Right Mixer", SND_SOC_NOPM, 0, 0, - sun4i_codec_right_mixer_controls, - ARRAY_SIZE(sun4i_codec_right_mixer_controls)), + sun4i_codec_mixer_controls, + ARRAY_SIZE(sun4i_codec_mixer_controls)), /* Global Mixer Enable */ SND_SOC_DAPM_SUPPLY("Mixer Enable", SUN4I_CODEC_DAC_ACTL, @@ -805,12 +805,12 @@ static const struct snd_soc_dapm_route sun4i_codec_codec_dapm_routes[] = { /* Right Mixer Routes */ { "Right Mixer", NULL, "Mixer Enable" }, - { "Right Mixer", "Left DAC Playback Switch", "Left DAC" }, - { "Right Mixer", "Right DAC Playback Switch", "Right DAC" }, + { "Right Mixer", "Right Mixer Left DAC Playback Switch", "Left DAC" }, + { "Right Mixer", "Right Mixer Right DAC Playback Switch", "Right DAC" }, /* Left Mixer Routes */ { "Left Mixer", NULL, "Mixer Enable" }, - { "Left Mixer", "Left DAC Playback Switch", "Left DAC" }, + { "Left Mixer", "Left Mixer Left DAC Playback Switch", "Left DAC" }, /* Power Amplifier Routes */ { "Power Amplifier", "Mixer Playback Switch", "Left Mixer" },