linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] dw_dmac: utilize slave_id to pass request line
@ 2012-09-03 10:46 Andy Shevchenko
  2012-09-03 10:57 ` viresh kumar
  2012-09-14  3:00 ` Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Andy Shevchenko @ 2012-09-03 10:46 UTC (permalink / raw)
  To: Viresh Kumar, linux-kernel, Vinod Koul, Heikki Krogerus; +Cc: Andy Shevchenko

There is slave_id field in the generic slave config structure that is dedicated
for the uniq slave number. In our case we have the request lines wired to the
certain hardware. Therefore the number of the request line is uniq and could be
used as slave_id. It allows us in some cases to drop out the usage of the
custom slave config structure.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/dma/dw_dmac.c |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/dma/dw_dmac.c b/drivers/dma/dw_dmac.c
index f0c9403..7a67673 100644
--- a/drivers/dma/dw_dmac.c
+++ b/drivers/dma/dw_dmac.c
@@ -187,6 +187,11 @@ static void dwc_initialize(struct dw_dma_chan *dwc)
 
 		cfghi = dws->cfg_hi;
 		cfglo |= dws->cfg_lo & ~DWC_CFGL_CH_PRIOR_MASK;
+	} else {
+		if (dwc->dma_sconfig.direction == DMA_MEM_TO_DEV)
+			cfghi = DWC_CFGH_DST_PER(dwc->dma_sconfig.slave_id);
+		else if (dwc->dma_sconfig.direction == DMA_DEV_TO_MEM)
+			cfghi = DWC_CFGH_SRC_PER(dwc->dma_sconfig.slave_id);
 	}
 
 	channel_writel(dwc, CFG_LO, cfglo);
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-09-14  3:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-03 10:46 [PATCH] dw_dmac: utilize slave_id to pass request line Andy Shevchenko
2012-09-03 10:57 ` viresh kumar
2012-09-14  3:00 ` Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).