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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id A8331C433EF for ; Thu, 17 Mar 2022 10:20:53 +0000 (UTC) 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 E03441A7C; Thu, 17 Mar 2022 11:20:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz E03441A7C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1647512452; bh=MBDy7LKuR5988UVWQgbrOMGAP1dUArZTKzmhxoJiuJ4=; h=Date:From:To:Subject:References:In-Reply-To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=vY2b6NeXXSUeBEaEdhJ/4DjJPk9Y6icTqwO8NMOBiwvnqkRGZFNKcsxj5+Hwrg3xG /6/Ld009uCStsDOr8zswS00/9n60b09ZStxqjNfH6onf3GN16+PHkBjbg0djf+xwWp h4SKX1QHcY/IrscjqNMuevcdDLHyf1PR1j4zi5bo= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 84CA7F80132; Thu, 17 Mar 2022 11:20:01 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id AF316F8013F; Thu, 17 Mar 2022 11:19:59 +0100 (CET) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id A4862F80124 for ; Thu, 17 Mar 2022 11:19:52 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A4862F80124 Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nUnEV-0004ft-VH; Thu, 17 Mar 2022 11:19:51 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1nUnEU-0002Qv-Pz; Thu, 17 Mar 2022 11:19:50 +0100 Date: Thu, 17 Mar 2022 11:19:50 +0100 From: Sascha Hauer To: Shengjiu Wang Subject: Re: [PATCH 10/19] dma: imx-sdma: Add multi fifo support Message-ID: <20220317101950.GU405@pengutronix.de> References: <20220317082818.503143-1-s.hauer@pengutronix.de> <20220317082818.503143-11-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:42:35 up 96 days, 18:28, 78 users, load average: 0.19, 0.14, 0.15 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: alsa-devel@alsa-project.org Cc: alsa-devel@alsa-project.org, Xiubo Li , Vinod Koul , NXP Linux Team , Sascha Hauer , dmaengine@vger.kernel.org, Fabio Estevam , joy.zou@nxp.com 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 Thu, Mar 17, 2022 at 05:08:55PM +0800, Shengjiu Wang wrote: > On Thu, Mar 17, 2022 at 4:28 PM Sascha Hauer <[1]s.hauer@pengutronix.de> > wrote: > > +struct sdma_peripheral_config { > +       int n_fifos_src; > +       int n_fifos_dst; > +       bool sw_done; > +}; > + >  #endif > > Hi Sascha > This is our internal definition for this sdma_peripheral_config. > Could you please adopt this? This structure is completely internal to the kernel and can be adjusted when we need it. I don't see a reason to add unused fields to it just to be compatible with a downstream kernel. Sascha > /** >  * struct sdma_audio_config - special sdma config for audio case >  * @src_fifo_num: source fifo number for mcu_2_sai/sai_2_mcu script >  *                For example, if there are 4 fifos, sdma will fetch >  *                fifos one by one and roll back to the first fifo after >  *                the 4th fifo fetch. >  * @dst_fifo_num: similar as src_fifo_num, but dest fifo instead. >  * @src_fifo_off: source fifo offset, 0 means all fifos are continuous, 1 >  *                means 1 word offset between fifos. All offset between >  *                fifos should be same. >  * @dst_fifo_off: dst fifo offset, similar as @src_fifo_off. >  * @words_per_fifo: numbers of words per fifo fetch/fill, 0 means >  *                  one channel per fifo, 1 means 2 channels per fifo.. >  *                  If 'src_fifo_num =  4' and 'chans_per_fifo = 1', it >  *                  means the first two words(channels) fetch from fifo1 >  *                  and then jump to fifo2 for next two words, and so on >  *                  after the last fifo4 fetched, roll back to fifo1. >  * @sw_done_sel: software done selector, PDM need enable software done > feature >  *               in mcu_2_sai/sai_2_mcu script. >  *               Bit31: sw_done eanbled or not >  *               Bit16~Bit0: selector >  *               For example: 0x80000000 means sw_done enabled for done0 >  *                            sector which is for PDM on i.mx8mm. >  */ > struct sdma_audio_config { >         u8 src_fifo_num; >         u8 dst_fifo_num; >         u8 src_fifo_off; >         u8 dst_fifo_off; >         u8 words_per_fifo; >         u32 sw_done_sel; > }; > best regards > wang shengjiu >   > > References > > Visible links > 1. mailto:s.hauer@pengutronix.de > 2. mailto:s.hauer@pengutronix.de -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | 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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0B066C433EF for ; Thu, 17 Mar 2022 10:20:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232301AbiCQKVO (ORCPT ); Thu, 17 Mar 2022 06:21:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231810AbiCQKVN (ORCPT ); Thu, 17 Mar 2022 06:21:13 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1551FE9C91 for ; Thu, 17 Mar 2022 03:19:57 -0700 (PDT) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nUnEV-0004ft-VH; Thu, 17 Mar 2022 11:19:51 +0100 Received: from sha by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1nUnEU-0002Qv-Pz; Thu, 17 Mar 2022 11:19:50 +0100 Date: Thu, 17 Mar 2022 11:19:50 +0100 From: Sascha Hauer To: Shengjiu Wang Cc: alsa-devel@alsa-project.org, Xiubo Li , Fabio Estevam , Sascha Hauer , Vinod Koul , NXP Linux Team , dmaengine@vger.kernel.org, joy.zou@nxp.com Subject: Re: [PATCH 10/19] dma: imx-sdma: Add multi fifo support Message-ID: <20220317101950.GU405@pengutronix.de> References: <20220317082818.503143-1-s.hauer@pengutronix.de> <20220317082818.503143-11-s.hauer@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 10:42:35 up 96 days, 18:28, 78 users, load average: 0.19, 0.14, 0.15 User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 X-SA-Exim-Mail-From: sha@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dmaengine@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On Thu, Mar 17, 2022 at 05:08:55PM +0800, Shengjiu Wang wrote: > On Thu, Mar 17, 2022 at 4:28 PM Sascha Hauer <[1]s.hauer@pengutronix.de> > wrote: > > +struct sdma_peripheral_config { > +       int n_fifos_src; > +       int n_fifos_dst; > +       bool sw_done; > +}; > + >  #endif > > Hi Sascha > This is our internal definition for this sdma_peripheral_config. > Could you please adopt this? This structure is completely internal to the kernel and can be adjusted when we need it. I don't see a reason to add unused fields to it just to be compatible with a downstream kernel. Sascha > /** >  * struct sdma_audio_config - special sdma config for audio case >  * @src_fifo_num: source fifo number for mcu_2_sai/sai_2_mcu script >  *                For example, if there are 4 fifos, sdma will fetch >  *                fifos one by one and roll back to the first fifo after >  *                the 4th fifo fetch. >  * @dst_fifo_num: similar as src_fifo_num, but dest fifo instead. >  * @src_fifo_off: source fifo offset, 0 means all fifos are continuous, 1 >  *                means 1 word offset between fifos. All offset between >  *                fifos should be same. >  * @dst_fifo_off: dst fifo offset, similar as @src_fifo_off. >  * @words_per_fifo: numbers of words per fifo fetch/fill, 0 means >  *                  one channel per fifo, 1 means 2 channels per fifo.. >  *                  If 'src_fifo_num =  4' and 'chans_per_fifo = 1', it >  *                  means the first two words(channels) fetch from fifo1 >  *                  and then jump to fifo2 for next two words, and so on >  *                  after the last fifo4 fetched, roll back to fifo1. >  * @sw_done_sel: software done selector, PDM need enable software done > feature >  *               in mcu_2_sai/sai_2_mcu script. >  *               Bit31: sw_done eanbled or not >  *               Bit16~Bit0: selector >  *               For example: 0x80000000 means sw_done enabled for done0 >  *                            sector which is for PDM on i.mx8mm. >  */ > struct sdma_audio_config { >         u8 src_fifo_num; >         u8 dst_fifo_num; >         u8 src_fifo_off; >         u8 dst_fifo_off; >         u8 words_per_fifo; >         u32 sw_done_sel; > }; > best regards > wang shengjiu >   > > References > > Visible links > 1. mailto:s.hauer@pengutronix.de > 2. mailto:s.hauer@pengutronix.de -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |