From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.2 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C543C35DF5 for ; Tue, 25 Feb 2020 08:04:59 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 158B32084E for ; Tue, 25 Feb 2020 08:04:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=alsa-project.org header.i=@alsa-project.org header.b="c28Kk3DD"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kDWNGF9v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 158B32084E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 65E281672; Tue, 25 Feb 2020 09:04:07 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 65E281672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1582617897; bh=Z8zheNF/lBKScsp2lU2FeVnKoBKct1UF0SkPmY+Jll8=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=c28Kk3DDA+gSIgtZFvh2+W2yq6jYIBIVWG/b2m3TPFobkTO0mpThHS3YRCpUW/QFl MIiXybYWksJBa6LKGSQeDVLms8P9oEH36mrkImYCZolI8qjpc5sYA9jJg4buAgtPQ7 SrC+9WP+qJ4LkDPG1mv2Yb7KjnMpizQ2S0DqGyOM= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id E0B30F8013E; Tue, 25 Feb 2020 09:04:06 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E7B2EF80142; Tue, 25 Feb 2020 09:04:05 +0100 (CET) Received: from mail-pf1-x443.google.com (mail-pf1-x443.google.com [IPv6:2607:f8b0:4864:20::443]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 66898F800AD for ; Tue, 25 Feb 2020 09:04:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 66898F800AD Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="kDWNGF9v" Received: by mail-pf1-x443.google.com with SMTP id i19so6768391pfa.2 for ; Tue, 25 Feb 2020 00:04:00 -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=qkTOrVZ8TTywFm0kZ3lwvJmujBWSqk1zjyH59R6i0P4Y6vZFiU4bBuFExkltCxjAcn yqVu1XUUCB7+l0qi6PHyNtjLxwrhr0Hq5YR7YKtlmklTAQCoLS+Sfh+8GBtsF4A+OFr9 ESkB9WlzxdwB8lo1r4NWSA7Hsz5DKRx7UR3Dtxd2ePuyhRn5A47kXTj7qNY7zI+jZlzv aNPvI4uVeV7wbheKXpNR2jMt2V0UnSNdZef1WGfQAoM7BQSJ6bT844B9sKnR1vnw0aez vJZnEUBoRB0ExGDEJBrZ91hpmJAYo3ul9zQwXO2s8UzqE8bVDEs621v3vS5WiKTxLjeT K2Xg== X-Gm-Message-State: APjAAAWAvcuU8SqzKZFB2HY+r++sjVY8wnOH1P91bO/mLZqld/cYRmxL DurBtFL0AYupa//0CKv99eE= X-Google-Smtp-Source: APXvYqwMRtQpYwUBTrb0+cvHPd0eiLB/R3rhnLG6W+uGQXS+JAd8tDieKTnw2v05Noa4gwMj4BMhpg== 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" 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) Cc: "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , "alsa-devel@alsa-project.org" , "timur@kernel.org" , "Xiubo.Lee@gmail.com" , "linuxppc-dev@lists.ozlabs.org" , "tiwai@suse.com" , "lgirdwood@gmail.com" , "robh+dt@kernel.org" , "broonie@kernel.org" , "festevam@gmail.com" , "linux-kernel@vger.kernel.org" X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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