Re: [PATCH 31/39] dmaengine: ste_dma40: Replace ST-E's home-brew DMA direction defs with generic ones

2013-05-30 Thread Linus Walleij
On Wed, May 15, 2013 at 11:51 AM, Lee Jones lee.jo...@linaro.org wrote:

 STEDMA40_*_TO_* direction definitions are identical in all but name to
 the pre-defined generic DMA_*_TO_* ones. Let's make things easy by not
 duplicating such things.

 Cc: Vinod Koul vinod.k...@intel.com
 Cc: Dan Williams d...@fb.com
 Cc: Per Forlin per.for...@stericsson.com
 Cc: Rabin Vincent ra...@rab.in
 Signed-off-by: Lee Jones lee.jo...@linaro.org

Patch applied to my dma40 branch with Vinod's ACK.

Yours,
Linus Walleij
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 31/39] dmaengine: ste_dma40: Replace ST-E's home-brew DMA direction defs with generic ones

2013-05-16 Thread Lee Jones
On Thu, 16 May 2013, Vinod Koul wrote:

 On Wed, May 15, 2013 at 10:51:54AM +0100, Lee Jones wrote:
  STEDMA40_*_TO_* direction definitions are identical in all but name to
  the pre-defined generic DMA_*_TO_* ones. Let's make things easy by not
  duplicating such things.
  
  Cc: Vinod Koul vinod.k...@intel.com
  Cc: Dan Williams d...@fb.com
  Cc: Per Forlin per.for...@stericsson.com
  Cc: Rabin Vincent ra...@rab.in
  Signed-off-by: Lee Jones lee.jo...@linaro.org
 Nice :)

:)

 1) I dont see the STE macro getting removed, why do we need it

They are removed later in the set, once their use has been removed
from platform code and all the other drivers.

 2) last i checked the direction values had a bit idfference b/w what you are
 using and what dmaengine defines, so hopefully that is taken care of..

Yes, no problem.

place Ack here ;)

-- 
Lee Jones
Linaro ST-Ericsson Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 31/39] dmaengine: ste_dma40: Replace ST-E's home-brew DMA direction defs with generic ones

2013-05-16 Thread Vinod Koul
On Thu, May 16, 2013 at 08:06:38AM +0100, Lee Jones wrote:
 On Thu, 16 May 2013, Vinod Koul wrote:
 
  On Wed, May 15, 2013 at 10:51:54AM +0100, Lee Jones wrote:
   STEDMA40_*_TO_* direction definitions are identical in all but name to
   the pre-defined generic DMA_*_TO_* ones. Let's make things easy by not
   duplicating such things.
   
   Cc: Vinod Koul vinod.k...@intel.com
   Cc: Dan Williams d...@fb.com
   Cc: Per Forlin per.for...@stericsson.com
   Cc: Rabin Vincent ra...@rab.in
   Signed-off-by: Lee Jones lee.jo...@linaro.org
  Nice :)
 
 :)
 
  1) I dont see the STE macro getting removed, why do we need it
 
 They are removed later in the set, once their use has been removed
 from platform code and all the other drivers.
 
  2) last i checked the direction values had a bit idfference b/w what you are
  using and what dmaengine defines, so hopefully that is taken care of..
 
 Yes, no problem.
 
 place Ack here ;)
Acked-by: Vinod Koul vinod.k...@intel.com

--
~Vinod
 
 -- 
 Lee Jones
 Linaro ST-Ericsson Landing Team Lead
 Linaro.org │ Open source software for ARM SoCs
 Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 31/39] dmaengine: ste_dma40: Replace ST-E's home-brew DMA direction defs with generic ones

2013-05-15 Thread Lee Jones
STEDMA40_*_TO_* direction definitions are identical in all but name to
the pre-defined generic DMA_*_TO_* ones. Let's make things easy by not
duplicating such things.

Cc: Vinod Koul vinod.k...@intel.com
Cc: Dan Williams d...@fb.com
Cc: Per Forlin per.for...@stericsson.com
Cc: Rabin Vincent ra...@rab.in
Signed-off-by: Lee Jones lee.jo...@linaro.org
---
 drivers/dma/ste_dma40.c|   56 ++--
 drivers/dma/ste_dma40_ll.c |   24 +--
 2 files changed, 40 insertions(+), 40 deletions(-)

diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 08bc58a..483da16 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -78,7 +78,7 @@ static int dma40_memcpy_channels[] = {
 /* Default configuration for physcial memcpy */
 struct stedma40_chan_cfg dma40_memcpy_conf_phy = {
.mode = STEDMA40_MODE_PHYSICAL,
-   .dir = STEDMA40_MEM_TO_MEM,
+   .dir = DMA_MEM_TO_MEM,
 
.src_info.data_width = STEDMA40_BYTE_WIDTH,
.src_info.psize = STEDMA40_PSIZE_PHY_1,
@@ -92,7 +92,7 @@ struct stedma40_chan_cfg dma40_memcpy_conf_phy = {
 /* Default configuration for logical memcpy */
 struct stedma40_chan_cfg dma40_memcpy_conf_log = {
.mode = STEDMA40_MODE_LOGICAL,
-   .dir = STEDMA40_MEM_TO_MEM,
+   .dir = DMA_MEM_TO_MEM,
 
.src_info.data_width = STEDMA40_BYTE_WIDTH,
.src_info.psize = STEDMA40_PSIZE_LOG_1,
@@ -843,7 +843,7 @@ static void d40_log_lli_to_lcxa(struct d40_chan *chan, 
struct d40_desc *desc)
 * that uses linked lists.
 */
if (!(chan-phy_chan-use_soft_lli 
-   chan-dma_cfg.dir == STEDMA40_PERIPH_TO_MEM))
+   chan-dma_cfg.dir == DMA_DEV_TO_MEM))
curr_lcla = d40_lcla_alloc_one(chan, desc);
 
first_lcla = curr_lcla;
@@ -1311,12 +1311,12 @@ static void d40_config_set_event(struct d40_chan *d40c,
u32 event = D40_TYPE_TO_EVENT(d40c-dma_cfg.dev_type);
 
/* Enable event line connected to device (or memcpy) */
-   if ((d40c-dma_cfg.dir ==  STEDMA40_PERIPH_TO_MEM) ||
-   (d40c-dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH))
+   if ((d40c-dma_cfg.dir == DMA_DEV_TO_MEM) ||
+   (d40c-dma_cfg.dir == DMA_DEV_TO_DEV))
__d40_config_set_event(d40c, event_type, event,
   D40_CHAN_REG_SSLNK);
 
-   if (d40c-dma_cfg.dir !=  STEDMA40_PERIPH_TO_MEM)
+   if (d40c-dma_cfg.dir !=  DMA_DEV_TO_MEM)
__d40_config_set_event(d40c, event_type, event,
   D40_CHAN_REG_SDLNK);
 }
@@ -1774,7 +1774,7 @@ static int d40_validate_conf(struct d40_chan *d40c,
res = -EINVAL;
}
 
-   if (conf-dir == STEDMA40_PERIPH_TO_PERIPH) {
+   if (conf-dir == DMA_DEV_TO_DEV) {
/*
 * DMAC HW supports it. Will be added to this driver,
 * in case any dma client requires it.
@@ -1905,11 +1905,11 @@ static int d40_allocate_channel(struct d40_chan *d40c, 
bool *first_phy_user)
phys = d40c-base-phy_res;
num_phy_chans = d40c-base-num_phy_chans;
 
-   if (d40c-dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) {
+   if (d40c-dma_cfg.dir == DMA_DEV_TO_MEM) {
log_num = 2 * dev_type;
is_src = true;
-   } else if (d40c-dma_cfg.dir == STEDMA40_MEM_TO_PERIPH ||
-  d40c-dma_cfg.dir == STEDMA40_MEM_TO_MEM) {
+   } else if (d40c-dma_cfg.dir == DMA_MEM_TO_DEV ||
+  d40c-dma_cfg.dir == DMA_MEM_TO_MEM) {
/* dst event lines are used for logical memcpy */
log_num = 2 * dev_type + 1;
is_src = false;
@@ -1920,7 +1920,7 @@ static int d40_allocate_channel(struct d40_chan *d40c, 
bool *first_phy_user)
event_line = D40_TYPE_TO_EVENT(dev_type);
 
if (!is_log) {
-   if (d40c-dma_cfg.dir == STEDMA40_MEM_TO_MEM) {
+   if (d40c-dma_cfg.dir == DMA_MEM_TO_MEM) {
/* Find physical half channel */
if (d40c-dma_cfg.use_fixed_channel) {
i = d40c-dma_cfg.phy_channel;
@@ -2068,10 +2068,10 @@ static int d40_free_dma(struct d40_chan *d40c)
return -EINVAL;
}
 
-   if (d40c-dma_cfg.dir == STEDMA40_MEM_TO_PERIPH ||
-   d40c-dma_cfg.dir == STEDMA40_MEM_TO_MEM)
+   if (d40c-dma_cfg.dir == DMA_MEM_TO_DEV ||
+   d40c-dma_cfg.dir == DMA_MEM_TO_MEM)
is_src = false;
-   else if (d40c-dma_cfg.dir == STEDMA40_PERIPH_TO_MEM)
+   else if (d40c-dma_cfg.dir == DMA_DEV_TO_MEM)
is_src = true;
else {
chan_err(d40c, Unknown direction\n);
@@ -2133,10 +2133,10 @@ static bool d40_is_paused(struct d40_chan *d40c)
goto _exit;
}
 
-   if (d40c-dma_cfg.dir == 

Re: [PATCH 31/39] dmaengine: ste_dma40: Replace ST-E's home-brew DMA direction defs with generic ones

2013-05-15 Thread Vinod Koul
On Wed, May 15, 2013 at 10:51:54AM +0100, Lee Jones wrote:
 STEDMA40_*_TO_* direction definitions are identical in all but name to
 the pre-defined generic DMA_*_TO_* ones. Let's make things easy by not
 duplicating such things.
 
 Cc: Vinod Koul vinod.k...@intel.com
 Cc: Dan Williams d...@fb.com
 Cc: Per Forlin per.for...@stericsson.com
 Cc: Rabin Vincent ra...@rab.in
 Signed-off-by: Lee Jones lee.jo...@linaro.org
Nice :)

1) I dont see the STE macro getting removed, why do we need it
2) last i checked the direction values had a bit idfference b/w what you are
using and what dmaengine defines, so hopefully that is taken care of..

--
~Vinod
 ---
  drivers/dma/ste_dma40.c|   56 
 ++--
  drivers/dma/ste_dma40_ll.c |   24 +--
  2 files changed, 40 insertions(+), 40 deletions(-)
 
 diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
 index 08bc58a..483da16 100644
 --- a/drivers/dma/ste_dma40.c
 +++ b/drivers/dma/ste_dma40.c
 @@ -78,7 +78,7 @@ static int dma40_memcpy_channels[] = {
  /* Default configuration for physcial memcpy */
  struct stedma40_chan_cfg dma40_memcpy_conf_phy = {
   .mode = STEDMA40_MODE_PHYSICAL,
 - .dir = STEDMA40_MEM_TO_MEM,
 + .dir = DMA_MEM_TO_MEM,
  
   .src_info.data_width = STEDMA40_BYTE_WIDTH,
   .src_info.psize = STEDMA40_PSIZE_PHY_1,
 @@ -92,7 +92,7 @@ struct stedma40_chan_cfg dma40_memcpy_conf_phy = {
  /* Default configuration for logical memcpy */
  struct stedma40_chan_cfg dma40_memcpy_conf_log = {
   .mode = STEDMA40_MODE_LOGICAL,
 - .dir = STEDMA40_MEM_TO_MEM,
 + .dir = DMA_MEM_TO_MEM,
  
   .src_info.data_width = STEDMA40_BYTE_WIDTH,
   .src_info.psize = STEDMA40_PSIZE_LOG_1,
 @@ -843,7 +843,7 @@ static void d40_log_lli_to_lcxa(struct d40_chan *chan, 
 struct d40_desc *desc)
* that uses linked lists.
*/
   if (!(chan-phy_chan-use_soft_lli 
 - chan-dma_cfg.dir == STEDMA40_PERIPH_TO_MEM))
 + chan-dma_cfg.dir == DMA_DEV_TO_MEM))
   curr_lcla = d40_lcla_alloc_one(chan, desc);
  
   first_lcla = curr_lcla;
 @@ -1311,12 +1311,12 @@ static void d40_config_set_event(struct d40_chan 
 *d40c,
   u32 event = D40_TYPE_TO_EVENT(d40c-dma_cfg.dev_type);
  
   /* Enable event line connected to device (or memcpy) */
 - if ((d40c-dma_cfg.dir ==  STEDMA40_PERIPH_TO_MEM) ||
 - (d40c-dma_cfg.dir == STEDMA40_PERIPH_TO_PERIPH))
 + if ((d40c-dma_cfg.dir == DMA_DEV_TO_MEM) ||
 + (d40c-dma_cfg.dir == DMA_DEV_TO_DEV))
   __d40_config_set_event(d40c, event_type, event,
  D40_CHAN_REG_SSLNK);
  
 - if (d40c-dma_cfg.dir !=  STEDMA40_PERIPH_TO_MEM)
 + if (d40c-dma_cfg.dir !=  DMA_DEV_TO_MEM)
   __d40_config_set_event(d40c, event_type, event,
  D40_CHAN_REG_SDLNK);
  }
 @@ -1774,7 +1774,7 @@ static int d40_validate_conf(struct d40_chan *d40c,
   res = -EINVAL;
   }
  
 - if (conf-dir == STEDMA40_PERIPH_TO_PERIPH) {
 + if (conf-dir == DMA_DEV_TO_DEV) {
   /*
* DMAC HW supports it. Will be added to this driver,
* in case any dma client requires it.
 @@ -1905,11 +1905,11 @@ static int d40_allocate_channel(struct d40_chan 
 *d40c, bool *first_phy_user)
   phys = d40c-base-phy_res;
   num_phy_chans = d40c-base-num_phy_chans;
  
 - if (d40c-dma_cfg.dir == STEDMA40_PERIPH_TO_MEM) {
 + if (d40c-dma_cfg.dir == DMA_DEV_TO_MEM) {
   log_num = 2 * dev_type;
   is_src = true;
 - } else if (d40c-dma_cfg.dir == STEDMA40_MEM_TO_PERIPH ||
 -d40c-dma_cfg.dir == STEDMA40_MEM_TO_MEM) {
 + } else if (d40c-dma_cfg.dir == DMA_MEM_TO_DEV ||
 +d40c-dma_cfg.dir == DMA_MEM_TO_MEM) {
   /* dst event lines are used for logical memcpy */
   log_num = 2 * dev_type + 1;
   is_src = false;
 @@ -1920,7 +1920,7 @@ static int d40_allocate_channel(struct d40_chan *d40c, 
 bool *first_phy_user)
   event_line = D40_TYPE_TO_EVENT(dev_type);
  
   if (!is_log) {
 - if (d40c-dma_cfg.dir == STEDMA40_MEM_TO_MEM) {
 + if (d40c-dma_cfg.dir == DMA_MEM_TO_MEM) {
   /* Find physical half channel */
   if (d40c-dma_cfg.use_fixed_channel) {
   i = d40c-dma_cfg.phy_channel;
 @@ -2068,10 +2068,10 @@ static int d40_free_dma(struct d40_chan *d40c)
   return -EINVAL;
   }
  
 - if (d40c-dma_cfg.dir == STEDMA40_MEM_TO_PERIPH ||
 - d40c-dma_cfg.dir == STEDMA40_MEM_TO_MEM)
 + if (d40c-dma_cfg.dir == DMA_MEM_TO_DEV ||
 + d40c-dma_cfg.dir == DMA_MEM_TO_MEM)
   is_src = false;
 - else if (d40c-dma_cfg.dir == STEDMA40_PERIPH_TO_MEM)
 + else if (d40c-dma_cfg.dir ==