From nobody Sun Dec 14 06:16:16 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C9BBC00140 for ; Mon, 15 Aug 2022 18:19:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240309AbiHOSTk (ORCPT ); Mon, 15 Aug 2022 14:19:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58064 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238887AbiHOSS0 (ORCPT ); Mon, 15 Aug 2022 14:18:26 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30DC32B633; Mon, 15 Aug 2022 11:16:04 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BC3A261299; Mon, 15 Aug 2022 18:16:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4E70C433C1; Mon, 15 Aug 2022 18:16:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660587363; bh=4qlNeIHgUazwweJK0KQBHpXgXwP8gTAiqf2xf6WlGYI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NLzZYstLOxwxKmjc1tVEGDYYkHBmAMS++69dL2mVGqsKeIYQGkL1mtCzsJwx7rhCY Qi3nPJ0OPnUIdeHO3QRdKNXXBxEq3jvW/59cZZoLXvFujUub+9AY3Vbd1jjRXgrefK vIjjN7BrXpyoKFd/m963Nw4jPhxR2SmUMvEJvr4c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Phil Elwell , Maxime Ripard Subject: [PATCH 5.15 062/779] drm/vc4: hdmi: Disable audio if dmas property is present but empty Date: Mon, 15 Aug 2022 19:55:06 +0200 Message-Id: <20220815180339.909034261@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Phil Elwell commit db2b927f8668adf3ac765e0921cd2720f5c04172 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: Signed-off-by: Phil Elwell Link: https://lore.kernel.org/r/20220613144800.326124-18-maxime@cerno.tech Signed-off-by: Maxime Ripard Signed-off-by: Greg Kroah-Hartman --- drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -1470,12 +1470,12 @@ static int vc4_hdmi_audio_init(struct vc struct device *dev =3D &vc4_hdmi->pdev->dev; struct platform_device *codec_pdev; const __be32 *addr; - int index; + int index, len; int ret; =20 - if (!of_find_property(dev->of_node, "dmas", NULL)) { + if (!of_find_property(dev->of_node, "dmas", &len) || !len) { 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; }