Skip to content

Commit

Permalink
ASoC: mt8195: correct the dts parsing logic about DPTX and HDMITX
Browse files Browse the repository at this point in the history
According to the description in dt-bindings, phandle assignment of
HDMI TX and DP TX are not required properties, but driver regards them
as required properties.
In real use case, it's expected that DP TX and HDMI TX are optional
features, so correct the behavior in driver.

Fixes: 40d605d ("ASoC: mediatek: mt8195: add machine driver with mt6359, rt1019 and rt5682")
Signed-off-by: Trevor Wu <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Mark Brown <[email protected]>
  • Loading branch information
wenliangwu authored and broonie committed Sep 3, 2021
1 parent b3dded7 commit 7eac1e2
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions sound/soc/mediatek/mt8195/mt8195-mt6359-rt1019-rt5682.c
Original file line number Diff line number Diff line change
Expand Up @@ -1018,27 +1018,25 @@ static int mt8195_mt6359_rt1019_rt5682_dev_probe(struct platform_device *pdev)
of_parse_phandle(pdev->dev.of_node,
"mediatek,dptx-codec", 0);
if (!dai_link->codecs->of_node) {
dev_err(&pdev->dev, "Property 'dptx-codec' missing or invalid\n");
return -EINVAL;
dev_dbg(&pdev->dev, "No property 'dptx-codec'\n");
} else {
dai_link->codecs->name = NULL;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_dptx_codec_init;
}

dai_link->codecs->name = NULL;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_dptx_codec_init;
}

if (strcmp(dai_link->name, "ETDM3_OUT_BE") == 0) {
dai_link->codecs->of_node =
of_parse_phandle(pdev->dev.of_node,
"mediatek,hdmi-codec", 0);
if (!dai_link->codecs->of_node) {
dev_err(&pdev->dev, "Property 'hdmi-codec' missing or invalid\n");
return -EINVAL;
dev_dbg(&pdev->dev, "No property 'hdmi-codec'\n");
} else {
dai_link->codecs->name = NULL;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_hdmi_codec_init;
}

dai_link->codecs->name = NULL;
dai_link->codecs->dai_name = "i2s-hifi";
dai_link->init = mt8195_hdmi_codec_init;
}
}

Expand Down

0 comments on commit 7eac1e2

Please sign in to comment.