Skip to content

Commit

Permalink
dmaengine: omap-dma: Take DMA request number from DT if it is available
Browse files Browse the repository at this point in the history
Use the dma-requests property from DT to get the number of DMA requests.
In case of legacy boot or failure to find the property, use the default
127 as number of requests.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
  • Loading branch information
Peter Ujfalusi authored and Vinod Koul committed May 9, 2015
1 parent 341ce71 commit de50608
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion drivers/dma/omap-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ struct omap_dmadev {
const struct omap_dma_reg *reg_map;
struct omap_system_dma_plat_info *plat;
bool legacy;
unsigned dma_requests;
spinlock_t irq_lock;
uint32_t irq_enable_mask;
struct omap_chan *lch_map[OMAP_SDMA_CHANNELS];
Expand Down Expand Up @@ -1119,7 +1120,16 @@ static int omap_dma_probe(struct platform_device *pdev)

tasklet_init(&od->task, omap_dma_sched, (unsigned long)od);

for (i = 0; i < OMAP_SDMA_REQUESTS; i++) {
od->dma_requests = OMAP_SDMA_REQUESTS;
if (pdev->dev.of_node && of_property_read_u32(pdev->dev.of_node,
"dma-requests",
&od->dma_requests)) {
dev_info(&pdev->dev,
"Missing dma-requests property, using %u.\n",
OMAP_SDMA_REQUESTS);
}

for (i = 0; i < od->dma_requests; i++) {
rc = omap_dma_chan_init(od, i);
if (rc) {
omap_dma_free(od);
Expand Down

0 comments on commit de50608

Please sign in to comment.