mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] ASoC: mt8188: add memory-region support
@ 2023-06-29  7:43 Trevor Wu
  2023-06-29  7:43 ` [PATCH 1/2] ASoC: mediatek: " Trevor Wu
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Trevor Wu @ 2023-06-29  7:43 UTC (permalink / raw)
  To: broonie, lgirdwood, tiwai, perex, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: trevor.wu, alsa-devel, linux-mediatek, linux-arm-kernel,
	linux-kernel, devicetree

This series introduces support for memory-region, allowing afe memif to
utilize the region specified in dts.

Trevor Wu (2):
  ASoC: mediatek: mt8188: add memory-region support
  ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region

 .../devicetree/bindings/sound/mediatek,mt8188-afe.yaml    | 7 +++++++
 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c                | 8 ++++++--
 2 files changed, 13 insertions(+), 2 deletions(-)

-- 
2.18.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 1/2] ASoC: mediatek: mt8188: add memory-region support
  2023-06-29  7:43 [PATCH 0/2] ASoC: mt8188: add memory-region support Trevor Wu
@ 2023-06-29  7:43 ` Trevor Wu
  2023-06-29  7:43 ` [PATCH 2/2] ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region Trevor Wu
  2023-07-12 11:47 ` [PATCH 0/2] ASoC: mt8188: add memory-region support Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Trevor Wu @ 2023-06-29  7:43 UTC (permalink / raw)
  To: broonie, lgirdwood, tiwai, perex, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: trevor.wu, alsa-devel, linux-mediatek, linux-arm-kernel,
	linux-kernel, devicetree

In certain projects, it is necessary to utilize the reserved memory
region for audio dma. The patch takes into account the dts property
'memory-region', allowing for the specification of memory for afe memif
through device tree.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
---
 sound/soc/mediatek/mt8188/mt8188-afe-pcm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
index 6a24b339444b..5e14655c5617 100644
--- a/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
+++ b/sound/soc/mediatek/mt8188/mt8188-afe-pcm.c
@@ -16,6 +16,7 @@
 #include <linux/of.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
+#include <linux/of_reserved_mem.h>
 #include <linux/pm_runtime.h>
 #include <linux/soc/mediatek/infracfg.h>
 #include <linux/reset.h>
@@ -3193,11 +3194,15 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev)
 {
 	struct mtk_base_afe *afe;
 	struct mt8188_afe_private *afe_priv;
-	struct device *dev;
+	struct device *dev = &pdev->dev;
 	struct reset_control *rstc;
 	struct regmap *infra_ao;
 	int i, irq_id, ret;
 
+	ret = of_reserved_mem_device_init(dev);
+	if (ret)
+		dev_dbg(dev, "failed to assign memory region: %d\n", ret);
+
 	ret = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(33));
 	if (ret)
 		return ret;
@@ -3213,7 +3218,6 @@ static int mt8188_afe_pcm_dev_probe(struct platform_device *pdev)
 
 	afe_priv = afe->platform_priv;
 	afe->dev = &pdev->dev;
-	dev = afe->dev;
 
 	afe->base_addr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(afe->base_addr))
-- 
2.18.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH 2/2] ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region
  2023-06-29  7:43 [PATCH 0/2] ASoC: mt8188: add memory-region support Trevor Wu
  2023-06-29  7:43 ` [PATCH 1/2] ASoC: mediatek: " Trevor Wu
@ 2023-06-29  7:43 ` Trevor Wu
  2023-06-29 16:44   ` Rob Herring
  2023-07-12 11:47 ` [PATCH 0/2] ASoC: mt8188: add memory-region support Mark Brown
  2 siblings, 1 reply; 5+ messages in thread
From: Trevor Wu @ 2023-06-29  7:43 UTC (permalink / raw)
  To: broonie, lgirdwood, tiwai, perex, robh+dt,
	krzysztof.kozlowski+dt, conor+dt, matthias.bgg,
	angelogioacchino.delregno
  Cc: trevor.wu, alsa-devel, linux-mediatek, linux-arm-kernel,
	linux-kernel, devicetree

Add memory-region property to utilize the reserved memory region.

Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
---
 .../devicetree/bindings/sound/mediatek,mt8188-afe.yaml     | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/Documentation/devicetree/bindings/sound/mediatek,mt8188-afe.yaml b/Documentation/devicetree/bindings/sound/mediatek,mt8188-afe.yaml
index e6cb711ece77..0b92c71d8779 100644
--- a/Documentation/devicetree/bindings/sound/mediatek,mt8188-afe.yaml
+++ b/Documentation/devicetree/bindings/sound/mediatek,mt8188-afe.yaml
@@ -25,6 +25,12 @@ properties:
   reset-names:
     const: audiosys
 
+  memory-region:
+    maxItems: 1
+    description: |
+      Shared memory region for AFE memif.  A "shared-dma-pool".
+      See ../reserved-memory/reserved-memory.yaml for details.
+
   mediatek,topckgen:
     $ref: /schemas/types.yaml#/definitions/phandle
     description: The phandle of the mediatek topckgen controller
@@ -176,6 +182,7 @@ examples:
         interrupts = <GIC_SPI 822 IRQ_TYPE_LEVEL_HIGH 0>;
         resets = <&watchdog 14>;
         reset-names = "audiosys";
+        memory-region = <&snd_dma_mem_reserved>;
         mediatek,topckgen = <&topckgen>;
         mediatek,infracfg = <&infracfg_ao>;
         power-domains = <&spm 13>; //MT8188_POWER_DOMAIN_AUDIO
-- 
2.18.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2/2] ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region
  2023-06-29  7:43 ` [PATCH 2/2] ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region Trevor Wu
@ 2023-06-29 16:44   ` Rob Herring
  0 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2023-06-29 16:44 UTC (permalink / raw)
  To: Trevor Wu
  Cc: devicetree, lgirdwood, robh+dt, conor+dt, krzysztof.kozlowski+dt,
	angelogioacchino.delregno, linux-arm-kernel, perex,
	linux-mediatek, tiwai, linux-kernel, matthias.bgg, alsa-devel,
	broonie


On Thu, 29 Jun 2023 15:43:48 +0800, Trevor Wu wrote:
> Add memory-region property to utilize the reserved memory region.
> 
> Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
> ---
>  .../devicetree/bindings/sound/mediatek,mt8188-afe.yaml     | 7 +++++++
>  1 file changed, 7 insertions(+)
> 

Acked-by: Rob Herring <robh@kernel.org>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 0/2] ASoC: mt8188: add memory-region support
  2023-06-29  7:43 [PATCH 0/2] ASoC: mt8188: add memory-region support Trevor Wu
  2023-06-29  7:43 ` [PATCH 1/2] ASoC: mediatek: " Trevor Wu
  2023-06-29  7:43 ` [PATCH 2/2] ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region Trevor Wu
@ 2023-07-12 11:47 ` Mark Brown
  2 siblings, 0 replies; 5+ messages in thread
From: Mark Brown @ 2023-07-12 11:47 UTC (permalink / raw)
  To: lgirdwood, tiwai, perex, robh+dt, krzysztof.kozlowski+dt,
	conor+dt, matthias.bgg, angelogioacchino.delregno, Trevor Wu
  Cc: alsa-devel, linux-mediatek, linux-arm-kernel, linux-kernel, devicetree

On Thu, 29 Jun 2023 15:43:46 +0800, Trevor Wu wrote:
> This series introduces support for memory-region, allowing afe memif to
> utilize the region specified in dts.
> 
> Trevor Wu (2):
>   ASoC: mediatek: mt8188: add memory-region support
>   ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region
> 
> [...]

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next

Thanks!

[1/2] ASoC: mediatek: mt8188: add memory-region support
      commit: fd9965235099fc4cccd94f82a371192bf7645a3e
[2/2] ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region
      commit: e3326e3bc4937622b4dc6e9721262483109b0f0c

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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-07-12 11:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-29  7:43 [PATCH 0/2] ASoC: mt8188: add memory-region support Trevor Wu
2023-06-29  7:43 ` [PATCH 1/2] ASoC: mediatek: " Trevor Wu
2023-06-29  7:43 ` [PATCH 2/2] ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region Trevor Wu
2023-06-29 16:44   ` Rob Herring
2023-07-12 11:47 ` [PATCH 0/2] ASoC: mt8188: add memory-region support Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®