Message ID | 20250407120708.26495-1-darren.ye@mediatek.com (mailing list archive) |
---|---|
Headers | show |
Series | ASoC: mediatek: Add support for MT8196 SoC | expand |
On 07/04/2025 14:06, Darren.Ye wrote: > From: Darren Ye <darren.ye@mediatek.com> > > This series of patches adds support for Mediatek AFE of MT8196 SoC. > Patches are based on broonie tree "for-next" branch. > > Changes since v1: > - modify mtk_memif_set_channel and mtk_afe_pcm_pointer interfaces > are improved to support mt8196. > - remove duplicate definitions in the mt8196 common header file. > - cm logic is merge into the afe platform driver. > - modify afe clk to return judgment logic and remove useless clk sources. > - refactor the mt8196 adda dai driver. > - remove the gpio module and use SND_SOC_DAPM_PINCTRL to manage it. > - removes CONNSYS_I2S related functions that are not supported in i2s dai driver. > - fixed mt8196-afe.yaml and mt8196-mt6681.yaml syntax issues. > - modify log printing in all modules. You just sent it today and immediately sent (20 minutes later) v2 with so many changes? Give people chance to review. One big patchset every few days. Best regards, Krzysztof
I am so sorry, the first lost v2 mark was sent yesterday, please review the v2 version directly, thanks. Best regards, Darren Ye On Mon, 2025-04-07 at 15:04 +0200, Krzysztof Kozlowski wrote: > External email : Please do not click links or open attachments until > you have verified the sender or the content. > > > On 07/04/2025 14:06, Darren.Ye wrote: > > From: Darren Ye <darren.ye@mediatek.com> > > > > This series of patches adds support for Mediatek AFE of MT8196 SoC. > > Patches are based on broonie tree "for-next" branch. > > > > Changes since v1: > > - modify mtk_memif_set_channel and mtk_afe_pcm_pointer interfaces > > are improved to support mt8196. > > - remove duplicate definitions in the mt8196 common header file. > > - cm logic is merge into the afe platform driver. > > - modify afe clk to return judgment logic and remove useless clk > > sources. > > - refactor the mt8196 adda dai driver. > > - remove the gpio module and use SND_SOC_DAPM_PINCTRL to manage > > it. > > - removes CONNSYS_I2S related functions that are not supported in > > i2s dai driver. > > - fixed mt8196-afe.yaml and mt8196-mt6681.yaml syntax issues. > > - modify log printing in all modules. > > You just sent it today and immediately sent (20 minutes later) v2 > with > so many changes? > > Give people chance to review. One big patchset every few days. > > Best regards, > Krzysztof
On 07-04-2025 17:36, Darren.Ye wrote: > From: Darren Ye<darren.ye@mediatek.com> > > Add mt8196 platform driver. > > Signed-off-by: Darren Ye<darren.ye@mediatek.com> > --- > sound/soc/mediatek/Kconfig | 10 + > sound/soc/mediatek/Makefile | 1 + > sound/soc/mediatek/mt8196/Makefile | 14 + > sound/soc/mediatek/mt8196/mt8196-afe-pcm.c | 5070 ++++++++++++++++++++ > 4 files changed, 5095 insertions(+) > create mode 100644 sound/soc/mediatek/mt8196/Makefile > create mode 100644 sound/soc/mediatek/mt8196/mt8196-afe-pcm.c > > diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig > index 3033e2d3fe16..606f221e238c 100644 > --- a/sound/soc/mediatek/Kconfig > +++ b/sound/soc/mediatek/Kconfig > @@ -204,6 +204,16 @@ config SND_SOC_MT8186_MT6366 > Select Y if you have such device. > If unsure select "N". > > +config SND_SOC_MT8196 > + tristate "ASoC support for Mediatek MT8196 chip" > + depends on ARCH_MEDIATEK > + select SND_SOC_MEDIATEK > + help > + This adds ASoC driver for Mediatek MT8196 boards > + that can be used with other codecs. > + Select Y if you have such device. > + If unsure select "N". > + is this not depends on COMMON_CLK and select SND_SOC_MT6358/6359 not require ? > 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 4b55434f2168..11d7c484a5d3 100644 > --- a/sound/soc/mediatek/Makefile > +++ b/sound/soc/mediatek/Makefile > @@ -10,3 +10,4 @@ obj-$(CONFIG_SND_SOC_MT8188) += mt8188/ > obj-$(CONFIG_SND_SOC_MT8192) += mt8192/ > obj-$(CONFIG_SND_SOC_MT8195) += mt8195/ obj-$(CONFIG_SND_SOC_MT8196) += mt8196/ should be after mt8195. > obj-$(CONFIG_SND_SOC_MT8365) += mt8365/ > +obj-$(CONFIG_SND_SOC_MT8196) += mt8196/ > diff --git a/sound/soc/mediatek/mt8196/Makefile b/sound/soc/mediatek/mt8196/Makefile > new file mode 100644 > index 000000000000..9bcc09a9a94d > --- /dev/null > +++ b/sound/soc/mediatek/mt8196/Makefile > @@ -0,0 +1,14 @@ > +# SPDX-License-Identifier: GPL-2.0 > + > +# common include path > +subdir-ccflags-y += -I$(srctree)/sound/soc/mediatek/common > + > +# platform driver > +obj-$(CONFIG_SND_SOC_MT8196) += snd-soc-mt8196-afe.o > +snd-soc-mt8196-afe-objs += \ > + mt8196-afe-pcm.o \ > + mt8196-afe-clk.o \ > + mt8196-dai-adda.o \ > + mt8196-dai-i2s.o \ > + mt8196-dai-tdm.o > + need to follow right sequence like mediatek/mt8195/Makefile > diff --git a/sound/soc/mediatek/mt8196/mt8196-afe-pcm.c b/sound/soc/mediatek/mt8196/mt8196-afe-pcm.c > new file mode 100644 > index 000000000000..84ccbc7419c7 > --- /dev/null > +++ b/sound/soc/mediatek/mt8196/mt8196-afe-pcm.c > @@ -0,0 +1,5070 @@ > +// SPDX-License-Identifier: GPL-2.0 > +/* > + * Mediatek ALSA SoC AFE platform driver for 8196 > + * > + * Copyright (c) 2024 MediaTek Inc. > + * Author: Darren Ye<darren.ye@mediatek.com> > + */ > + > +#include <linux/delay.h> > +#include <linux/dma-mapping.h> > +#include <linux/module.h> > +#include <linux/of.h> > +#include <linux/of_address.h> > +#include <linux/pm_runtime.h> > +#include <linux/regmap.h> > +#include <linux/of_device.h> > +#include <sound/soc.h> > +#include <linux/of_reserved_mem.h> > + > +#include "mt8196-afe-common.h" > +#include "mtk-afe-platform-driver.h" > +#include "mtk-afe-fe-dai.h" > +#include "mt8196-afe-clk.h" > +#include "mt8196-interconnection.h" > + header required to be in a sequence. easy to read! #include "mt8196-afe-clk.h" #include "mt8196-afe-common.h" #include "mtk-afe-fe-dai.h" #include "mtk-afe-platform-driver.h" #include "mt8196-interconnection.h" > +static const struct snd_pcm_hardware mt8196_afe_hardware = { > + .info = (SNDRV_PCM_INFO_MMAP | > + SNDRV_PCM_INFO_NO_PERIOD_WAKEUP | > + SNDRV_PCM_INFO_INTERLEAVED | > + SNDRV_PCM_INFO_MMAP_VALID), > + .formats = (SNDRV_PCM_FMTBIT_S16_LE | > + SNDRV_PCM_FMTBIT_S24_LE | > + SNDRV_PCM_FMTBIT_S32_LE), > + .period_bytes_min = 96, > + .period_bytes_max = 4 * 48 * 1024, > + .periods_min = 2, > + .periods_max = 256, > + .buffer_bytes_max = 256 * 1024, > + .fifo_size = 0, > +}; > + Thanks, Alok
From: Darren Ye <darren.ye@mediatek.com> This series of patches adds support for Mediatek AFE of MT8196 SoC. Patches are based on broonie tree "for-next" branch. Changes since v1: - modify mtk_memif_set_channel and mtk_afe_pcm_pointer interfaces are improved to support mt8196. - remove duplicate definitions in the mt8196 common header file. - cm logic is merge into the afe platform driver. - modify afe clk to return judgment logic and remove useless clk sources. - refactor the mt8196 adda dai driver. - remove the gpio module and use SND_SOC_DAPM_PINCTRL to manage it. - removes CONNSYS_I2S related functions that are not supported in i2s dai driver. - fixed mt8196-afe.yaml and mt8196-mt6681.yaml syntax issues. - modify log printing in all modules. - optimize the header file included for machine driver. Darren Ye (11): ASoC: mediatek: common: modify mtk afe common driver for mt8196 ASoC: mediatek: common: modify mtk afe platform driver for mt8196 ASoC: mediatek: mt8196: add common header ASoC: mediatek: mt8196: support audio clock control ASoC: mediatek: mt8196: support ADDA in platform driver ASoC: mediatek: mt8196: support I2S in platform driver ASoC: mediatek: mt8196: support TDM in platform driver ASoC: mediatek: mt8196: add platform driver ASoC: dt-bindings: mediatek,mt8196-afe: add audio AFE document ASoC: mediatek: mt8196: add machine driver with mt6681 ASoC: dt-bindings: mediatek,mt8196-mt6681: add mt8196-mt6681 document .../bindings/sound/mediatek,mt8196-afe.yaml | 233 + .../sound/mediatek,mt8196-mt6681.yaml | 114 + sound/soc/mediatek/Kconfig | 30 + sound/soc/mediatek/Makefile | 1 + sound/soc/mediatek/common/mtk-afe-fe-dai.c | 23 +- sound/soc/mediatek/common/mtk-afe-fe-dai.h | 1 + .../mediatek/common/mtk-afe-platform-driver.c | 47 +- .../mediatek/common/mtk-afe-platform-driver.h | 2 + sound/soc/mediatek/common/mtk-base-afe.h | 13 + sound/soc/mediatek/mt8196/Makefile | 16 + sound/soc/mediatek/mt8196/mt8196-afe-clk.c | 729 + sound/soc/mediatek/mt8196/mt8196-afe-clk.h | 78 + sound/soc/mediatek/mt8196/mt8196-afe-common.h | 194 + sound/soc/mediatek/mt8196/mt8196-afe-pcm.c | 5070 +++++++ sound/soc/mediatek/mt8196/mt8196-dai-adda.c | 918 ++ sound/soc/mediatek/mt8196/mt8196-dai-i2s.c | 4080 ++++++ sound/soc/mediatek/mt8196/mt8196-dai-tdm.c | 825 ++ .../mediatek/mt8196/mt8196-interconnection.h | 121 + sound/soc/mediatek/mt8196/mt8196-mt6681.c | 876 ++ sound/soc/mediatek/mt8196/mt8196-reg.h | 12068 ++++++++++++++++ 20 files changed, 25414 insertions(+), 25 deletions(-) create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8196-afe.yaml create mode 100644 Documentation/devicetree/bindings/sound/mediatek,mt8196-mt6681.yaml create mode 100644 sound/soc/mediatek/mt8196/Makefile create mode 100644 sound/soc/mediatek/mt8196/mt8196-afe-clk.c create mode 100644 sound/soc/mediatek/mt8196/mt8196-afe-clk.h create mode 100644 sound/soc/mediatek/mt8196/mt8196-afe-common.h create mode 100644 sound/soc/mediatek/mt8196/mt8196-afe-pcm.c create mode 100644 sound/soc/mediatek/mt8196/mt8196-dai-adda.c create mode 100644 sound/soc/mediatek/mt8196/mt8196-dai-i2s.c create mode 100644 sound/soc/mediatek/mt8196/mt8196-dai-tdm.c create mode 100644 sound/soc/mediatek/mt8196/mt8196-interconnection.h create mode 100644 sound/soc/mediatek/mt8196/mt8196-mt6681.c create mode 100644 sound/soc/mediatek/mt8196/mt8196-reg.h