From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Jiaxin Yu <jiaxin.yu@mediatek.com>,
broonie@kernel.org, robh+dt@kernel.org
Cc: aaronyu@google.com, matthias.bgg@gmail.com,
trevor.wu@mediatek.com, tzungbi@google.com,
julianbraha@gmail.com, alsa-devel@alsa-project.org,
devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org,
Project_Global_Chrome_Upstream_Group@mediatek.com
Subject: Re: [PATCH v9 2/8] ASoC: mediatek: mt8186: add platform driver
Date: Thu, 14 Jul 2022 16:08:25 +0200 [thread overview]
Message-ID: <ba986bba-a90e-54f4-6984-b44674d0d377@collabora.com> (raw)
In-Reply-To: <20220712150442.32504-3-jiaxin.yu@mediatek.com>
Il 12/07/22 17:04, Jiaxin Yu ha scritto:
> Add mt8186 platform and affiliated driver.
>
> Signed-off-by: Jiaxin Yu <jiaxin.yu@mediatek.com>
> ---
> sound/soc/mediatek/Kconfig | 12 +
> sound/soc/mediatek/Makefile | 1 +
> sound/soc/mediatek/mt8186/Makefile | 19 +
> sound/soc/mediatek/mt8186/mt8186-afe-clk.c | 3 +-
> sound/soc/mediatek/mt8186/mt8186-afe-clk.h | 2 +-
> sound/soc/mediatek/mt8186/mt8186-afe-common.h | 235 ++
> .../soc/mediatek/mt8186/mt8186-afe-control.c | 255 ++
> sound/soc/mediatek/mt8186/mt8186-afe-pcm.c | 3000 +++++++++++++++++
> 8 files changed, 3525 insertions(+), 2 deletions(-)
> create mode 100644 sound/soc/mediatek/mt8186/Makefile
> create mode 100644 sound/soc/mediatek/mt8186/mt8186-afe-common.h
> create mode 100644 sound/soc/mediatek/mt8186/mt8186-afe-control.c
> create mode 100644 sound/soc/mediatek/mt8186/mt8186-afe-pcm.c
>
> diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
> index 3b1ddea26a9e..f3c3b93226e4 100644
> --- a/sound/soc/mediatek/Kconfig
> +++ b/sound/soc/mediatek/Kconfig
> @@ -152,6 +152,18 @@ config SND_SOC_MT8183_DA7219_MAX98357A
> Select Y if you have such device.
> If unsure select "N".
>
> +config SND_SOC_MT8186
> + tristate "ASoC support for Mediatek MT8186 chip"
> + depends on ARCH_MEDIATEK || COMPILE_TEST
> + depends on COMMON_CLK
> + select SND_SOC_MEDIATEK
> + select MFD_SYSCON if SND_SOC_MT6358
> + help
> + This adds ASoC driver for Mediatek MT8186 boards
> + that can be used with other codecs.
> + Select Y if you have such device.
> + If unsure select "N".
> +
> config SND_SOC_MTK_BTCVSD
> tristate "ALSA BT SCO CVSD/MSBC Driver"
> help
> diff --git a/sound/soc/mediatek/Makefile b/sound/soc/mediatek/Makefile
> index 34778ca12106..5571c640a288 100644
> --- a/sound/soc/mediatek/Makefile
> +++ b/sound/soc/mediatek/Makefile
> @@ -4,5 +4,6 @@ obj-$(CONFIG_SND_SOC_MT2701) += mt2701/
> obj-$(CONFIG_SND_SOC_MT6797) += mt6797/
> obj-$(CONFIG_SND_SOC_MT8173) += mt8173/
> obj-$(CONFIG_SND_SOC_MT8183) += mt8183/
> +obj-$(CONFIG_SND_SOC_MT8186) += mt8186/
> obj-$(CONFIG_SND_SOC_MT8192) += mt8192/
> obj-$(CONFIG_SND_SOC_MT8195) += mt8195/
> diff --git a/sound/soc/mediatek/mt8186/Makefile b/sound/soc/mediatek/mt8186/Makefile
> new file mode 100644
> index 000000000000..7626bb3499dd
> --- /dev/null
> +++ b/sound/soc/mediatek/mt8186/Makefile
> @@ -0,0 +1,19 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +# platform driver
> +snd-soc-mt8186-afe-objs := \
> + mt8186-afe-pcm.o \
> + mt8186-audsys-clk.o \
> + mt8186-afe-clk.o \
> + mt8186-afe-gpio.o \
> + mt8186-dai-adda.o \
> + mt8186-afe-control.o \
> + mt8186-dai-i2s.o \
> + mt8186-dai-hw-gain.o \
> + mt8186-dai-pcm.o \
> + mt8186-dai-src.o \
> + mt8186-dai-hostless.o \
> + mt8186-dai-tdm.o \
> + mt8186-misc-control.o \
> +
> +obj-$(CONFIG_SND_SOC_MT8186) += snd-soc-mt8186-afe.o
> diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
> index 0275f66ddc18..a6b4f29049bb 100644
> --- a/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
> +++ b/sound/soc/mediatek/mt8186/mt8186-afe-clk.c
> @@ -645,7 +645,8 @@ int mt8186_init_clock(struct mtk_base_afe *afe)
> return 0;
> }
>
> -void mt8186_deinit_clock(struct mtk_base_afe *afe)
> +void mt8186_deinit_clock(void *priv)
> {
> + struct mtk_base_afe *afe = priv;
> mt8186_audsys_clk_unregister(afe);
> }
> diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-clk.h b/sound/soc/mediatek/mt8186/mt8186-afe-clk.h
> index c539557d7c78..d5988717d8f2 100644
> --- a/sound/soc/mediatek/mt8186/mt8186-afe-clk.h
> +++ b/sound/soc/mediatek/mt8186/mt8186-afe-clk.h
> @@ -81,7 +81,7 @@ enum {
> struct mtk_base_afe;
> int mt8186_set_audio_int_bus_parent(struct mtk_base_afe *afe, int clk_id);
> int mt8186_init_clock(struct mtk_base_afe *afe);
> -void mt8186_deinit_clock(struct mtk_base_afe *afe);
> +void mt8186_deinit_clock(void *priv);
> int mt8186_afe_enable_cgs(struct mtk_base_afe *afe);
> void mt8186_afe_disable_cgs(struct mtk_base_afe *afe);
> int mt8186_afe_enable_clock(struct mtk_base_afe *afe);
> diff --git a/sound/soc/mediatek/mt8186/mt8186-afe-common.h b/sound/soc/mediatek/mt8186/mt8186-afe-common.h
> new file mode 100644
> index 000000000000..7e9e71783468
> --- /dev/null
> +++ b/sound/soc/mediatek/mt8186/mt8186-afe-common.h
> @@ -0,0 +1,235 @@
> +/* SPDX-License-Identifier: GPL-2.0
> + *
> + * mt8186-afe-common.h -- Mediatek 8186 audio driver definitions
> + *
> + * Copyright (c) 2022 MediaTek Inc.
> + * Author: Jiaxin Yu <jiaxin.yu@mediatek.com>
> + */
> +
..snip..
> +
> +#define MT8186_RECORD_MEMIF MT8186_MEMIF_VUL12
> +#define MT8186_ECHO_REF_MEMIF MT8186_MEMIF_AWB
> +#define MT8186_PRIMARY_MEMIF MT8186_MEMIF_DL1
> +#define MT8186_FAST_MEMIF MT8186_MEMIF_DL2
> +#define MT8186_DEEP_MEMIF MT8186_MEMIF_DL3
> +#define MT8186_VOIP_MEMIF MT8186_MEMIF_DL12
> +#define MT8186_MMAP_DL_MEMIF MT8186_MEMIF_DL5
> +#define MT8186_MMAP_UL_MEMIF MT8186_MEMIF_VUL5
> +#define MT8186_BARGEIN_MEMIF MT8186_MEMIF_AWB
> +
> +enum {
> + MT8186_IRQ_0,
> + MT8186_IRQ_1,
> + MT8186_IRQ_2,
> + MT8186_IRQ_3,
> + MT8186_IRQ_4,
> + MT8186_IRQ_5,
> + MT8186_IRQ_6,
> + MT8186_IRQ_7,
> + MT8186_IRQ_8,
> + MT8186_IRQ_9,
> + MT8186_IRQ_10,
> + MT8186_IRQ_11,
> + MT8186_IRQ_12,
> + MT8186_IRQ_13,
> + MT8186_IRQ_14,
> + MT8186_IRQ_15,
> + MT8186_IRQ_16,
> + MT8186_IRQ_17,
> + MT8186_IRQ_18,
> + MT8186_IRQ_19,
> + MT8186_IRQ_20,
> + MT8186_IRQ_21,
> + MT8186_IRQ_22,
> + MT8186_IRQ_23,
> + MT8186_IRQ_24,
> + MT8186_IRQ_25,
> + MT8186_IRQ_26,
> + MT8186_IRQ_NUM,
> +};
> +
> +enum {
> + MT8186_AFE_IRQ_DIR_MCU = 0,
> + MT8186_AFE_IRQ_DIR_DSP,
> + MT8186_AFE_IRQ_DIR_BOTH,
> +};
> +
> +enum {
> + MTKAIF_PROTOCOL_1 = 0,
> + MTKAIF_PROTOCOL_2,
> + MTKAIF_PROTOCOL_2_CLK_P2,
> +};
> +
> +enum {
> + MTK_AFE_ADDA_DL_GAIN_MUTE = 0,
> + MTK_AFE_ADDA_DL_GAIN_NORMAL = 0xf74f,
> + /* SA suggest apply -0.3db to audio/speech path */
> +};
> +
> +#define MTK_SPK_NOT_SMARTPA_STR "MTK_SPK_NOT_SMARTPA"
> +#define MTK_SPK_RICHTEK_RT5509_STR "MTK_SPK_RICHTEK_RT5509"
> +#define MTK_SPK_MEDIATEK_MT6660_STR "MTK_SPK_MEDIATEK_MT6660"
> +#define MTK_SPK_GOODIX_TFA9874_STR "MTK_SPK_GOODIX_TFA9874"
> +
> +#define MTK_SPK_I2S_0_STR "MTK_SPK_I2S_0"
> +#define MTK_SPK_I2S_1_STR "MTK_SPK_I2S_1"
> +#define MTK_SPK_I2S_2_STR "MTK_SPK_I2S_2"
> +#define MTK_SPK_I2S_3_STR "MTK_SPK_I2S_3"
> +#define MTK_SPK_I2S_5_STR "MTK_SPK_I2S_5"
> +#define MTK_SPK_I2S_6_STR "MTK_SPK_I2S_6"
> +#define MTK_SPK_I2S_7_STR "MTK_SPK_I2S_7"
> +#define MTK_SPK_I2S_8_STR "MTK_SPK_I2S_8"
> +#define MTK_SPK_I2S_9_STR "MTK_SPK_I2S_9"
These definitions (and some more) are unused. Please drop.
Everything else looks ok to me.
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
next prev parent reply other threads:[~2022-07-14 14:08 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-07-12 15:04 [PATCH v9 0/8] ASoC: mediatek: Add support for MT8186 SoC Jiaxin Yu
2022-07-12 15:04 ` [PATCH v9 1/8] dt-bindings: mediatek: mt6358: add new compatible for using mt6366 Jiaxin Yu
2022-07-12 15:04 ` [PATCH v9 2/8] ASoC: mediatek: mt8186: add platform driver Jiaxin Yu
2022-07-14 14:08 ` AngeloGioacchino Del Regno [this message]
2022-07-12 15:04 ` [PATCH v9 3/8] ASoC: mediatek: mt8186: add mt8186-mt6366 common driver Jiaxin Yu
2022-07-14 14:10 ` AngeloGioacchino Del Regno
2022-07-12 15:04 ` [PATCH v9 4/8] dt-bindings: mediatek: mt8186: add audio afe document Jiaxin Yu
2022-07-12 15:04 ` [PATCH v9 5/8] ASoC: mediatek: mt8186: add machine driver with mt6366, da7219 and max98357 Jiaxin Yu
2022-07-14 14:13 ` AngeloGioacchino Del Regno
2022-07-12 15:04 ` [PATCH v9 6/8] dt-bindings: mediatek: mt8186: add mt8186-mt6366-da7219-max98357 document Jiaxin Yu
2022-07-12 15:04 ` [PATCH v9 7/8] ASoC: mediatek: mt8186: add machine driver with mt6366, rt1019 and rt5682s Jiaxin Yu
2022-07-12 15:04 ` [PATCH v9 8/8] dt-bindings: mediatek: mt8186: add mt8186-mt6366-rt1019-rt5682s document Jiaxin Yu
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=ba986bba-a90e-54f4-6984-b44674d0d377@collabora.com \
--to=angelogioacchino.delregno@collabora.com \
--cc=Project_Global_Chrome_Upstream_Group@mediatek.com \
--cc=aaronyu@google.com \
--cc=alsa-devel@alsa-project.org \
--cc=broonie@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=jiaxin.yu@mediatek.com \
--cc=julianbraha@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=robh+dt@kernel.org \
--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®