Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: dw: register IRQ and DMA pool with instance ID

It is really useful not only for debugging to have an IRQ line and DMA
pool labeled with driver and its instance ID. Do this for DesignWare DMA
driver.

All current users of this IP would be enhanced later on.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>

authored by

Andy Shevchenko and committed by
Vinod Koul
08d62f58 a46a7634

+10 -2
+5 -2
drivers/dma/dw/core.c
··· 1502 1502 /* Force dma off, just in case */ 1503 1503 dw_dma_off(dw); 1504 1504 1505 + /* Device and instance ID for IRQ and DMA pool */ 1506 + snprintf(dw->name, sizeof(dw->name), "dw:dmac%d", chip->id); 1507 + 1505 1508 /* Create a pool of consistent memory blocks for hardware descriptors */ 1506 - dw->desc_pool = dmam_pool_create("dw_dmac_desc_pool", chip->dev, 1509 + dw->desc_pool = dmam_pool_create(dw->name, chip->dev, 1507 1510 sizeof(struct dw_desc), 4, 0); 1508 1511 if (!dw->desc_pool) { 1509 1512 dev_err(chip->dev, "No memory for descriptors dma pool\n"); ··· 1517 1514 tasklet_init(&dw->tasklet, dw_dma_tasklet, (unsigned long)dw); 1518 1515 1519 1516 err = request_irq(chip->irq, dw_dma_interrupt, IRQF_SHARED, 1520 - "dw_dmac", dw); 1517 + dw->name, dw); 1521 1518 if (err) 1522 1519 goto err_pdata; 1523 1520
+1
drivers/dma/dw/pci.c
··· 47 47 return -ENOMEM; 48 48 49 49 chip->dev = &pdev->dev; 50 + chip->id = pdev->devfn; 50 51 chip->regs = pcim_iomap_table(pdev)[0]; 51 52 chip->irq = pdev->irq; 52 53 chip->pdata = pdata;
+1
drivers/dma/dw/platform.c
··· 202 202 pdata = dw_dma_parse_dt(pdev); 203 203 204 204 chip->dev = dev; 205 + chip->id = pdev->id; 205 206 chip->pdata = pdata; 206 207 207 208 chip->clk = devm_clk_get(chip->dev, "hclk");
+1
drivers/dma/dw/regs.h
··· 270 270 271 271 struct dw_dma { 272 272 struct dma_device dma; 273 + char name[20]; 273 274 void __iomem *regs; 274 275 struct dma_pool *desc_pool; 275 276 struct tasklet_struct tasklet;
+2
include/linux/dma/dw.h
··· 23 23 /** 24 24 * struct dw_dma_chip - representation of DesignWare DMA controller hardware 25 25 * @dev: struct device of the DMA controller 26 + * @id: instance ID 26 27 * @irq: irq line 27 28 * @regs: memory mapped I/O space 28 29 * @clk: hclk clock ··· 32 31 */ 33 32 struct dw_dma_chip { 34 33 struct device *dev; 34 + int id; 35 35 int irq; 36 36 void __iomem *regs; 37 37 struct clk *clk;