All of lore.kernel.org
 help / color / mirror / Atom feed
From: vinod.koul@intel.com (Vinod Koul)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] dmaengine: Add STM32 MDMA driver
Date: Mon, 1 May 2017 11:42:30 +0530	[thread overview]
Message-ID: <20170501061230.GP6263@localhost> (raw)
In-Reply-To: <d1d92f79-ce3c-e057-7f47-1fd5e42fa5dc@st.com>

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

WARNING: multiple messages have this Message-ID (diff)
From: Vinod Koul <vinod.koul@intel.com>
To: Pierre Yves MORDRET <pierre-yves.mordret@st.com>
Cc: M'boumba Cedric Madianga <cedric.madianga@gmail.com>,
	"mark.rutland@arm.com" <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	Alexandre TORGUE <alexandre.torgue@st.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"mcoquelin.stm32@gmail.com" <mcoquelin.stm32@gmail.com>,
	"dmaengine@vger.kernel.org" <dmaengine@vger.kernel.org>,
	"dan.j.williams@intel.com" <dan.j.williams@intel.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 2/2] dmaengine: Add STM32 MDMA driver
Date: Mon, 1 May 2017 11:42:30 +0530	[thread overview]
Message-ID: <20170501061230.GP6263@localhost> (raw)
In-Reply-To: <d1d92f79-ce3c-e057-7f47-1fd5e42fa5dc@st.com>

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

  reply	other threads:[~2017-05-01  6:12 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-13 15:06 [PATCH 0/2] Add STM32 MDMA driver M'boumba Cedric Madianga
2017-03-13 15:06 ` M'boumba Cedric Madianga
2017-03-13 15:06 ` M'boumba Cedric Madianga
2017-03-13 15:06 ` [PATCH 1/2] dt-bindings: Document the STM32 MDMA bindings M'boumba Cedric Madianga
2017-03-13 15:06   ` M'boumba Cedric Madianga
2017-03-20 21:52   ` Rob Herring
2017-03-20 21:52     ` Rob Herring
2017-03-20 21:52     ` Rob Herring
2017-03-27 10:06     ` M'boumba Cedric Madianga
2017-03-27 10:06       ` M'boumba Cedric Madianga
2017-03-28 16:26       ` Rob Herring
2017-03-28 16:26         ` Rob Herring
2017-03-28 16:26         ` Rob Herring
2017-03-29  8:07         ` M'boumba Cedric Madianga
2017-03-29  8:07           ` M'boumba Cedric Madianga
2017-03-29  8:07           ` M'boumba Cedric Madianga
2017-03-13 15:06 ` [PATCH 2/2] dmaengine: Add STM32 MDMA driver M'boumba Cedric Madianga
2017-03-13 15:06   ` M'boumba Cedric Madianga
2017-03-13 15:06   ` M'boumba Cedric Madianga
2017-04-06  7:08   ` Vinod Koul
2017-04-06  7:08     ` Vinod Koul
2017-04-06  7:08     ` Vinod Koul
2017-04-26 12:35     ` Pierre Yves MORDRET
2017-04-26 12:35       ` Pierre Yves MORDRET
2017-04-26 12:35       ` Pierre Yves MORDRET
2017-05-01  6:12       ` Vinod Koul [this message]
2017-05-01  6:12         ` Vinod Koul

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170501061230.GP6263@localhost \
    --to=vinod.koul@intel.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.