From mboxrd@z Thu Jan 1 00:00:00 1970 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 BA886C43334 for ; Mon, 13 Jun 2022 18:29:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234181AbiFMS3J (ORCPT ); Mon, 13 Jun 2022 14:29:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343535AbiFMS2e (ORCPT ); Mon, 13 Jun 2022 14:28:34 -0400 Received: from wout4-smtp.messagingengine.com (wout4-smtp.messagingengine.com [64.147.123.20]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9A9601FD28D for ; Mon, 13 Jun 2022 07:48:59 -0700 (PDT) Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.west.internal (Postfix) with ESMTP id 7278C3200972; Mon, 13 Jun 2022 10:48:58 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Mon, 13 Jun 2022 10:48:59 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm1; t=1655131737; x=1655218137; bh=nd A8eY6a5iymQUjqVhwiJTuImgDxQFcTtcXOYgHWCuo=; b=kAi1yhJczX7MPdDiaT Izrf8qWozX2mLQZm6TE6OM6a+3T4W3XPWSykMoBWwY7qImfX6bLPuVESmvJDrerl PdsPkWXg0TVhq6yWlxIHGpB2XcQqG2Of+1LmQchW/IEjK5urHYG7tD+cdnE39GYu qT6/s67cny8kPAOLYqDf4VQSicV2eWl1WB1uqjgxLcANIBB5jGnSZeem9vyHwJnL SyHcLBXL2CrcLAloQwlDS+8GsQ4X4p/4Tvnzz1AqcHQPu0o23Qv/57Ycbwkt4dLn qJ/HdBr9QJfZXISwmULMgiW6rtTok0Q419CrSaABhUukeBGhL5m6TC8v35i/1E1C 3PLA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1655131737; x=1655218137; bh=ndA8eY6a5iymQ UjqVhwiJTuImgDxQFcTtcXOYgHWCuo=; b=HMqq3PSD70IkmXYDcbbJS8M8WUd0m simBT4zCdqUe+xLJTgIPLrP4Rn2bCTS75mJLsccj2rWVXttI26JoH7gYNuRBoQcI L60lIpeqkzgQ0bH73ONXrXlgvz6FySmu0hSKUTpU+X0I2JalGUV4iHkHTe707lzF Bc9t+lSrQMrGJqRjwmkZu9sFjnBgi7vZgjOLMk2fibwzvmoX7srK6lqmcjeCCetv wflu4Uy+aRGpI2wEt7s5V2nkEDX2qj8gWaenLvy0VQgYxu2zNLeyUmzARPe7yCbb pyP1xS9cefx51DBZed4XaNgk/JpxZzzi3TaoxiLmLBlCzcOw1oWC2M+ZA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddujedgjeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvvefufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpeelkeefteduhfekjeeihfetudfguedvveekkeetteekhfekhfdtlefgfedu vdejhfenucevlhhushhtvghrufhiiigvpedunecurfgrrhgrmhepmhgrihhlfhhrohhmpe hmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 13 Jun 2022 10:48:57 -0400 (EDT) From: Maxime Ripard To: Daniel Vetter , David Airlie , Maarten Lankhorst , Thomas Zimmermann , Maxime Ripard Cc: dri-devel@lists.freedesktop.org, Phil Elwell , stable@vger.kernel.org Subject: [PATCH 17/33] drm/vc4: hdmi: Disable audio if dmas property is present but empty Date: Mon, 13 Jun 2022 16:47:44 +0200 Message-Id: <20220613144800.326124-18-maxime@cerno.tech> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613144800.326124-1-maxime@cerno.tech> References: <20220613144800.326124-1-maxime@cerno.tech> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Phil Elwell 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 Signed-off-by: Maxime Ripard --- drivers/gpu/drm/vc4/vc4_hdmi.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c index 6aadb65eb640..c8571e17afa8 100644 --- a/drivers/gpu/drm/vc4/vc4_hdmi.c +++ b/drivers/gpu/drm/vc4/vc4_hdmi.c @@ -2034,12 +2034,12 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) struct device *dev = &vc4_hdmi->pdev->dev; struct platform_device *codec_pdev; const __be32 *addr; - int index; + int index, len; int ret; - 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; } -- 2.36.1