summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCezary Rojewski <cezary.rojewski@intel.com>2026-06-03 11:58:22 +0300
committerMark Brown <broonie@kernel.org>2026-06-04 19:00:22 +0300
commita88cd88eee750383be83013e1875fc0a6509d5bd (patch)
tree4d89233c37e47cc08c0328762407d6e9fb211299
parent36685d0b05d91e13df5cb65726b7cb4c026e41d0 (diff)
downloadlinux-a88cd88eee750383be83013e1875fc0a6509d5bd.tar.xz
ASoC: Intel: catpt: Replace RAM-helpers with resource_xxx()
For catpt_sram_init(), the exact same functionality has been provided to ioport.h with commit 9fb6fef0fb49 ("resource: Add resource set range and size helpers") in recent years. As for catpt_dram/iram_size(), leave it for the driver initialization only. Have all other manipulations be done using resource_xxx() API which are more familiar to kernel developers. 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-3-cezary.rojewski@intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/intel/catpt/core.h1
-rw-r--r--sound/soc/intel/catpt/device.c9
-rw-r--r--sound/soc/intel/catpt/loader.c7
3 files changed, 4 insertions, 13 deletions
diff --git a/sound/soc/intel/catpt/core.h b/sound/soc/intel/catpt/core.h
index 7e479ef89ad0..3881164422b8 100644
--- a/sound/soc/intel/catpt/core.h
+++ b/sound/soc/intel/catpt/core.h
@@ -17,7 +17,6 @@ struct catpt_dev;
extern const struct attribute_group *catpt_attr_groups[];
-void catpt_sram_init(struct resource *sram, u32 start, u32 size);
void catpt_sram_free(struct resource *sram);
struct resource *
catpt_request_region(struct resource *root, resource_size_t size);
diff --git a/sound/soc/intel/catpt/device.c b/sound/soc/intel/catpt/device.c
index b0a926db483c..b176aebea9d5 100644
--- a/sound/soc/intel/catpt/device.c
+++ b/sound/soc/intel/catpt/device.c
@@ -233,12 +233,9 @@ static void catpt_dev_init(struct catpt_dev *cdev, struct device *dev,
cdev->devfmt[CATPT_SSP_IFACE_0].iface = UINT_MAX;
cdev->devfmt[CATPT_SSP_IFACE_1].iface = UINT_MAX;
+ resource_set_range(&cdev->dram, spec->host_dram_offset, catpt_dram_size(cdev));
+ resource_set_range(&cdev->iram, spec->host_iram_offset, catpt_iram_size(cdev));
catpt_ipc_init(&cdev->ipc, dev);
-
- catpt_sram_init(&cdev->dram, spec->host_dram_offset,
- catpt_dram_size(cdev));
- catpt_sram_init(&cdev->iram, spec->host_iram_offset,
- catpt_iram_size(cdev));
}
static int catpt_acpi_probe(struct platform_device *pdev)
@@ -287,7 +284,7 @@ static int catpt_acpi_probe(struct platform_device *pdev)
if (ret)
return ret;
- cdev->dxbuf_vaddr = dmam_alloc_coherent(dev, catpt_dram_size(cdev),
+ cdev->dxbuf_vaddr = dmam_alloc_coherent(dev, resource_size(&cdev->dram),
&cdev->dxbuf_paddr, GFP_KERNEL);
if (!cdev->dxbuf_vaddr)
return -ENOMEM;
diff --git a/sound/soc/intel/catpt/loader.c b/sound/soc/intel/catpt/loader.c
index 75457187b614..c577f2e17ddf 100644
--- a/sound/soc/intel/catpt/loader.c
+++ b/sound/soc/intel/catpt/loader.c
@@ -7,6 +7,7 @@
#include <linux/dma-mapping.h>
#include <linux/firmware.h>
+#include <linux/ioport.h>
#include <linux/slab.h>
#include "core.h"
#include "registers.h"
@@ -50,12 +51,6 @@ struct catpt_fw_block_hdr {
u32 rsvd;
} __packed;
-void catpt_sram_init(struct resource *sram, u32 start, u32 size)
-{
- sram->start = start;
- sram->end = start + size - 1;
-}
-
void catpt_sram_free(struct resource *sram)
{
struct resource *res, *save;