From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2999555AbdEAGKp (ORCPT ); Mon, 1 May 2017 02:10:45 -0400 Received: from mga11.intel.com ([192.55.52.93]:56974 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1948377AbdEAGKi (ORCPT ); Mon, 1 May 2017 02:10:38 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,399,1488873600"; d="scan'208";a="1163044329" Date: Mon, 1 May 2017 11:42:30 +0530 From: Vinod Koul To: Pierre Yves MORDRET Cc: "M'boumba Cedric Madianga" , "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , Alexandre TORGUE , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , "mcoquelin.stm32@gmail.com" , "dmaengine@vger.kernel.org" , "dan.j.williams@intel.com" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [PATCH 2/2] dmaengine: Add STM32 MDMA driver Message-ID: <20170501061230.GP6263@localhost> References: <1489417599-31308-1-git-send-email-cedric.madianga@gmail.com> <1489417599-31308-3-git-send-email-cedric.madianga@gmail.com> <20170406070805.GG4094@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 26, 2017 at 12:35:46PM +0000, Pierre Yves MORDRET wrote: > On 04/06/2017 09:08 AM, Vinod Koul wrote: > >> +static int stm32_mdma_get_width(struct stm32_mdma_chan *chan, > >> + enum dma_slave_buswidth width) > >> +{ > >> + switch (width) { > >> + case DMA_SLAVE_BUSWIDTH_1_BYTE: > >> + return STM32_MDMA_BYTE; > >> + case DMA_SLAVE_BUSWIDTH_2_BYTES: > >> + return STM32_MDMA_HALF_WORD; > >> + case DMA_SLAVE_BUSWIDTH_4_BYTES: > >> + return STM32_MDMA_WORD; > >> + case DMA_SLAVE_BUSWIDTH_8_BYTES: > >> + return STM32_MDMA_DOUBLE_WORD; > > > > IIUC we can do this with ffs() > > I don't believe we can do that. This function translates DMA_SLAVE enum > into internal register representation. Yes and internal represenation seemed to be ffs() of dmanegine one. > >> +subsys_initcall(stm32_mdma_init); > > > > why subsys? > > > > subsys_initcall level is to ensure MDMA is going to be probed before its > clients Please use deffered probe approach for that -- ~Vinod From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vinod Koul Subject: Re: [PATCH 2/2] dmaengine: Add STM32 MDMA driver Date: Mon, 1 May 2017 11:42:30 +0530 Message-ID: <20170501061230.GP6263@localhost> References: <1489417599-31308-1-git-send-email-cedric.madianga@gmail.com> <1489417599-31308-3-git-send-email-cedric.madianga@gmail.com> <20170406070805.GG4094@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Pierre Yves MORDRET Cc: M'boumba Cedric Madianga , "mark.rutland@arm.com" , "devicetree@vger.kernel.org" , Alexandre TORGUE , "linux-kernel@vger.kernel.org" , "robh+dt@kernel.org" , "mcoquelin.stm32@gmail.com" , "dmaengine@vger.kernel.org" , "dan.j.williams@intel.com" , "linux-arm-kernel@lists.infradead.org" List-Id: devicetree@vger.kernel.org On Wed, Apr 26, 2017 at 12:35:46PM +0000, Pierre Yves MORDRET wrote: > On 04/06/2017 09:08 AM, Vinod Koul wrote: > >> +static int stm32_mdma_get_width(struct stm32_mdma_chan *chan, > >> + enum dma_slave_buswidth width) > >> +{ > >> + switch (width) { > >> + case DMA_SLAVE_BUSWIDTH_1_BYTE: > >> + return STM32_MDMA_BYTE; > >> + case DMA_SLAVE_BUSWIDTH_2_BYTES: > >> + return STM32_MDMA_HALF_WORD; > >> + case DMA_SLAVE_BUSWIDTH_4_BYTES: > >> + return STM32_MDMA_WORD; > >> + case DMA_SLAVE_BUSWIDTH_8_BYTES: > >> + return STM32_MDMA_DOUBLE_WORD; > > > > IIUC we can do this with ffs() > > I don't believe we can do that. This function translates DMA_SLAVE enum > into internal register representation. Yes and internal represenation seemed to be ffs() of dmanegine one. > >> +subsys_initcall(stm32_mdma_init); > > > > why subsys? > > > > subsys_initcall level is to ensure MDMA is going to be probed before its > clients Please use deffered probe approach for that -- ~Vinod From mboxrd@z Thu Jan 1 00:00:00 1970 From: vinod.koul@intel.com (Vinod Koul) Date: Mon, 1 May 2017 11:42:30 +0530 Subject: [PATCH 2/2] dmaengine: Add STM32 MDMA driver In-Reply-To: References: <1489417599-31308-1-git-send-email-cedric.madianga@gmail.com> <1489417599-31308-3-git-send-email-cedric.madianga@gmail.com> <20170406070805.GG4094@localhost> Message-ID: <20170501061230.GP6263@localhost> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Wed, Apr 26, 2017 at 12:35:46PM +0000, Pierre Yves MORDRET wrote: > On 04/06/2017 09:08 AM, Vinod Koul wrote: > >> +static int stm32_mdma_get_width(struct stm32_mdma_chan *chan, > >> + enum dma_slave_buswidth width) > >> +{ > >> + switch (width) { > >> + case DMA_SLAVE_BUSWIDTH_1_BYTE: > >> + return STM32_MDMA_BYTE; > >> + case DMA_SLAVE_BUSWIDTH_2_BYTES: > >> + return STM32_MDMA_HALF_WORD; > >> + case DMA_SLAVE_BUSWIDTH_4_BYTES: > >> + return STM32_MDMA_WORD; > >> + case DMA_SLAVE_BUSWIDTH_8_BYTES: > >> + return STM32_MDMA_DOUBLE_WORD; > > > > IIUC we can do this with ffs() > > I don't believe we can do that. This function translates DMA_SLAVE enum > into internal register representation. Yes and internal represenation seemed to be ffs() of dmanegine one. > >> +subsys_initcall(stm32_mdma_init); > > > > why subsys? > > > > subsys_initcall level is to ensure MDMA is going to be probed before its > clients Please use deffered probe approach for that -- ~Vinod