summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2026-06-03 11:58:23 +0300
committerMark Brown <broonie@kernel.org>2026-06-04 19:00:23 +0300
commitfa55ad6079b0cd4a974bc32ea2dcb98162f29c25 (patch)
tree8e562411423417eb95ea254be5bb0bcea0a797a4
parenta88cd88eee750383be83013e1875fc0a6509d5bd (diff)
downloadlinux-fa55ad6079b0cd4a974bc32ea2dcb98162f29c25.tar.xz
ASoC: Intel: catpt: Simplify the RAM-navigation code
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>
-rw-r--r--sound/soc/intel/catpt/dsp.c6
-rw-r--r--sound/soc/intel/catpt/registers.h2
2 files changed, 5 insertions, 3 deletions
diff --git a/sound/soc/intel/catpt/dsp.c b/sound/soc/intel/catpt/dsp.c
index b1865d10f995..60ec561d670c 100644
--- a/sound/soc/intel/catpt/dsp.c
+++ b/sound/soc/intel/catpt/dsp.c
@@ -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;
diff --git a/sound/soc/intel/catpt/registers.h b/sound/soc/intel/catpt/registers.h
index 64bd534a76ff..864802bd7809 100644
--- a/sound/soc/intel/catpt/registers.h
+++ b/sound/soc/intel/catpt/registers.h
@@ -144,6 +144,8 @@
#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) \