From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Chunxu Li <chunxu.li@mediatek.com>,
lgirdwood@gmail.com, broonie@kernel.org
Cc: matthias.bgg@gmail.com, trevor.wu@mediatek.com,
tzungbi@google.com, linux-kernel@vger.kernel.org,
alsa-devel@alsa-project.org,
linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org
Subject: Re: [PATCH] ASoC: mediatek: mt8195: extract SOF common code
Date: Fri, 15 Jul 2022 10:30:05 +0200 [thread overview]
Message-ID: <b2dc196f-19d2-4d9a-4feb-ec335249aaad@collabora.com> (raw)
In-Reply-To: <20220715034223.3897-1-chunxu.li@mediatek.com>
Il 15/07/22 05:42, Chunxu Li ha scritto:
> The functions related to SOF can be reused in different machine drivers,
> such as mt8195 or mt8186, so extract the common code to avoid duplication.
>
> Set mtk_soc_card_data which include machine private data and SOF private
> data as card drvdata, then the difference between machine private can be
> ignored such as mt8195_mt6359_priv or mt8186_mt6366_priv, at the same
> time the SOF related code can be reused in different machine drivers.
>
> Signed-off-by: Chunxu Li <chunxu.li@mediatek.com>
> ---
> sound/soc/mediatek/common/Makefile | 2 +-
> .../soc/mediatek/common/mtk-dsp-sof-common.c | 196 +++++++++++++++
> .../soc/mediatek/common/mtk-dsp-sof-common.h | 35 +++
> sound/soc/mediatek/common/mtk-soc-card.h | 17 ++
> sound/soc/mediatek/mt8195/mt8195-mt6359.c | 233 ++++--------------
> 5 files changed, 300 insertions(+), 183 deletions(-)
> create mode 100644 sound/soc/mediatek/common/mtk-dsp-sof-common.c
> create mode 100644 sound/soc/mediatek/common/mtk-dsp-sof-common.h
> create mode 100644 sound/soc/mediatek/common/mtk-soc-card.h
>
> diff --git a/sound/soc/mediatek/common/Makefile b/sound/soc/mediatek/common/Makefile
> index acbe01e9e928..576deb7f8cce 100644
> --- a/sound/soc/mediatek/common/Makefile
> +++ b/sound/soc/mediatek/common/Makefile
> @@ -1,6 +1,6 @@
> # SPDX-License-Identifier: GPL-2.0
> # platform driver
> -snd-soc-mtk-common-objs := mtk-afe-platform-driver.o mtk-afe-fe-dai.o
> +snd-soc-mtk-common-objs := mtk-afe-platform-driver.o mtk-afe-fe-dai.o mtk-dsp-sof-common.o
> obj-$(CONFIG_SND_SOC_MEDIATEK) += snd-soc-mtk-common.o
>
> obj-$(CONFIG_SND_SOC_MTK_BTCVSD) += mtk-btcvsd.o
> diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.c b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
> new file mode 100644
> index 000000000000..1098694f4f36
> --- /dev/null
> +++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.c
> @@ -0,0 +1,196 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/*
> + * mtk-dsp-sof-common.c -- MediaTek dsp sof common ctrl
> + *
> + * Copyright (c) 2022 MediaTek Inc.
> + * Author: Chunxu Li <chunxu.li@mediatek.com>
> + */
> +
> +#include <mtk-dsp-sof-common.h>
> +#include <mtk-soc-card.h>
Did you mean.....
#include "mtk-dsp-sof-common.h"
#include "mtk-soc-card.h"
> +
> +/* fixup the BE DAI link to match any values from topology */
> +int mtk_sof_dai_link_fixup(struct snd_soc_pcm_runtime *rtd,
> + struct snd_pcm_hw_params *params)
> +{
..snip..
> diff --git a/sound/soc/mediatek/common/mtk-dsp-sof-common.h b/sound/soc/mediatek/common/mtk-dsp-sof-common.h
> new file mode 100644
> index 000000000000..f02ba2ce3718
> --- /dev/null
> +++ b/sound/soc/mediatek/common/mtk-dsp-sof-common.h
> @@ -0,0 +1,35 @@
> +/* SPDX-License-Identifier: GPL-2.0 */
> +/*
> + * mtk-dsp-sof-common.h -- MediaTek dsp sof common definition
> + *
> + * Copyright (c) 2022 MediaTek Inc.
> + * Author: Chunxu Li <chunxu.li@mediatek.com>
> + */
> +
> +#ifndef _MTK_DSP_SOF_COMMON_H_
> +#define _MTK_DSP_SOF_COMMON_H_
> +
> +#include <sound/soc.h>
Leave a blank line here.
> +struct sof_conn_stream {
> + const char *normal_link;
> + const char *sof_link;
> + const char *sof_dma;
> + int stream_dir;
> +};
> +
Thanks,
Angelo
prev parent reply other threads:[~2022-07-15 8:30 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-15 3:42 Chunxu Li
2022-07-15 8:30 ` AngeloGioacchino Del Regno [this message]
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=b2dc196f-19d2-4d9a-4feb-ec335249aaad@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=chunxu.li@mediatek.com \
--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=trevor.wu@mediatek.com \
--cc=tzungbi@google.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
all inboxes | Powered by JetHome®