devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexandre Mergnat <amergnat@baylibre.com>
To: Trevor Wu <trevor.wu@mediatek.com>,
	broonie@kernel.org, lgirdwood@gmail.com, tiwai@suse.com,
	perex@perex.cz, robh+dt@kernel.org,
	krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org,
	matthias.bgg@gmail.com, angelogioacchino.delregno@collabora.com
Cc: alsa-devel@alsa-project.org, linux-mediatek@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [RESEND 1/2] ASoC: mediatek: mt8188: add memory-region support
Date: Wed, 12 Jul 2023 14:40:11 +0200	[thread overview]
Message-ID: <fab21c8b-13d7-1046-6b13-51a3d6684a2f@baylibre.com> (raw)
In-Reply-To: <20230712070821.23971-2-trevor.wu@mediatek.com>



On 12/07/2023 09:08, Trevor Wu wrote:
> 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;

I think that make sense to replace all "&pdev->dev" by "dev" in the next 
called functions:
- dma_set_mask_and_coherent
- devm_kzalloc
- devm_kzalloc

>   	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))

-- 
Regards,
Alexandre

  reply	other threads:[~2023-07-12 12:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-12  7:08 [RESEND 0/2] ASoC: mt8188: add memory-region support Trevor Wu
2023-07-12  7:08 ` [RESEND 1/2] ASoC: mediatek: " Trevor Wu
2023-07-12 12:40   ` Alexandre Mergnat [this message]
2023-07-12  7:08 ` [RESEND 2/2] ASoC: dt-bindings: mediatek,mt8188-afe: add memory-region Trevor Wu
2023-07-12 12:50   ` Alexandre Mergnat

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=fab21c8b-13d7-1046-6b13-51a3d6684a2f@baylibre.com \
    --to=amergnat@baylibre.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=broonie@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=matthias.bgg@gmail.com \
    --cc=perex@perex.cz \
    --cc=robh+dt@kernel.org \
    --cc=tiwai@suse.com \
    --cc=trevor.wu@mediatek.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).