Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp3375367ybv; Tue, 25 Feb 2020 00:04:50 -0800 (PST) X-Google-Smtp-Source: APXvYqx+33eniqggsWvH2braWPixnQwfUxOnz30qhpWVwOvScgqHVjnweHOUvzE+4e+GmWV/gXzv X-Received: by 2002:a05:6808:98e:: with SMTP id a14mr2392358oic.8.1582617890247; Tue, 25 Feb 2020 00:04:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582617890; cv=none; d=google.com; s=arc-20160816; b=T4GetPGebgdypCORuuVRmzZDZftO2blHpv8Ci6sqJFhrYzzbP4epAnJIZUOmxvSVOm iXFpNgpCLAQLgqt5WO0rCH6wmy41xh50x5f6m3j1aMq88S2gz+K8Y1IerfIav9luSiVh EMKvwuyJP+LalHsZsWnzBoxZ/uTJkZGlsvJmfdneArboW93fDzksF1G2S9It2cgg3/11 dXdz+qMFGuL0pjUAKXUh9YnefGYQqbB3UYboOqsT4wG6KcFhfRWjPAyea4weJuniZyG8 yKXbjwSnr75kDY0123yRHiXKxgb49U3aQURaUo3O5eIrguBhHhWv3jHGDNj21R3NOlUS +6tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=3UwgyNGegYf+ShQWoRWvT/NL7ARqm4MqRGArNYI3who=; b=yAvpndE7MWY3C7nIrElPfROzl8zaRWCZWsgS5Ups6OwrRsrgCzNIa2RTCP+hGI7/6J MsnMRbq1eT+MmqrVuTC71dxtwm5UwOjGHFkd+A05se3nus1NXW9s11keoUI2L0qsSsPn 4WtSgEUq2O+MrE2GuHBxWLGjQBuHgB8cjn0lhJB7+xrL3fDT8ugVOa0swQqfZKs1NLuT VSDM6LJbKASZTPc9G9eHFJAdzjmLvyWNDfA4+nc/03V6e5g5qmPG14awkG+sIFN/uO2N HUyKmNFclKjPEW5UBip/681+GFNyK+whPIA2JUvUjDfSQbglUOg1lmxYUKzaoZDGxBQx O44g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kDWNGF9v; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d83si6578616oib.166.2020.02.25.00.04.38; Tue, 25 Feb 2020 00:04:50 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kDWNGF9v; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729621AbgBYIEB (ORCPT + 99 others); Tue, 25 Feb 2020 03:04:01 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37662 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729001AbgBYIEA (ORCPT ); Tue, 25 Feb 2020 03:04:00 -0500 Received: by mail-pf1-f196.google.com with SMTP id p14so6754932pfn.4; Tue, 25 Feb 2020 00:03:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=3UwgyNGegYf+ShQWoRWvT/NL7ARqm4MqRGArNYI3who=; b=kDWNGF9vw5evEFnyTn5rudlI/14OO67KtZuSmNARz8zTE4vVP7Hhc6JwfRZjCo85Z2 tvgyuCBpwge1k7uxAL3cVdZdd0QGzOONoXlY+5TvHTzrZZoIbbnkxtUVyXYv0RR+Vity fOXvHDB3esTtnVmpSpmzuRqas5eMJ9vZFO4fAMfsF60iMsVd/vW2Bzs8+2d+xXASD2zh SUjAI5xrrtkyJAoK+q4wao8cymtP54e+xRZfxO+DeDmxIwT0qBTqrTWjbSlS9EpolcvA HhiiBRfm4FTS4F09uPw+SswFfyUOtYA5VfsHVt5vnwZO3TjYll5qx31WeHyUw/SVquMa Xd9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=3UwgyNGegYf+ShQWoRWvT/NL7ARqm4MqRGArNYI3who=; b=Kz8XWTDFQIa+CRV65GaM2DGK6zrupl5l+oZ0G+tJGBzvacECZAoK6hlGYYUCbj0ZP6 EjzEnDzpJVlZFdCHquwW+Ww9QOCTri9/5VqOOsSLlAK2P0q10lgIAQxYl8eTy2+WKJYj UXvWd7ZSgEJ1BOxDYn9xlbi0YF7IriE8gprQegywDgFNVlR8h9/DQiFbb4BjciMVgyFp uDQ0uuBF08Zcc5rsJ5t8RiKx77FXzngqrDaWq87houu+YnEQKcQ2L8Z6gSQ3yQwjw2+a RzM3IF/fGv1sVHcprzbz8taVvD1NGO7iPuyLLI3zQDkfrMoseiP9IUguDmgr1mEUUG+o o+Vg== X-Gm-Message-State: APjAAAWr6TSox7wmFS8aUUERfLOsCY9rEBsJultDc18i/35+Xy+Gueqy clkvLW/rfzeLsWhZcxDcj2Q= X-Received: by 2002:a63:d344:: with SMTP id u4mr35777777pgi.153.1582617838655; Tue, 25 Feb 2020 00:03:58 -0800 (PST) Received: from Asurada (c-73-162-191-63.hsd1.ca.comcast.net. [73.162.191.63]) by smtp.gmail.com with ESMTPSA id b18sm15964609pfd.63.2020.02.25.00.03.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 25 Feb 2020 00:03:58 -0800 (PST) Date: Tue, 25 Feb 2020 00:03:50 -0800 From: Nicolin Chen To: "S.j. Wang" Cc: "timur@kernel.org" , "Xiubo.Lee@gmail.com" , "festevam@gmail.com" , "broonie@kernel.org" , "alsa-devel@alsa-project.org" , "lgirdwood@gmail.com" , "perex@perex.cz" , "tiwai@suse.com" , "robh+dt@kernel.org" , "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2 3/3] ASoC: fsl_easrc: Add EASRC ASoC CPU DAI and platform drivers Message-ID: <20200225080350.GA11332@Asurada> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.22 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Feb 24, 2020 at 08:53:25AM +0000, S.j. Wang wrote: > Hi > > > > > > > Signed-off-by: Shengjiu Wang > > > --- > > > sound/soc/fsl/Kconfig | 10 + > > > sound/soc/fsl/Makefile | 2 + > > > sound/soc/fsl/fsl_asrc_common.h | 1 + > > > sound/soc/fsl/fsl_easrc.c | 2265 +++++++++++++++++++++++++++++++ > > > sound/soc/fsl/fsl_easrc.h | 668 +++++++++ > > > sound/soc/fsl/fsl_easrc_dma.c | 440 ++++++ > > > > I see a 90% similarity between fsl_asrc_dma and fsl_easrc_dma files. > > Would it be possible reuse the existing code? Could share structures from > > my point of view, just like it reuses "enum asrc_pair_index", I know > > differentiating "pair" and "context" is a big point here though. > > > > A possible quick solution for that, off the top of my head, could be: > > > > 1) in fsl_asrc_common.h > > > > struct fsl_asrc { > > .... > > }; > > > > struct fsl_asrc_pair { > > .... > > }; > > > > 2) in fsl_easrc.h > > > > /* Renaming shared structures */ > > #define fsl_easrc fsl_asrc > > #define fsl_easrc_context fsl_asrc_pair > > > > May be a good idea to see if others have some opinion too. > > > > We need to modify the fsl_asrc and fsl_asrc_pair, let them > To be used by both driver, also we need to put the specific > Definition for each module to same struct, right? Yea. A merged structure if that doesn't look that bad. I see most of the fields in struct fsl_asrc are being reused by in fsl_easrc. > > > > > +static const struct regmap_config fsl_easrc_regmap_config = { > > > + .readable_reg = fsl_easrc_readable_reg, > > > + .volatile_reg = fsl_easrc_volatile_reg, > > > + .writeable_reg = fsl_easrc_writeable_reg, > > > > Can we use regmap_range and regmap_access_table? > > > > Can the regmap_range support discontinuous registers? The > reg_stride = 4. I think it does. Giving an example here: https://github.com/torvalds/linux/blob/master/drivers/mfd/da9063-i2c.c