mbox series

[0/5] ASoC: mt8188: add new board support

Message ID 20230517111534.32630-1-trevor.wu@mediatek.com (mailing list archive)
Headers show
Series ASoC: mt8188: add new board support | expand

Message

Trevor Wu (吳文良) May 17, 2023, 11:15 a.m. UTC
In the series, we extend the capability of mt8188-mt6359 driver.

The following changes are included.
1. Divide ADDA BE dai into two dais for SOF.
2. Register hdmi/dp jack pins.
3. dai_fmt can be configured from device tree.
4. Add some I2S codecs support.

In addition, new compatible string "mediatek,mt8188-nau8825" is
included for a new board support.

Trevor Wu (5):
  ASoC: mediatek: mt8188: separate ADDA playback dai from capture dai
  ASoC: mediatek: mt8188-mt6359: register hdmi/dp jack pins
  ASoC: mediatek: common: soundcard driver add dai_fmt support
  ASoC: mediatek: mt8188-mt6359: support new board with nau88255
  ASoC: dt-bindings: mediatek,mt8188-mt6359: update properties

 .../sound/mediatek,mt8188-mt6359.yaml         |  27 +-
 sound/soc/mediatek/Kconfig                    |   4 +
 .../mediatek/common/mtk-soundcard-driver.c    |  49 ++-
 sound/soc/mediatek/mt8188/mt8188-afe-common.h |   3 +-
 sound/soc/mediatek/mt8188/mt8188-dai-adda.c   |  76 ++--
 sound/soc/mediatek/mt8188/mt8188-mt6359.c     | 326 +++++++++++++++++-
 6 files changed, 431 insertions(+), 54 deletions(-)

Comments

AngeloGioacchino Del Regno May 17, 2023, 11:54 a.m. UTC | #1
Il 17/05/23 13:15, Trevor Wu ha scritto:
> This patch adds multiple i2s codecs support including NAU88L25,
> MAX98390, and the dumb amp like NAU8318 usage. In addition, dmic-codec
> is also added to skip the beginning pop noise.
> 
> Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
> ---
>   sound/soc/mediatek/Kconfig                |   4 +
>   sound/soc/mediatek/mt8188/mt8188-mt6359.c | 267 +++++++++++++++++++++-
>   2 files changed, 270 insertions(+), 1 deletion(-)
> 
> diff --git a/sound/soc/mediatek/Kconfig b/sound/soc/mediatek/Kconfig
> index 4baac72677d9..4ea012342b52 100644
> --- a/sound/soc/mediatek/Kconfig
> +++ b/sound/soc/mediatek/Kconfig
> @@ -225,6 +225,10 @@ config SND_SOC_MT8188_MT6359
>   	depends on SND_SOC_MT8188 && MTK_PMIC_WRAP
>   	select SND_SOC_MT6359
>   	select SND_SOC_HDMI_CODEC
> +	select SND_SOC_DMIC
> +	select SND_SOC_MAX98390
> +	select SND_SOC_NAU8315
> +	select SND_SOC_NAU8825
>   	help
>   	  This adds support for ASoC machine driver for MediaTek MT8188
>   	  boards with the MT6359 and other I2S audio codecs.
> diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> index 6c3f36e2fffd..15fce2741f01 100644
> --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> @@ -6,6 +6,7 @@
>    * Author: Trevor Wu <trevor.wu@mediatek.com>
>    */
>   
> +#include <linux/input.h>
>   #include <linux/module.h>
>   #include <linux/of_device.h>
>   #include <linux/pm_runtime.h>
> @@ -13,10 +14,25 @@
>   #include <sound/pcm_params.h>
>   #include <sound/soc.h>
>   #include "mt8188-afe-common.h"
> +#include "../../codecs/nau8825.h"
>   #include "../../codecs/mt6359.h"
>   #include "../common/mtk-afe-platform-driver.h"
>   #include "../common/mtk-soundcard-driver.h"
>   
> +/*
> + * Maxim MAX98390
> + */
> +#define MAX98390_CODEC_DAI     "max98390-aif1"
> +#define MAX98390_DEV0_NAME     "max98390.0-0038" /* rear right */
> +#define MAX98390_DEV1_NAME     "max98390.0-0039" /* rear left */
> +#define MAX98390_DEV2_NAME     "max98390.0-003a" /* front right */
> +#define MAX98390_DEV3_NAME     "max98390.0-003b" /* front left */
> +
> +/*
> + * Nau88l25
> + */
> +#define NAU8825_CODEC_DAI  "nau8825-hifi"
> +
>   /* FE */
>   SND_SOC_DAILINK_DEFS(playback2,
>   		     DAILINK_COMP_ARRAY(COMP_CPU("DL2")),
> @@ -143,12 +159,15 @@ SND_SOC_DAILINK_DEFS(pcm1,
>   SND_SOC_DAILINK_DEFS(ul_src,
>   		     DAILINK_COMP_ARRAY(COMP_CPU("UL_SRC")),
>   		     DAILINK_COMP_ARRAY(COMP_CODEC("mt6359-sound",
> -						   "mt6359-snd-codec-aif1")),
> +						   "mt6359-snd-codec-aif1"),
> +					COMP_CODEC("dmic-codec",
> +						   "dmic-hifi")),
>   		     DAILINK_COMP_ARRAY(COMP_EMPTY()));
>   
>   struct mt8188_mt6359_priv {
>   	struct snd_soc_jack dp_jack;
>   	struct snd_soc_jack hdmi_jack;
> +	struct snd_soc_jack headset_jack;
>   };
>   
>   static struct snd_soc_jack_pin mt8188_hdmi_jack_pins[] = {
> @@ -165,11 +184,50 @@ static struct snd_soc_jack_pin mt8188_dp_jack_pins[] = {
>   	},
>   };
>   
> +static struct snd_soc_jack_pin nau8825_jack_pins[] = {
> +	{
> +		.pin    = "Headphone",

One Intel driver using NAU8825 declares this as

		.pin	= "Headphone Jack",

can we please use the same name, so that we're able to eventually share the
same configuration in the userspace?

For reference, please check intel/avs/boards/nau8825.c

Thanks,
Angelo
Trevor Wu (吳文良) May 17, 2023, 12:41 p.m. UTC | #2
On Wed, 2023-05-17 at 13:54 +0200, AngeloGioacchino Del Regno wrote:
> External email : Please do not click links or open attachments until
> you have verified the sender or the content.
> 
> 
> Il 17/05/23 13:15, Trevor Wu ha scritto:
> > This patch adds multiple i2s codecs support including NAU88L25,
> > MAX98390, and the dumb amp like NAU8318 usage. In addition, dmic-
> > codec
> > is also added to skip the beginning pop noise.
> > 
> > Signed-off-by: Trevor Wu <trevor.wu@mediatek.com>
> > ---
> >   sound/soc/mediatek/Kconfig                |   4 +
> >   sound/soc/mediatek/mt8188/mt8188-mt6359.c | 267
> > +++++++++++++++++++++-
> >   2 files changed, 270 insertions(+), 1 deletion(-)
> > 
> > diff --git a/sound/soc/mediatek/Kconfig
> > b/sound/soc/mediatek/Kconfig
> > index 4baac72677d9..4ea012342b52 100644
> > --- a/sound/soc/mediatek/Kconfig
> > +++ b/sound/soc/mediatek/Kconfig
> > @@ -225,6 +225,10 @@ config SND_SOC_MT8188_MT6359
> >       depends on SND_SOC_MT8188 && MTK_PMIC_WRAP
> >       select SND_SOC_MT6359
> >       select SND_SOC_HDMI_CODEC
> > +     select SND_SOC_DMIC
> > +     select SND_SOC_MAX98390
> > +     select SND_SOC_NAU8315
> > +     select SND_SOC_NAU8825
> >       help
> >         This adds support for ASoC machine driver for MediaTek
> > MT8188
> >         boards with the MT6359 and other I2S audio codecs.
> > diff --git a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> > b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> > index 6c3f36e2fffd..15fce2741f01 100644
> > --- a/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> > +++ b/sound/soc/mediatek/mt8188/mt8188-mt6359.c
> > @@ -6,6 +6,7 @@
> >    * Author: Trevor Wu <trevor.wu@mediatek.com>
> >    */
> > 
> > +#include <linux/input.h>
> >   #include <linux/module.h>
> >   #include <linux/of_device.h>
> >   #include <linux/pm_runtime.h>
> > @@ -13,10 +14,25 @@
> >   #include <sound/pcm_params.h>
> >   #include <sound/soc.h>
> >   #include "mt8188-afe-common.h"
> > +#include "../../codecs/nau8825.h"
> >   #include "../../codecs/mt6359.h"
> >   #include "../common/mtk-afe-platform-driver.h"
> >   #include "../common/mtk-soundcard-driver.h"
> > 
> > +/*
> > + * Maxim MAX98390
> > + */
> > +#define MAX98390_CODEC_DAI     "max98390-aif1"
> > +#define MAX98390_DEV0_NAME     "max98390.0-0038" /* rear right */
> > +#define MAX98390_DEV1_NAME     "max98390.0-0039" /* rear left */
> > +#define MAX98390_DEV2_NAME     "max98390.0-003a" /* front right */
> > +#define MAX98390_DEV3_NAME     "max98390.0-003b" /* front left */
> > +
> > +/*
> > + * Nau88l25
> > + */
> > +#define NAU8825_CODEC_DAI  "nau8825-hifi"
> > +
> >   /* FE */
> >   SND_SOC_DAILINK_DEFS(playback2,
> >                    DAILINK_COMP_ARRAY(COMP_CPU("DL2")),
> > @@ -143,12 +159,15 @@ SND_SOC_DAILINK_DEFS(pcm1,
> >   SND_SOC_DAILINK_DEFS(ul_src,
> >                    DAILINK_COMP_ARRAY(COMP_CPU("UL_SRC")),
> >                    DAILINK_COMP_ARRAY(COMP_CODEC("mt6359-sound",
> > -                                                "mt6359-snd-codec-
> > aif1")),
> > +                                                "mt6359-snd-codec-
> > aif1"),
> > +                                     COMP_CODEC("dmic-codec",
> > +                                                "dmic-hifi")),
> >                    DAILINK_COMP_ARRAY(COMP_EMPTY()));
> > 
> >   struct mt8188_mt6359_priv {
> >       struct snd_soc_jack dp_jack;
> >       struct snd_soc_jack hdmi_jack;
> > +     struct snd_soc_jack headset_jack;
> >   };
> > 
> >   static struct snd_soc_jack_pin mt8188_hdmi_jack_pins[] = {
> > @@ -165,11 +184,50 @@ static struct snd_soc_jack_pin
> > mt8188_dp_jack_pins[] = {
> >       },
> >   };
> > 
> > +static struct snd_soc_jack_pin nau8825_jack_pins[] = {
> > +     {
> > +             .pin    = "Headphone",
> 
> One Intel driver using NAU8825 declares this as
> 
>                 .pin    = "Headphone Jack",
> 
> can we please use the same name, so that we're able to eventually
> share the
> same configuration in the userspace?
> 
> For reference, please check intel/avs/boards/nau8825.c
> 
> Thanks,
> Angelo

OK. I will replace "Headphone" with "Headphone Jack" in V2.

Thanks,
Trevor