Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5966287imu; Wed, 30 Jan 2019 06:37:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IbyJukxu5QqaZLo02+Wg0+scqfr+JB00mkk44ndeYYl4GNOyNRI8ZHpNMSYS1Oi9iwm5/S4 X-Received: by 2002:a63:287:: with SMTP id 129mr4486960pgc.332.1548859062278; Wed, 30 Jan 2019 06:37:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548859062; cv=none; d=google.com; s=arc-20160816; b=ifLbma780PsI29HB1vlNk2jfQv2JeA4QR10K+KL3wjIiZ6ICRJJZYjgap4qptKV55V dkBoLBZdnoAERY8QK0CS+dmX8wLeN26pWPDUMmE+UbhWxIx2XuJiz7nmnJVjrnnJ2jw6 3aIsNuNf6eipWgOChuhJ82+MR0yvahe9uxZ1YeX2R/o4FZyYKpNjPWA3gl1EOmIZOE+e XuFoi/JZE3S5ekvSj2K+CSynbtthnGdlQYSC4MlnvBc5Z9UUq5f2ea5tPX1jqrQccoJC vVHT+xecifMIMrO2A7XMqVWrD/UES7hovZ+0FzA+oJliODgp+KmczkEsBqevtfkPaqnz 3xwg== 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=T3B40aBhPeYP2FtlPbhYokJ3SiPmfA5DuKN2ruNojBc=; b=mS4LxQgauAUN6ANrnxy129ijfIQRYPbpzQ5FBUAUdF8fGc/9iympq2Ru1GWi42UIxW CnpC1qZ5u7Y+G3634u1LCdzf6rmF8+1Yd+6tI6i9RXCY0px9yr1trmRso2aa73BPFubP 26YvmMGLEJ3F7lIdCKIhM2pUMcrw/k0+H3evXAt9Tzy7opHeT6MfD/UBrwJrmzueKIv+ mrPv4Ew1t0IiCYz+MrkuYxa3658cziH4i1KmkViKqS621NYmwERRW/W0ETBcAi8fc7ow b8gUMbvILbiiFGS3kJxEd+Gogivrgb+M8IyUrCSZyqqxrzPrWCfMbHtRaQO9jpB0SWif YP+Q== 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 v20si1586548pgk.103.2019.01.30.06.37.27; Wed, 30 Jan 2019 06:37:42 -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 S1731306AbfA3Ofy (ORCPT + 99 others); Wed, 30 Jan 2019 09:35:54 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:48974 "EHLO dd26836.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726548AbfA3Ofy (ORCPT ); Wed, 30 Jan 2019 09:35:54 -0500 X-Greylist: delayed 592 seconds by postgrey-1.27 at vger.kernel.org; Wed, 30 Jan 2019 09:35:54 EST 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 50619336394D; Wed, 30 Jan 2019 15:26:10 +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 5/8] ASoC: sun4i-codec: Merge sun4i_codec_left_mixer_controls and sun4i_codec_right_mixer_controls into sun4i_codec_mixer_controls Date: Wed, 30 Jan 2019 11:39:41 +0100 Message-Id: <20190130103945.26692-6-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 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 9d509ede2..279a7880d 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -718,15 +718,15 @@ static const struct snd_kcontrol_new sun7i_codec_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), }; @@ -762,11 +762,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, @@ -808,12 +808,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" },