Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp5966110imu; Wed, 30 Jan 2019 06:37:31 -0800 (PST) X-Google-Smtp-Source: ALg8bN6lrrc6AvDeSgNHM7I77PSfw9/IbEc01sTQ8nqgoNBL6DzhZDjjUqpUSkbb/6jc7uc9WJ7i X-Received: by 2002:a63:b543:: with SMTP id u3mr27656045pgo.420.1548859051254; Wed, 30 Jan 2019 06:37:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548859051; cv=none; d=google.com; s=arc-20160816; b=KTCM5X7IJhpF1rekuIXKgGR+gg/klrAmAms74IyrOQP3XcKvWAdv5gXSVXCL/tbxw2 5Q8TrAtsC3F5n8xJJjHsIB55XDLjfbwnXlF9nVlKmwegqLF+utmwRhOjoX54llufuCFz VMkMqw0wco/JZbNwocb2l/WHCyWDgrq7ldYiInjqvb31Xj6GOmjik5Y+riJVTE1aY7qu 1JRxUHNu/6adk/r9c3zr2IYSvqMu1iC8DVVJa363URJ/NsNpuudAXhMb9DU0EkEYU+3T t97KA48r/5tCpqeLqe0CTjU9FNtFcU3QezUEgaqYN9ly7LzozZou6hIM7+LQaFjTWkco AGIg== 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=ee+YyEZzaeAS9Mr7ZQ7iMaYiueNrEv4M/L06PeYn7CQ=; b=M+8EPPzwAkYDiC87d1mudly5es6lWzhV2MIzzMWVVTgsYneapylY6JuZGRV9WFJMtk JXtpQuDZyQNF4DTEPcChIabPBzFekCz3I0AAbVCwM0pMEBdwVeprvYoZ9OzavjG86be1 Sl/GXvveBvZlLjDqJaE349pP9CCAzvMxhDePODJZfkdDGYITFN6KTngSZBE143z78Lis 9s3A0+AKCeZw6DGPv2SDmhHbw6/AI0gnZH2VXbXjBdZmHIqSW4TI+L9600M95JGe0oJw BjlyK56Jjk6UpEAQ2+9xu04nGXMufajw6W+CmEyDWMTulC8UzKf8EEWwIHQomGzLZuch 43Ug== 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 x10si1499335pgl.209.2019.01.30.06.37.16; Wed, 30 Jan 2019 06:37:31 -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 S1731358AbfA3Ofz (ORCPT + 99 others); Wed, 30 Jan 2019 09:35:55 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:48992 "EHLO dd26836.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731232AbfA3Ofy (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 41E723362C6F; Wed, 30 Jan 2019 15:26:06 +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 3/8] ASoC: sun4i-codec: Add sun7i_codec_controls, sun7i_codec_codec Date: Wed, 30 Jan 2019 11:39:39 +0100 Message-Id: <20190130103945.26692-4-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 Introduce sun7i_codec_controls because some of the controls are different on Allwinner A20 compared to Allwinner A10. Also introduce sun7i_codec_codec in order to use sun7i_codec_controls and make sun7i_codec_quirks use sun7i_codec_codec. Signed-off-by: Danny Milosavljevic --- sound/soc/sunxi/sun4i-codec.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index 060a40b45..52453c46b 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -686,6 +686,15 @@ static const struct snd_kcontrol_new sun4i_codec_controls[] = { sun4i_codec_micin_loopback_gain_scale), }; +static const struct snd_kcontrol_new sun7i_codec_controls[] = { + SOC_SINGLE_TLV("Power Amplifier Volume", SUN4I_CODEC_DAC_ACTL, + SUN4I_CODEC_DAC_ACTL_PA_VOL, 0x3F, 0, + sun4i_codec_pa_volume_scale), + SOC_SINGLE_TLV("Mic Playback Volume", SUN4I_CODEC_DAC_ACTL, + SUN4I_CODEC_DAC_ACTL_MICG, 7, 0, + sun4i_codec_micin_loopback_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), @@ -820,6 +829,19 @@ static const struct snd_soc_component_driver sun4i_codec_codec = { .non_legacy_dai_naming = 1, }; +static const struct snd_soc_component_driver sun7i_codec_codec = { + .controls = sun7i_codec_controls, + .num_controls = ARRAY_SIZE(sun7i_codec_controls), + .dapm_widgets = sun4i_codec_codec_dapm_widgets, + .num_dapm_widgets = ARRAY_SIZE(sun4i_codec_codec_dapm_widgets), + .dapm_routes = sun4i_codec_codec_dapm_routes, + .num_dapm_routes = ARRAY_SIZE(sun4i_codec_codec_dapm_routes), + .idle_bias_on = 1, + .use_pmdown_time = 1, + .endianness = 1, + .non_legacy_dai_naming = 1, +}; + /*** sun6i Codec ***/ /* mixer controls */ @@ -1500,7 +1522,7 @@ static const struct sun4i_codec_quirks sun6i_a31_codec_quirks = { static const struct sun4i_codec_quirks sun7i_codec_quirks = { .regmap_config = &sun7i_codec_regmap_config, - .codec = &sun4i_codec_codec, + .codec = &sun7i_codec_codec, .create_card = sun4i_codec_create_card, .reg_adc_fifoc = REG_FIELD(SUN4I_CODEC_ADC_FIFOC, 0, 31), .reg_dac_txdata = SUN4I_CODEC_DAC_TXDATA,