Commit c736d64d authored by Mark Brown's avatar Mark Brown

ASoC: mediatek: Update MT8195 machine driver

Merge series from Trevor Wu <trevor.wu@mediatek.com>:

This series of patches adds support for RT5682s headset codec in mt8195
machine drivers, and SOF support on card mt8195-mt6359-rt1019-rt5682 is
also included.
Patches are based on broonie tree "for-next" branch.

Changes since v1:
  - remove patch3 and patch4 in v1
  - add SOF support on card mt8195-mt6359-rt1012-rt5682
  - add new propertes to dt-bindings for mt8195-mt6359-rt1019-rt5682

Trevor Wu (4):
  ASoC: mediatek: mt8195: add headset codec rt5682s support
  dt-bindings: mediatek: mt8195: add model property
  ASoC: mediatek: mt8195: add sof support on mt8195-mt6359-rt1019-rt5682
  dt-bindings: mediatek: mt8195: add adsp and dai-link property

 .../sound/mt8195-mt6359-rt1011-rt5682.yaml    |   4 +
 .../sound/mt8195-mt6359-rt1019-rt5682.yaml    |  14 +
 sound/soc/mediatek/Kconfig                    |   2 +
 .../mt8195/mt8195-mt6359-rt1011-rt5682.c      |  29 +-
 .../mt8195/mt8195-mt6359-rt1019-rt5682.c      | 347 +++++++++++++++++-
 5 files changed, 370 insertions(+), 26 deletions(-)

--
2.18.0
parents 7bef0010 6182ec46
...@@ -16,6 +16,10 @@ properties: ...@@ -16,6 +16,10 @@ properties:
compatible: compatible:
const: mediatek,mt8195_mt6359_rt1011_rt5682 const: mediatek,mt8195_mt6359_rt1011_rt5682
model:
$ref: /schemas/types.yaml#/definitions/string
description: User specified audio sound card name
mediatek,platform: mediatek,platform:
$ref: "/schemas/types.yaml#/definitions/phandle" $ref: "/schemas/types.yaml#/definitions/phandle"
description: The phandle of MT8195 ASoC platform. description: The phandle of MT8195 ASoC platform.
......
...@@ -16,6 +16,10 @@ properties: ...@@ -16,6 +16,10 @@ properties:
compatible: compatible:
const: mediatek,mt8195_mt6359_rt1019_rt5682 const: mediatek,mt8195_mt6359_rt1019_rt5682
model:
$ref: /schemas/types.yaml#/definitions/string
description: User specified audio sound card name
mediatek,platform: mediatek,platform:
$ref: "/schemas/types.yaml#/definitions/phandle" $ref: "/schemas/types.yaml#/definitions/phandle"
description: The phandle of MT8195 ASoC platform. description: The phandle of MT8195 ASoC platform.
...@@ -28,6 +32,16 @@ properties: ...@@ -28,6 +32,16 @@ properties:
$ref: "/schemas/types.yaml#/definitions/phandle" $ref: "/schemas/types.yaml#/definitions/phandle"
description: The phandle of MT8195 HDMI codec node. description: The phandle of MT8195 HDMI codec node.
mediatek,adsp:
$ref: "/schemas/types.yaml#/definitions/phandle"
description: The phandle of MT8195 ADSP platform.
mediatek,dai-link:
$ref: /schemas/types.yaml#/definitions/string-array
description:
A list of the desired dai-links in the sound card. Each entry is a
name defined in the machine driver.
additionalProperties: false additionalProperties: false
required: required:
......
...@@ -205,6 +205,7 @@ config SND_SOC_MT8195_MT6359_RT1019_RT5682 ...@@ -205,6 +205,7 @@ config SND_SOC_MT8195_MT6359_RT1019_RT5682
select SND_SOC_MT6359 select SND_SOC_MT6359
select SND_SOC_RT1015P select SND_SOC_RT1015P
select SND_SOC_RT5682_I2C select SND_SOC_RT5682_I2C
select SND_SOC_RT5682S
select SND_SOC_DMIC select SND_SOC_DMIC
select SND_SOC_HDMI_CODEC select SND_SOC_HDMI_CODEC
help help
...@@ -220,6 +221,7 @@ config SND_SOC_MT8195_MT6359_RT1011_RT5682 ...@@ -220,6 +221,7 @@ config SND_SOC_MT8195_MT6359_RT1011_RT5682
select SND_SOC_MT6359 select SND_SOC_MT6359
select SND_SOC_RT1011 select SND_SOC_RT1011
select SND_SOC_RT5682_I2C select SND_SOC_RT5682_I2C
select SND_SOC_RT5682S
select SND_SOC_DMIC select SND_SOC_DMIC
select SND_SOC_HDMI_CODEC select SND_SOC_HDMI_CODEC
help help
......
...@@ -27,6 +27,9 @@ ...@@ -27,6 +27,9 @@
#define RT5682_CODEC_DAI "rt5682-aif1" #define RT5682_CODEC_DAI "rt5682-aif1"
#define RT5682_DEV0_NAME "rt5682.2-001a" #define RT5682_DEV0_NAME "rt5682.2-001a"
#define RT5682S_CODEC_DAI "rt5682s-aif1"
#define RT5682S_DEV0_NAME "rt5682s.2-001a"
struct mt8195_mt6359_rt1011_rt5682_priv { struct mt8195_mt6359_rt1011_rt5682_priv {
struct device_node *platform_node; struct device_node *platform_node;
struct device_node *hdmi_node; struct device_node *hdmi_node;
...@@ -691,14 +694,12 @@ SND_SOC_DAILINK_DEFS(ETDM1_IN_BE, ...@@ -691,14 +694,12 @@ SND_SOC_DAILINK_DEFS(ETDM1_IN_BE,
SND_SOC_DAILINK_DEFS(ETDM2_IN_BE, SND_SOC_DAILINK_DEFS(ETDM2_IN_BE,
DAILINK_COMP_ARRAY(COMP_CPU("ETDM2_IN")), DAILINK_COMP_ARRAY(COMP_CPU("ETDM2_IN")),
DAILINK_COMP_ARRAY(COMP_CODEC(RT5682_DEV0_NAME, DAILINK_COMP_ARRAY(COMP_DUMMY()),
RT5682_CODEC_DAI)),
DAILINK_COMP_ARRAY(COMP_EMPTY())); DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(ETDM1_OUT_BE, SND_SOC_DAILINK_DEFS(ETDM1_OUT_BE,
DAILINK_COMP_ARRAY(COMP_CPU("ETDM1_OUT")), DAILINK_COMP_ARRAY(COMP_CPU("ETDM1_OUT")),
DAILINK_COMP_ARRAY(COMP_CODEC(RT5682_DEV0_NAME, DAILINK_COMP_ARRAY(COMP_DUMMY()),
RT5682_CODEC_DAI)),
DAILINK_COMP_ARRAY(COMP_EMPTY())); DAILINK_COMP_ARRAY(COMP_EMPTY()));
SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE, SND_SOC_DAILINK_DEFS(ETDM2_OUT_BE,
...@@ -1046,9 +1047,19 @@ static int mt8195_mt6359_rt1011_rt5682_dev_probe(struct platform_device *pdev) ...@@ -1046,9 +1047,19 @@ static int mt8195_mt6359_rt1011_rt5682_dev_probe(struct platform_device *pdev)
struct snd_soc_card *card = &mt8195_mt6359_rt1011_rt5682_soc_card; struct snd_soc_card *card = &mt8195_mt6359_rt1011_rt5682_soc_card;
struct snd_soc_dai_link *dai_link; struct snd_soc_dai_link *dai_link;
struct mt8195_mt6359_rt1011_rt5682_priv *priv; struct mt8195_mt6359_rt1011_rt5682_priv *priv;
int is5682s = 0;
int ret, i; int ret, i;
card->dev = &pdev->dev; card->dev = &pdev->dev;
ret = snd_soc_of_parse_card_name(card, "model");
if (ret) {
dev_err(&pdev->dev, "%s new card name parsing error %d\n",
__func__, ret);
return ret;
}
if (strstr(card->name, "_5682s"))
is5682s = 1;
priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
...@@ -1078,9 +1089,7 @@ static int mt8195_mt6359_rt1011_rt5682_dev_probe(struct platform_device *pdev) ...@@ -1078,9 +1089,7 @@ static int mt8195_mt6359_rt1011_rt5682_dev_probe(struct platform_device *pdev)
dai_link->codecs->dai_name = "i2s-hifi"; dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_dptx_codec_init; dai_link->init = mt8195_dptx_codec_init;
} }
} } else if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
priv->hdmi_node = priv->hdmi_node =
of_parse_phandle(pdev->dev.of_node, of_parse_phandle(pdev->dev.of_node,
"mediatek,hdmi-codec", 0); "mediatek,hdmi-codec", 0);
...@@ -1092,6 +1101,12 @@ static int mt8195_mt6359_rt1011_rt5682_dev_probe(struct platform_device *pdev) ...@@ -1092,6 +1101,12 @@ static int mt8195_mt6359_rt1011_rt5682_dev_probe(struct platform_device *pdev)
dai_link->codecs->dai_name = "i2s-hifi"; dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_hdmi_codec_init; dai_link->init = mt8195_hdmi_codec_init;
} }
} else if (strcmp(dai_link->name, "ETDM1_OUT_BE") == 0 ||
strcmp(dai_link->name, "ETDM2_IN_BE") == 0) {
dai_link->codecs->name =
is5682s ? RT5682S_DEV0_NAME : RT5682_DEV0_NAME;
dai_link->codecs->dai_name =
is5682s ? RT5682S_CODEC_DAI : RT5682_CODEC_DAI;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment