]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
ASoC: Intel: catpt: Simplify the RAM-navigation code
authorCezary Rojewski <cezary.rojewski@intel.com>
Wed, 3 Jun 2026 08:58:23 +0000 (10:58 +0200)
committerMark Brown <broonie@kernel.org>
Thu, 4 Jun 2026 16:00:23 +0000 (17:00 +0100)
Add catpt_iram_addr() to the catpt helpers family and replace all the
open arithmetics with them.  Makes it easier to understand the code.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Cezary Rojewski <cezary.rojewski@intel.com>
Link: https://patch.msgid.link/20260603085827.1964796-4-cezary.rojewski@intel.com
Signed-off-by: Mark Brown <broonie@kernel.org>
sound/soc/intel/catpt/dsp.c
sound/soc/intel/catpt/registers.h

index b1865d10f9957be7a30b22d861bbaf3d65d85e7f..60ec561d670c759f1fb62af9f8b546e2d4d23f63 100644 (file)
@@ -122,7 +122,7 @@ int catpt_dmac_probe(struct catpt_dev *cdev)
        if (!dmac)
                return -ENOMEM;
 
-       dmac->regs = cdev->lpe_ba + cdev->spec->host_dma_offset[CATPT_DMA_DEVID];
+       dmac->regs = catpt_dma_addr(cdev, CATPT_DMA_DEVID);
        dmac->dev = cdev->dev;
        dmac->irq = cdev->irq;
 
@@ -498,7 +498,7 @@ int catpt_coredump(struct catpt_dev *cdev)
        hdr->size = resource_size(&cdev->iram);
        pos += sizeof(*hdr);
 
-       memcpy_fromio(pos, cdev->lpe_ba + cdev->iram.start, hdr->size);
+       memcpy_fromio(pos, catpt_iram_addr(cdev), hdr->size);
        pos += hdr->size;
 
        hdr = (struct catpt_dump_section_hdr *)pos;
@@ -508,7 +508,7 @@ int catpt_coredump(struct catpt_dev *cdev)
        hdr->size = resource_size(&cdev->dram);
        pos += sizeof(*hdr);
 
-       memcpy_fromio(pos, cdev->lpe_ba + cdev->dram.start, hdr->size);
+       memcpy_fromio(pos, catpt_dram_addr(cdev), hdr->size);
        pos += hdr->size;
 
        hdr = (struct catpt_dump_section_hdr *)pos;
index 64bd534a76ff460874ad4fc98c327eecc081dcd5..864802bd7809c7ed9aba315fe1b4182ce07dd464 100644 (file)
 
 #define catpt_dram_addr(cdev) \
        ((cdev)->lpe_ba + (cdev)->spec->host_dram_offset)
+#define catpt_iram_addr(cdev) \
+       ((cdev)->lpe_ba + (cdev)->spec->host_iram_offset)
 #define catpt_shim_addr(cdev) \
        ((cdev)->lpe_ba + (cdev)->spec->host_shim_offset)
 #define catpt_dma_addr(cdev, dma) \