提交 e4d27e07 编写于 作者: P Phil Elwell 提交者: Zheng Zengkai

drm/vc4: hdmi: Disable audio if dmas property is present but empty

stable inclusion
from stable-v5.10.137
commit de63dbc296816aa9baf503dc1166c26c3b120503
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I60PLB

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=de63dbc296816aa9baf503dc1166c26c3b120503

--------------------------------

commit db2b927f upstream.

The dmas property is used to hold the dmaengine channel used for audio
output.

Older device trees were missing that property, so if it's not there we
disable the audio output entirely.

However, some overlays have set an empty value to that property, mostly
to workaround the fact that overlays cannot remove a property. Let's add
a test for that case and if it's empty, let's disable it as well.

Cc: <stable@vger.kernel.org>
Signed-off-by: NPhil Elwell <phil@raspberrypi.org>
Link: https://lore.kernel.org/r/20220613144800.326124-18-maxime@cerno.techSigned-off-by: NMaxime Ripard <maxime@cerno.tech>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
Reviewed-by: NWei Li <liwei391@huawei.com>
上级 ce6c695b
...@@ -1231,12 +1231,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) ...@@ -1231,12 +1231,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi)
struct snd_soc_card *card = &vc4_hdmi->audio.card; struct snd_soc_card *card = &vc4_hdmi->audio.card;
struct device *dev = &vc4_hdmi->pdev->dev; struct device *dev = &vc4_hdmi->pdev->dev;
const __be32 *addr; const __be32 *addr;
int index; int index, len;
int ret; int ret;
if (!of_find_property(dev->of_node, "dmas", NULL)) { if (!of_find_property(dev->of_node, "dmas", &len) || !len) {
dev_warn(dev, dev_warn(dev,
"'dmas' DT property is missing, no HDMI audio\n"); "'dmas' DT property is missing or empty, no HDMI audio\n");
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册