From patchwork Fri May 24 18:26:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dave Stevenson X-Patchwork-Id: 13673521 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E75BEC25B74 for ; Fri, 24 May 2024 18:29:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=f36s8HBEIsijXmQQmkAh5+FAvfP4LnpAy5PohhkQHSI=; b=gbKTdakxZKLNmv wTaN5qI0TYKeReB0hXSLk4qGaZho2OywVUejz6Tvd+ilZ0TuZtLMmb1i2bT6HBYSuD3blomvPRb4o Ttk4WlVn6Rx7IpOo91VUA8l1CSAlF8xeJVp684bRtHf6SCvU/yhuNsKrzoBkb/5rtuuuLmyVyhjzX xNGo41+t80NqQVAP/MES/xocSnZOGvzOcad9WB6aF9DvGJHBaFtKuuZFmw2DCN2usK62A4kY0U4w1 CYdepu/HqLbsfbhC6IBsVv73BJcde3wzb3UrMITv4/Xcvf8j/j3w7SNfXjzGA3PnOLKADe9YWke9r 1mqtysFBGggJi/TyAIug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZf0-00000009Zsq-1ChH; Fri, 24 May 2024 18:28:58 +0000 Received: from mail-wm1-x364.google.com ([2a00:1450:4864:20::364]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sAZe2-00000009Z8J-38s5 for linux-arm-kernel@lists.infradead.org; Fri, 24 May 2024 18:28:06 +0000 Received: by mail-wm1-x364.google.com with SMTP id 5b1f17b1804b1-4200ee47de7so68153495e9.2 for ; Fri, 24 May 2024 11:27:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=raspberrypi.com; s=google; t=1716575272; x=1717180072; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=MmjLsXIH2Amncxc11ehW4fWxMk13TiDZ+O44YXe6Wgk=; b=GNgjj6VUAJ2I+m/ojttT/z3nOv+A2OhL2C813lC99HdjRP7yXkD/nMNnrJFsucs+sP SyRbAcBw3w6UZGF6uS/D/Ph/OFZ/74uBqUE7sAgeCUPcqOEJXOkj8vKOoGbgmMvoekFQ vkKsd9LxBpieM/2QpJmQH0j2mfS2m22KuC3SgEhAvRCaxjGez8K5/fSk1MS7oDzdpiwL EgTd05SEyx70fxS0nW1EHpdaTdk/dPp9nSlzFJ9bUY9ilWBuO752WwFc8Evr4LLC7Dwb BMtETMIzy93mKupFYKGrzBiHdDz+WTKdKPxz6Vs73x4z2G9o270o63RmYRzppZpT+P85 q1ZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716575272; x=1717180072; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MmjLsXIH2Amncxc11ehW4fWxMk13TiDZ+O44YXe6Wgk=; b=oMJLpOZEhSfTULsMS/pVSC1m/FeQ5MgKLW9qPXBerCCGKOI/TzqA3qoSqJ2ftryHTY s9S2nVDQzCDDTZNUxuz6sBrxtlYi9GR48txE1Hh5Bx3oc2luNmHJstvUQ7TzrSFY+NYZ sh2sfDr19w0WyBmW37nTHctf073qe1lmE+v+V/U8smKlFw6mdAKTbJVU8DLf1zS9SYcc v2VRLHKnOjbEjscULjurAJhr2Qiiwd1usjb7jif6C17kACPiwXTNfIptGI1AGhPqXt1L ukIc6g9zw5DZDHio5wcReWSoBiK3z77b8SoqTB/9O1MnlbsC5a3bJxZDYHl60dpzPpcN Olbg== X-Forwarded-Encrypted: i=1; AJvYcCWdA77ODnfLIN1fYLfmmevfzH1sxKgIHVHNvm5/WiVuBNop5HvHQaxjAIAQ8gFRyIa0pcGs8KPCLznk1TCxSUSYXim7nI5J1cljhEiK8Yp50kJOzyY= X-Gm-Message-State: AOJu0YzZz+k/RDp+7g9ba7eu80VSDE3JhTKKrUpbPDXjYgUYJ871+dR1 mZzA9uZhXiWInWbXjJpL5zUnN67kobGFR7T7hmBkwdCnZAyvaZZRgX8f72+f+Kd1KNi2ciNvLh6 nbYhcPiDZJaFRlSCZgsg00jzvgVT3Me8v X-Google-Smtp-Source: AGHT+IGfOa5XBgeYIs/cH5TAMCHbRBfIruDizHffdZ+UPyoZ3jK796PR+KziATsAgtd+BnPEgr+Se5nRlYpt X-Received: by 2002:a05:600c:3114:b0:420:2cbe:7ee8 with SMTP id 5b1f17b1804b1-421089f1394mr28435685e9.6.1716575272442; Fri, 24 May 2024 11:27:52 -0700 (PDT) Received: from raspberrypi.com ([188.39.149.98]) by smtp-relay.gmail.com with ESMTPS id ffacd0b85a97d-3557a1cd354sm56646f8f.101.2024.05.24.11.27.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 May 2024 11:27:52 -0700 (PDT) X-Relaying-Domain: raspberrypi.com From: Dave Stevenson To: Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Broadcom internal kernel review list , Ray Jui , Scott Branden , Vinod Koul , Maxime Ripard , Maarten Lankhorst , Thomas Zimmermann , David Airlie , Daniel Vetter , Ulf Hansson , Mark Brown , Christoph Hellwig , Marek Szyprowski , Robin Murphy , Liam Girdwood , Jaroslav Kysela , Takashi Iwai , Vladimir Murzin , Phil Elwell , Stefan Wahren , Serge Semin Cc: devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mmc@vger.kernel.org, linux-spi@vger.kernel.org, iommu@lists.linux.dev, linux-sound@vger.kernel.org, Stefan Wahren , Dave Stevenson Subject: [PATCH 02/18] dmaengine: bcm2835: Support common dma-channel-mask Date: Fri, 24 May 2024 19:26:46 +0100 Message-Id: <20240524182702.1317935-3-dave.stevenson@raspberrypi.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240524182702.1317935-1-dave.stevenson@raspberrypi.com> References: <20240524182702.1317935-1-dave.stevenson@raspberrypi.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240524_112803_927607_0C144DF3 X-CRM114-Status: GOOD ( 16.41 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Stefan Wahren Nowadays there is a generic property for dma-channel-mask in the DMA controller binding. So prefer this one instead of the old vendor specific one. Print a warning in case the old one is used. Btw use the result of of_property_read_u32() as return code in error case. Signed-off-by: Stefan Wahren Signed-off-by: Dave Stevenson --- drivers/dma/bcm2835-dma.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index 9d74fe97452e..528c4593b45a 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -941,12 +941,19 @@ static int bcm2835_dma_probe(struct platform_device *pdev) } /* Request DMA channel mask from device tree */ - if (of_property_read_u32(pdev->dev.of_node, - "brcm,dma-channel-mask", - &chans_available)) { - dev_err(&pdev->dev, "Failed to get channel mask\n"); - rc = -EINVAL; - goto err_no_dma; + rc = of_property_read_u32(pdev->dev.of_node, "dma-channel-mask", + &chans_available); + + if (rc) { + /* Try deprecated property */ + if (of_property_read_u32(pdev->dev.of_node, + "brcm,dma-channel-mask", + &chans_available)) { + dev_err(&pdev->dev, "Failed to get channel mask\n"); + goto err_no_dma; + } + + dev_warn(&pdev->dev, "brcm,dma-channel-mask deprecated - please update DT\n"); } /* get irqs for each channel that we support */