mailman.alsa-project.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Sound-open-firmware

Thread Start a new thread
Download
Threads by month
  • ----- 2025 -----
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2018 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2017 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2016 -----
  • December
  • November
  • October
sound-open-firmware@alsa-project.org

July 2025

  • 8 participants
  • 13 discussions
Re: [PATCH v1] ASoC: SOF: amd: acp-loader: Use GFP_KERNEL for DMA allocations in resume context
by Mark Brown 29 Jul '25

29 Jul '25
On Sat, 26 Jul 2025 00:02:54 +0500, Muhammad Usama Anjum wrote: > Replace GFP_ATOMIC with GFP_KERNEL for dma_alloc_coherent() calls. This > change improves memory allocation reliability during firmware loading, > particularly during system resume when memory pressure is high. Because > of using GFP_KERNEL, reclaim can happen which can reduce the probability > of failure. > > Fixes memory allocation failures observed during system resume with > fragmented memory conditions. > > [...] Applied to https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next Thanks! [1/1] ASoC: SOF: amd: acp-loader: Use GFP_KERNEL for DMA allocations in resume context commit: eb3bb145280b6c857a748731a229698e4a7cf37b All being well this means that it will be integrated into the linux-next tree (usually sometime in the next 24 hours) and sent to Linus during the next merge window (or sooner if it is a bug fix), however if problems are discovered then the patch may be dropped or reverted. You may get further e-mails resulting from automated or manual testing and review of the tree, please engage with people reporting problems and send followup patches addressing any issues that are reported if needed. If any updates are required or you are submitting further changes they should be sent as incremental updates against current git, existing patches will not be replaced. Please add any relevant lists and maintainers to the CCs when replying to this mail. Thanks, Mark
1 0
0 0
Re: [PATCH v3 1/3] ALSA: compress_offload: Add 64-bit safe timestamp infrastructure
by kernel test robot 26 Jul '25

26 Jul '25
Hi Joris, kernel test robot noticed the following build errors: [auto build test ERROR on tiwai-sound/for-next] [also build test ERROR on tiwai-sound/for-linus linus/master v6.16-rc7 next-20250725] [cannot apply to broonie-sound/for-next] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Joris-Verhaegen/ALSA-compres… base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next patch link: https://lore.kernel.org/r/20250725114249.2086974-2-verhaegen%40google.com patch subject: [PATCH v3 1/3] ALSA: compress_offload: Add 64-bit safe timestamp infrastructure config: loongarch-randconfig-001-20250726 (https://download.01.org/0day-ci/archive/20250726/202507261801.Ma45NLlT-lkp@…) compiler: loongarch64-linux-gcc (GCC) 15.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250726/202507261801.Ma45NLlT-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202507261801.Ma45NLlT-lkp@intel.com/ All errors (new ones prefixed by >>): >> sound/soc/sof/sof-client-probes.c:156:20: error: initialization of 'int (*)(struct snd_compr_stream *, struct snd_compr_tstamp64 *, struct snd_soc_dai *)' from incompatible pointer type 'int (*)(struct snd_compr_stream *, struct snd_compr_tstamp *, struct snd_soc_dai *)' [-Wincompatible-pointer-types] 156 | .pointer = sof_probes_compr_pointer, | ^~~~~~~~~~~~~~~~~~~~~~~~ sound/soc/sof/sof-client-probes.c:156:20: note: (near initialization for 'sof_probes_compr_ops.pointer') sound/soc/sof/sof-client-probes.c:139:12: note: 'sof_probes_compr_pointer' declared here 139 | static int sof_probes_compr_pointer(struct snd_compr_stream *cstream, | ^~~~~~~~~~~~~~~~~~~~~~~~ -- >> sound/soc/intel/avs/probes.c:260:20: error: initialization of 'int (*)(struct snd_compr_stream *, struct snd_compr_tstamp64 *, struct snd_soc_dai *)' from incompatible pointer type 'int (*)(struct snd_compr_stream *, struct snd_compr_tstamp *, struct snd_soc_dai *)' [-Wincompatible-pointer-types] 260 | .pointer = avs_probe_compr_pointer, | ^~~~~~~~~~~~~~~~~~~~~~~ sound/soc/intel/avs/probes.c:260:20: note: (near initialization for 'avs_probe_cdai_ops.pointer') sound/soc/intel/avs/probes.c:215:12: note: 'avs_probe_compr_pointer' declared here 215 | static int avs_probe_compr_pointer(struct snd_compr_stream *cstream, | ^~~~~~~~~~~~~~~~~~~~~~~ vim +156 sound/soc/sof/sof-client-probes.c 3dc0d709177828 Peter Ujfalusi 2022-02-10 150 3dc0d709177828 Peter Ujfalusi 2022-02-10 151 static const struct snd_soc_cdai_ops sof_probes_compr_ops = { 3dc0d709177828 Peter Ujfalusi 2022-02-10 152 .startup = sof_probes_compr_startup, 3dc0d709177828 Peter Ujfalusi 2022-02-10 153 .shutdown = sof_probes_compr_shutdown, 3dc0d709177828 Peter Ujfalusi 2022-02-10 154 .set_params = sof_probes_compr_set_params, 3dc0d709177828 Peter Ujfalusi 2022-02-10 155 .trigger = sof_probes_compr_trigger, 3dc0d709177828 Peter Ujfalusi 2022-02-10 @156 .pointer = sof_probes_compr_pointer, 3dc0d709177828 Peter Ujfalusi 2022-02-10 157 }; 3dc0d709177828 Peter Ujfalusi 2022-02-10 158 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
Re: [PATCH v3 0/3] ALSA: compress_offload: Add 64-bit safe timestamp API
by Takashi Iwai 25 Jul '25

25 Jul '25
On Fri, 25 Jul 2025 13:42:42 +0200, Joris Verhaegen wrote: > > The current compress offload timestamping API relies on struct > snd_compr_tstamp, whose cumulative counters like copied_total are > defined as __u32. On long-running high-resolution audio streams, these > 32-bit counters can overflow, causing incorrect availability > calculations. > > This patch series transitions to a 64-bit safe API to solve the problem > while maintaining perfect backward compatibility with the existing UAPI. > The pointer operation is reworked to use a new timestamp struct with > 64-bit fields for the cumulative counters, named snd_compr_tstamp64. > ASoC drivers are updated to use the 64-bit structures. Corresponding > ioctls are added to expose them to user-space. > > The series is structured as follows: > > Patch 1: Updates the pointer op, refactors the core logic and ASoC > drivers to use it, and defines the new UAPI structs. > > Patch 2: Exposes the SNDRV_COMPRESS_TSTAMP64 ioctl. > > Patch 3: Exposes the corresponding SNDRV_COMPRESS_AVAIL64 ioctl. > > This series has been tested on a Pixel 9 device. All compress offload > use cases, including long-running playback, were verified to work > correctly with the new 64-bit API. > > Thanks, > Joris (George) Verhaegen > > Signed-off-by: Joris Verhaegen <verhaegen(a)google.com> Through a quick glance, the patches look OK, but since it's too late for 6.17 merge window for such a non-trivial core API change, so I'll postpone the merge for 6.18. thanks, Takashi
1 0
0 0
Re: [PATCH v2 4/4] ASoC: codecs: Implement 64-bit pointer operation
by kernel test robot 15 Jul '25

15 Jul '25
Hi Joris, kernel test robot noticed the following build errors: [auto build test ERROR on broonie-sound/for-next] [also build test ERROR on vkoul-dmaengine/next linus/master v6.16-rc6] [cannot apply to tiwai-sound/for-next tiwai-sound/for-linus next-20250714] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch#_base_tree_information] url: https://github.com/intel-lab-lkp/linux/commits/Joris-Verhaegen/ALSA-compres… base: https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next patch link: https://lore.kernel.org/r/20250711093636.28204-5-verhaegen%40google.com patch subject: [PATCH v2 4/4] ASoC: codecs: Implement 64-bit pointer operation config: i386-randconfig-141-20250714 (https://download.01.org/0day-ci/archive/20250715/202507152054.EKID8Uop-lkp@…) compiler: gcc-12 (Debian 12.2.0-14+deb12u1) 12.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250715/202507152054.EKID8Uop-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202507152054.EKID8Uop-lkp@intel.com/ All errors (new ones prefixed by >>): ld: sound/soc/intel/atom/sst-mfld-platform-compress.o: in function `sst_platform_compr_pointer64': >> sound/soc/intel/atom/sst-mfld-platform-compress.c:226: undefined reference to `__umoddi3' vim +226 sound/soc/intel/atom/sst-mfld-platform-compress.c 216 217 static int sst_platform_compr_pointer64(struct snd_soc_component *component, 218 struct snd_compr_stream *cstream, 219 struct snd_compr_tstamp64 *tstamp) 220 { 221 struct sst_runtime_stream *stream; 222 223 stream = cstream->runtime->private_data; 224 stream->compr_ops->tstamp64(sst->dev, stream->id, tstamp); 225 tstamp->byte_offset = > 226 tstamp->copied_total % cstream->runtime->buffer_size; 227 pr_debug("calc bytes offset/copied bytes as %u\n", tstamp->byte_offset); 228 return 0; 229 } 230 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
Re: [PATCH v2 0/4] ALSA: compress_offload: Add 64-bit safe timestamp API
by Takashi Iwai 15 Jul '25

15 Jul '25
On Fri, 11 Jul 2025 13:56:47 +0200, Charles Keepax wrote: > > On Fri, Jul 11, 2025 at 10:36:26AM +0100, Joris Verhaegen wrote: > > The current compress offload timestamping API relies on > > struct snd_compr_tstamp, whose cumulative counters like > > copied_total are defined as __u32. On long-running high-resolution > > audio streams, these 32-bit counters can overflow, > > causing incorrect availability calculations. > > > > This patch series introduces a parallel, 64-bit safe API to solve > > this problem while maintaining perfect backward compatibility with the > > existing UAPI. A new pointer64 operation and corresponding ioctls > > are added to allow the kernel to track counters using u64 and expose > > these full-width values to user-space. > > > > The series is structured as follows: > > > > Patch 1: Introduces the new internal pointer64 op, refactors the > > core logic to use it, and defines the new UAPI structs. > > > > Patch 2: Exposes the SNDRV_COMPRESS_TSTAMP64 ioctl. > > > > Patch 3: Exposes the corresponding SNDRV_COMPRESS_AVAIL64 ioctl. > > > > Patch 4: Implements the new .pointer64 operation in various ASoC > > drivers that support compress offload. > > > > This series has been tested on a Pixel 9 device. All compress offload > > use cases, including long-running playback, were verified to work > > correctly with the new 64-bit API, and no regressions were observed > > when using the legacy API. > > > > Thanks, > > Joris (George) Verhaegen > > > > Signed-off-by: Joris Verhaegen <verhaegen(a)google.com> > > > > --- > > Would it not be slightly simpler to just update all the in kernel > bits to use 64-bit and then only convert to 32-bit for the > existing 32-bit IOCTLs? Why do we need 32-bit callbacks into the > drivers for example? Right, it's a usual pattern to have only the 64bit ops in the kernel driver side while providing the 32bit stuff converted in the core layer. Having two different ops are rather confusing and superfluous after conversions. If there are tons of users for this API, it'd be needed to convert gradually, and eventually drop the 32bit ops at the end. But in this case, there doesn't seem so many relevant drivers, hence the conversion can be done in a shot as done in your patch 4. thanks, Takashi
2 2
0 0
Re: [PATCH v1 0/4] ALSA: compress_offload: Add 64-bit safe timestamp API
by Vinod Koul 15 Jul '25

15 Jul '25
On 11-07-25, 14:58, George Verhaegen wrote: > On Fri, 11 Jul 2025 at 13:34, Vinod Koul <vkoul(a)kernel.org> wrote: > > Please share patches for tinycompress support too, we need those to test > > this > > I didn't make changes to tinycompress. The overflow happens in the > kernel file compress_offload.c. As a test, I let it run for more than > 3.1 hours and observed that the overflow no longer occurs. > The overflow is in > stream->runtime->total_bytes_transferred = tstamp->copied_total You need to add support for new ioctl in tinycompress too -- ~Vinod
1 0
0 0
Re: [PATCH v2 2/4] ALSA: compress_offload: Add SNDRV_COMPRESS_TSTAMP64 ioctl
by Takashi Iwai 11 Jul '25

11 Jul '25
On Fri, 11 Jul 2025 11:36:28 +0200, Joris Verhaegen wrote: > @@ -1355,7 +1389,9 @@ static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg) > > switch (_IOC_NR(cmd)) { > case _IOC_NR(SNDRV_COMPRESS_TSTAMP): > - return snd_compr_tstamp(stream, arg); > + return snd_compr_tstamp32(stream, arg); > + case _IOC_NR(SNDRV_COMPRESS_TSTAMP64): > + return snd_compr_tstamp64(stream, arg); > case _IOC_NR(SNDRV_COMPRESS_AVAIL): > return snd_compr_ioctl_avail(stream, arg); > case _IOC_NR(SNDRV_COMPRESS_PAUSE): This function was recently updated to evaluate the ioctl cmd value as is, as found in commit 19c4096ccdd809c6213e2e62b0d4f57c880138cd ALSA: compress_offload: tighten ioctl command number checks in sound git tree (likely included in 6.16-rc7). Please adjust your patch accordingly. thanks, Takashi
1 0
0 0
Re: [PATCH v1 0/4] ALSA: compress_offload: Add 64-bit safe timestamp API
by Vinod Koul 11 Jul '25

11 Jul '25
On 11-07-25, 09:24, George Verhaegen wrote: > From: Joris Verhaegen <verhaegen(a)google.com> > > The current compress offload timestamping API relies on > struct snd_compr_tstamp, whose cumulative counters like > copied_total are defined as __u32. On long-running high-resolution > audio streams, these 32-bit counters can overflow, > causing incorrect availability calculations. In your testing when did you observe the overflow condition? > This patch series introduces a parallel, 64-bit safe API to solve > this problem while maintaining perfect backward compatibility with the > existing UAPI. A new pointer64 operation and corresponding ioctls > are added to allow the kernel to track counters using u64 and expose > these full-width values to user-space. Please share patches for tinycompress support too, we need those to test this > The series is structured as follows: > > Patch 1: Introduces the new internal pointer64 op, refactors the > core logic to use it, and defines the new UAPI structs. > > Patch 2: Exposes the SNDRV_COMPRESS_TSTAMP64 ioctl. > > Patch 3: Exposes the corresponding SNDRV_COMPRESS_AVAIL64 ioctl. > > Patch 4: Implements the new .pointer64 operation in various ASoC > drivers that support compress offload. > > This series has been tested on a Pixel 9 device. All compress offload > use cases, including long-running playback, were verified to work > correctly with the new 64-bit API, and no regressions were observed > when using the legacy API. > > Thanks, > George (Joris) Verhaegen > > Signed-off-by: Joris Verhaegen <verhaegen(a)google.com> > > --- > > Joris Verhaegen (4): > ALSA: compress_offload: Add 64-bit safe timestamp infrastructure > ALSA: compress_offload: Add SNDRV_COMPRESS_TSTAMP64 ioctl > ALSA: compress_offload: Add SNDRV_COMPRESS_AVAIL64 ioctl > ASoC: codecs: Implement 64-bit pointer operation > > include/sound/compress_driver.h | 3 + > include/sound/soc-component.h | 5 + > include/sound/soc-dai.h | 6 + > include/uapi/sound/compress_offload.h | 32 +++ > sound/core/compress_offload.c | 210 ++++++++++++++---- > sound/soc/codecs/cs47l15.c | 1 + > sound/soc/codecs/cs47l24.c | 1 + > sound/soc/codecs/cs47l35.c | 1 + > sound/soc/codecs/cs47l85.c | 1 + > sound/soc/codecs/cs47l90.c | 1 + > sound/soc/codecs/cs47l92.c | 1 + > sound/soc/codecs/wm5102.c | 1 + > sound/soc/codecs/wm5110.c | 1 + > sound/soc/codecs/wm_adsp.c | 53 ++++- > sound/soc/codecs/wm_adsp.h | 3 + > .../intel/atom/sst-mfld-platform-compress.c | 17 +- > sound/soc/intel/atom/sst-mfld-platform.h | 2 + > sound/soc/intel/atom/sst/sst_drv_interface.c | 43 +++- > sound/soc/qcom/qdsp6/q6asm-dai.c | 41 +++- > sound/soc/soc-component.c | 20 ++ > sound/soc/soc-compress.c | 21 ++ > sound/soc/soc-dai.c | 14 ++ > sound/soc/sof/compress.c | 44 +++- > sound/soc/sprd/sprd-pcm-compress.c | 28 ++- > sound/soc/sprd/sprd-pcm-dma.h | 2 +- > sound/soc/uniphier/aio-compress.c | 40 +++- > 26 files changed, 503 insertions(+), 89 deletions(-) > > -- > 2.50.0.727.gbf7dc18ff4-goog -- ~Vinod
1 0
0 0
Re: [PATCH v2 4/4] ASoC: codecs: Implement 64-bit pointer operation
by Richard Fitzgerald 11 Jul '25

11 Jul '25
On 11/7/25 10:36, Joris Verhaegen wrote: > Implement the new .pointer64 compress operation for the various ASoC > drivers that support compress offload. > > For drivers with complex but similar 32-bit and 64-bit logic > (wm_adsp, sof, uniphier), a shared internal function is used to handle > both requests, minimizing code duplication and improving maintainability. > > For other drivers, internal counters and related variables are updated > to u64 to ensure the source of the timestamp data is overflow-safe. > The legacy .pointer operation is retained in all drivers to ensure > full backward compatibility. > > Signed-off-by: Joris Verhaegen <verhaegen(a)google.com> > Tested-by: Joris Verhaegen <verhaegen(a)google.com> > Reviewed-by: David Li <dvdli(a)google.com> > Reviewed-by: Miller Liang <millerliang(a)google.com> > --- > sound/soc/codecs/cs47l15.c | 1 + > sound/soc/codecs/cs47l24.c | 1 + > sound/soc/codecs/cs47l35.c | 1 + > sound/soc/codecs/cs47l85.c | 1 + > sound/soc/codecs/cs47l90.c | 1 + > sound/soc/codecs/cs47l92.c | 1 + > sound/soc/codecs/wm5102.c | 1 + > sound/soc/codecs/wm5110.c | 1 + > sound/soc/codecs/wm_adsp.c | 53 +++++++++++++++---- > sound/soc/codecs/wm_adsp.h | 3 ++ For these 10 files: Reviewed-by: Richard Fitzgerald <rf(a)opensource.cirrus.com>
1 0
0 0
[PATCH] ASoC: Use of_reserved_mem_region_to_resource() for "memory-region"
by Rob Herring (Arm) 07 Jul '25

07 Jul '25
Use the newly added of_reserved_mem_region_to_resource() function to handle "memory-region" properties. Signed-off-by: Rob Herring (Arm) <robh(a)kernel.org> --- sound/soc/codecs/cros_ec_codec.c | 30 ++++++++++----------- sound/soc/sof/imx/imx-common.c | 36 +++++--------------------- sound/soc/sof/mediatek/mt8186/mt8186.c | 11 +------- sound/soc/sof/mediatek/mt8195/mt8195.c | 11 +------- 4 files changed, 22 insertions(+), 66 deletions(-) diff --git a/sound/soc/codecs/cros_ec_codec.c b/sound/soc/codecs/cros_ec_codec.c index 571222ec520c..937c8cec682a 100644 --- a/sound/soc/codecs/cros_ec_codec.c +++ b/sound/soc/codecs/cros_ec_codec.c @@ -18,6 +18,7 @@ #include <linux/module.h> #include <linux/of.h> #include <linux/of_address.h> +#include <linux/of_reserved_mem.h> #include <linux/platform_data/cros_ec_commands.h> #include <linux/platform_data/cros_ec_proto.h> #include <linux/platform_device.h> @@ -961,7 +962,6 @@ static int cros_ec_codec_platform_probe(struct platform_device *pdev) struct ec_response_ec_codec_get_capabilities r; int ret; #ifdef CONFIG_OF - struct device_node *node; struct resource res; u64 ec_shm_size; const __be32 *regaddr_p; @@ -981,22 +981,18 @@ static int cros_ec_codec_platform_probe(struct platform_device *pdev) priv->ec_shm_addr, priv->ec_shm_len); } - node = of_parse_phandle(dev->of_node, "memory-region", 0); - if (node) { - ret = of_address_to_resource(node, 0, &res); - if (!ret) { - priv->ap_shm_phys_addr = res.start; - priv->ap_shm_len = resource_size(&res); - priv->ap_shm_addr = - (uint64_t)(uintptr_t)devm_ioremap_wc( - dev, priv->ap_shm_phys_addr, - priv->ap_shm_len); - priv->ap_shm_last_alloc = priv->ap_shm_phys_addr; - - dev_dbg(dev, "ap_shm_phys_addr=%#llx len=%#x\n", - priv->ap_shm_phys_addr, priv->ap_shm_len); - } - of_node_put(node); + ret = of_reserved_mem_region_to_resource(dev->of_node, 0, &res); + if (!ret) { + priv->ap_shm_phys_addr = res.start; + priv->ap_shm_len = resource_size(&res); + priv->ap_shm_addr = + (uint64_t)(uintptr_t)devm_ioremap_wc( + dev, priv->ap_shm_phys_addr, + priv->ap_shm_len); + priv->ap_shm_last_alloc = priv->ap_shm_phys_addr; + + dev_dbg(dev, "ap_shm_phys_addr=%#llx len=%#x\n", + priv->ap_shm_phys_addr, priv->ap_shm_len); } #endif diff --git a/sound/soc/sof/imx/imx-common.c b/sound/soc/sof/imx/imx-common.c index 62bf707aa909..f00b381cec3b 100644 --- a/sound/soc/sof/imx/imx-common.c +++ b/sound/soc/sof/imx/imx-common.c @@ -282,11 +282,8 @@ static int imx_region_name_to_blk_type(const char *region_name) static int imx_parse_ioremap_memory(struct snd_sof_dev *sdev) { const struct imx_chip_info *chip_info; - struct reserved_mem *reserved; struct platform_device *pdev; - struct device_node *res_np; - phys_addr_t base, size; - struct resource *res; + struct resource *res, _res; int i, blk_type, ret; pdev = to_platform_device(sdev->dev); @@ -307,37 +304,18 @@ static int imx_parse_ioremap_memory(struct snd_sof_dev *sdev) "failed to fetch %s resource\n", chip_info->memory[i].name); - base = res->start; - size = resource_size(res); } else { - ret = of_property_match_string(pdev->dev.of_node, - "memory-region-names", - chip_info->memory[i].name); + ret = of_reserved_mem_region_to_resource_byname(pdev->dev.of_node, + chip_info->memory[i].name, + &_res); if (ret < 0) return dev_err_probe(sdev->dev, ret, - "no valid index for %s\n", + "no valid entry for %s\n", chip_info->memory[i].name); - - res_np = of_parse_phandle(pdev->dev.of_node, - "memory-region", - ret); - if (!res_np) - return dev_err_probe(sdev->dev, -ENODEV, - "failed to parse phandle %s\n", - chip_info->memory[i].name); - - reserved = of_reserved_mem_lookup(res_np); - of_node_put(res_np); - if (!reserved) - return dev_err_probe(sdev->dev, -ENODEV, - "failed to get %s reserved\n", - chip_info->memory[i].name); - - base = reserved->base; - size = reserved->size; + res = &_res; } - sdev->bar[blk_type] = devm_ioremap(sdev->dev, base, size); + sdev->bar[blk_type] = devm_ioremap_resource(sdev->dev, res); if (!sdev->bar[blk_type]) return dev_err_probe(sdev->dev, -ENOMEM, diff --git a/sound/soc/sof/mediatek/mt8186/mt8186.c b/sound/soc/sof/mediatek/mt8186/mt8186.c index 7ff080452cbe..c1bea967737d 100644 --- a/sound/soc/sof/mediatek/mt8186/mt8186.c +++ b/sound/soc/sof/mediatek/mt8186/mt8186.c @@ -12,7 +12,6 @@ #include <linux/delay.h> #include <linux/firmware.h> #include <linux/io.h> -#include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/of_reserved_mem.h> @@ -46,7 +45,6 @@ static int platform_parse_resource(struct platform_device *pdev, void *data) { struct resource *mmio; struct resource res; - struct device_node *mem_region; struct device *dev = &pdev->dev; struct mtk_adsp_chip_info *adsp = data; int ret; @@ -57,14 +55,7 @@ static int platform_parse_resource(struct platform_device *pdev, void *data) return ret; } - mem_region = of_parse_phandle(dev->of_node, "memory-region", 1); - if (!mem_region) { - dev_err(dev, "no memory-region sysmem phandle\n"); - return -ENODEV; - } - - ret = of_address_to_resource(mem_region, 0, &res); - of_node_put(mem_region); + ret = of_reserved_mem_region_to_resource(dev->of_node, 1, &res); if (ret) { dev_err(dev, "of_address_to_resource sysmem failed\n"); return ret; diff --git a/sound/soc/sof/mediatek/mt8195/mt8195.c b/sound/soc/sof/mediatek/mt8195/mt8195.c index 3b3582d74510..4d6e9300a9c0 100644 --- a/sound/soc/sof/mediatek/mt8195/mt8195.c +++ b/sound/soc/sof/mediatek/mt8195/mt8195.c @@ -12,7 +12,6 @@ #include <linux/delay.h> #include <linux/firmware.h> #include <linux/io.h> -#include <linux/of_address.h> #include <linux/of_irq.h> #include <linux/of_platform.h> #include <linux/of_reserved_mem.h> @@ -46,7 +45,6 @@ static int platform_parse_resource(struct platform_device *pdev, void *data) { struct resource *mmio; struct resource res; - struct device_node *mem_region; struct device *dev = &pdev->dev; struct mtk_adsp_chip_info *adsp = data; int ret; @@ -57,14 +55,7 @@ static int platform_parse_resource(struct platform_device *pdev, void *data) return ret; } - mem_region = of_parse_phandle(dev->of_node, "memory-region", 1); - if (!mem_region) { - dev_err(dev, "no memory-region sysmem phandle\n"); - return -ENODEV; - } - - ret = of_address_to_resource(mem_region, 0, &res); - of_node_put(mem_region); + ret = of_reserved_mem_region_to_resource(dev->of_node, 1, &res); if (ret) { dev_err(dev, "of_address_to_resource sysmem failed\n"); return ret; -- 2.47.2
3 2
0 0
  • ← Newer
  • 1
  • 2
  • Older →

HyperKitty Powered by HyperKitty version 1.3.8.