Received: by 10.192.165.148 with SMTP id m20csp888587imm; Sat, 5 May 2018 00:05:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqXtURXiZc/auTu4FQY9oEdXa3KDp6znba71JXZ/BcD3WlNmdmzKXFRlhxD0BTZ8Lz0wUuG X-Received: by 2002:a17:902:850a:: with SMTP id bj10-v6mr21982425plb.239.1525503944618; Sat, 05 May 2018 00:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525503944; cv=none; d=google.com; s=arc-20160816; b=ldrR81MUSHKRDMXAvCsVxQK4OMZ1bHHBqUu5rUnwpRwEBy2PgxHkhkkr0LRVNAAHhL nwAxm/w4ctxu8Nu6C28XnNDiWC3mfD0epmrpmABmoHHuNRlJB7UvZfd02PXffTIZgYUN W6ZXAfAv9qhP4a5QizR9epXNpCwkDLW0NOt2VHI7ay6mA1zx7Lh6bInSJlaNptUHDEMQ 4TPPU02YBjPaVeiY3Dl4ugD9GLU5baqvbfPJLpVkAQDXBSUMQT7jIP3YR5Xo9P26TXu0 2vAO8hrO3OMztUW27jOty4D92U6ZuRWqxLZVCjGXSCPsh1ppa3lKXWTksbk7P/WK+Swm ExCQ== 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:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :arc-authentication-results; bh=NhveSLg/+q2WIxwe9Tb1ftuNhz2lw6g+BMiEe0RjkS0=; b=kyCgyeUo0etJdVZcHAh7fD4CUHR2amMTsA0g1TOHYuHVk4oGK5Bvz+L87TLYYGBC53 TuOzK9l27iFyfKkbdASfScFfxRPMtvXpLKuRfZ+oGZK4LkPZLnBzXBWgXhKUv09llR4M FzAH4nxj3WpSfxp0npJi52p9o80akviS3C7gsgI5pzE8YDaNLKYwIh9Sq+63vcRAecoc ee06/2kRweIa3mBgS6Wqnr+JerHts9SytMbH7ozu/KcAu1TYtTL23XuXX58Nd+hg3P+h 4F3uV/B31xmLF7V7AfYSHBEWDhiih2WSLU0i3r6D5Ab7lMNmTjY37lxha1ZTueiahVrE hs0A== 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 a23si17262514pfh.295.2018.05.05.00.05.30; Sat, 05 May 2018 00:05:44 -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 S1751206AbeEEHFU (ORCPT + 99 others); Sat, 5 May 2018 03:05:20 -0400 Received: from dd26836.kasserver.com ([85.13.145.193]:51296 "EHLO dd26836.kasserver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750764AbeEEHFT (ORCPT ); Sat, 5 May 2018 03:05:19 -0400 Received: from localhost (77.118.180.168.wireless.dyn.drei.com [77.118.180.168]) by dd26836.kasserver.com (Postfix) with ESMTPSA id A4DED3361538; Sat, 5 May 2018 09:05:16 +0200 (CEST) Date: Sat, 5 May 2018 09:05:13 +0200 From: Danny Milosavljevic To: Maxime Ripard Cc: Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai , Chen-Yu Tsai , 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: Re: [PATCH v14 2/8] ASoC: sun4i-codec: Add Mic1 Boost Volume, Mic2 Boost Volume Message-ID: <20180505090513.7e3f02c2@scratchpost.org> In-Reply-To: <20180503143319.4vyh2y5sluatssnv@flea> References: <20180502210800.1971-1-dannym@scratchpost.org> <20180502210800.1971-3-dannym@scratchpost.org> <20180503143319.4vyh2y5sluatssnv@flea> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.31; x86_64-unknown-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Maxime, On Thu, 3 May 2018 16:33:19 +0200 Maxime Ripard wrote: > > +struct sun4i_codec_quirks { > > + const struct regmap_config *regmap_config; > > + const struct snd_soc_component_driver *codec; > > + struct snd_soc_card * (*create_card)(struct device *dev); > > + struct reg_field reg_adc_fifoc; /* used for regmap_field */ > > + unsigned int reg_dac_txdata; /* TX FIFO offset for DMA config */ > > + unsigned int reg_adc_rxdata; /* RX FIFO offset for DMA config */ > > + bool has_reset; > > + const struct snd_kcontrol_new *controls; > > + unsigned int num_controls; > > +}; > > + > > +static int sun4i_codec_component_driver_probe(struct snd_soc_component *codec) > > +{ > > + const struct sun4i_codec_quirks *quirks; > > + > > + quirks = of_device_get_match_data(codec->dev); > > + return snd_soc_add_component_controls(codec, > > + quirks->controls, > > + quirks->num_controls); > > Why not just extending the sun4i_codec_controls to add it, and create > a duplicate one for the A20? Because sun4i_codec_controls has five controls shared between A10 and A20, and only two not shared. And if we extended sun4i_codec_controls, we'd also have to duplicate sun4i_codec_codec in order to use sun4i_codec_controls vs. sun7i_codec_controls, which really contains exactly the same data otherwise. The quirks here are just for two controls, Mic1 Boost Volume and Mic2 Boost Volume, and there not even for the names or anything - just for some reason the register moved away. The simplest way was to add it to the quirks - which already have a variant selection etc.