Commit 6e2127dc authored by Mark Brown's avatar Mark Brown

ASoC: mediatek: support memory-region assignment

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

This series of patches adds support for memory-region assignment, so the
access region of DMA engine could be restricted.
Patches are based on broonie tree "for-next" branch.

Trevor Wu (2):
  ASoC: mediatek: mt8195: support reserved memory assignment
  dt-bindings: mediatek: mt8195: add memory-region property

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

--
2.18.0
parents c736d64d 2da63624
......@@ -19,6 +19,12 @@ properties:
interrupts:
maxItems: 1
memory-region:
maxItems: 1
description: |
Shared memory region for AFE memif. A "shared-dma-pool".
See ../reserved-memory/reserved-memory.txt for details.
mediatek,topckgen:
$ref: "/schemas/types.yaml#/definitions/phandle"
description: The phandle of the mediatek topckgen controller
......@@ -125,6 +131,7 @@ required:
- power-domains
- clocks
- clock-names
- memory-region
additionalProperties: false
......@@ -139,6 +146,7 @@ examples:
interrupts = <GIC_SPI 822 IRQ_TYPE_LEVEL_HIGH 0>;
mediatek,topckgen = <&topckgen>;
power-domains = <&spm 7>; //MT8195_POWER_DOMAIN_AUDIO
memory-region = <&snd_dma_mem_reserved>;
clocks = <&clk26m>,
<&topckgen 163>, //CLK_TOP_APLL1
<&topckgen 166>, //CLK_TOP_APLL2
......
......@@ -14,6 +14,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 "mt8195-afe-common.h"
#include "mt8195-afe-clk.h"
......@@ -3061,6 +3062,12 @@ static int mt8195_afe_pcm_dev_probe(struct platform_device *pdev)
int i, irq_id, ret;
struct snd_soc_component *component;
ret = of_reserved_mem_device_init(dev);
if (ret) {
dev_err(dev, "failed to assign memory region: %d\n", ret);
return ret;
}
ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(33));
if (ret)
return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment