From patchwork Sun Jun 4 12:12:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13266572 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 4E71AC7EE37 for ; Sun, 4 Jun 2023 12:13:45 +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=YwS1ZaKBB/JNGWsKzbTvFr8r1VgaHcQMDRuaNkE/+aE=; b=DSQFESC4qhN67o tpp79VZZcKqW72yanw+A++4Knxa558dWYxUFWC1JxU95VbJV7HlVRJimC2EWQfFnZY+RnG9e2ncZa aaT7uKVuOgBvaxvw98y4GcHQeegOaH67Q0hN0dGKkoMoKqy4emxC2nFemjlYMaWcbl+HgLzMJAqhK QMur4oUsLwJ0syGXrG4r5nhsi6eGWEWU0NSeHkBQNfYMNagSLMBEtEn03CXZYaLA2n7vKbRUH1LyI +9Iz1c7JVBAuiKkvusBues0plvLHiV+HfHCmWRTNTdXN3PvDw6vUNl9JQftqVB9SI/2wMa+l2qtlI UB3nvjmYQENnorsPJipw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q5mbh-00C6bd-1D; Sun, 04 Jun 2023 12:13:13 +0000 Received: from mout.kundenserver.de ([212.227.17.24]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q5mbb-00C6XE-1N for linux-arm-kernel@lists.infradead.org; Sun, 04 Jun 2023 12:13:10 +0000 Received: from stefanw-SCHENKER ([37.4.248.58]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1Mcp7M-1qffJY2DxK-00Zx5t; Sun, 04 Jun 2023 14:12:42 +0200 From: Stefan Wahren To: Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli , Ray Jui , Scott Branden , Jassi Brar , Thierry Reding , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , "Rafael J. Wysocki" , Daniel Lezcano , Amit Kucheria , Zhang Rui , Thomas Gleixner Cc: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-mmc@vger.kernel.org, linux-pwm@vger.kernel.org, linux-pm@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, Stefan Wahren , John Stultz Subject: [PATCH 02/10] dmaengine: bcm2835: also support generic dma-channel-mask Date: Sun, 4 Jun 2023 14:12:15 +0200 Message-Id: <20230604121223.9625-3-stefan.wahren@i2se.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230604121223.9625-1-stefan.wahren@i2se.com> References: <20230604121223.9625-1-stefan.wahren@i2se.com> MIME-Version: 1.0 X-Provags-ID: V03:K1:KxozCg8oOnQt3q5mPq0HbQmy7gi7fAIS5EtgBua5Q0tEKepPwM4 ThwXX6hVibrvtiDk4KSOo1i5qFwNGWAgDBCECMdgx99Cz2gDbAB22klR7Ok4sC5IRkIUeEM mmTaqvDKrjvtDo4JxaeHOtZaxmXJKxbDLbNa1x5uRrtE11Qm5okqHnknE4MvezqO+3byol4 tHPvCKsEZCFDD4h+F4nDA== UI-OutboundReport: notjunk:1;M01:P0:+kYEE+ZQyz4=;RtH81khKORI85HByj5ZYkPReo/I STW/PQS3ERuAkrJh/N2ZQABRkZDVuLch7HQ6MCtKykWAxd1wELzuk9EplU7RFQ58M59EnCaSu ZEAggFm5MO6eIRKXEekcgRwRJz9Ncsw0z5OKIIlI/LBCAKwezdC3g6mzfR8RdBu/5m3/0Lece kmdPP5dvwhEGlrYO4HfH5z1Fj+qqsnYNZHJohJbVXBGVFOAo9chTmQeR0L0ST3vTYLRFQ+S5J WDkI2UKcbc2wrw1eJ32v+47ub0Y2N5wIuh1U94q5ulMP+wLYO8G/fxWc/tzl3grAdal93CwKZ Ote7f5Jvx9TjWNiJjYMNrPN7wdjy3EjWSAlf6yXXpEYhlmOnHW7CwI/Ob/VX5cgFqmXFEkCbr aPU3w2z7vy/rPYLJ4QEGqThrxQFABDZwn4Ld+MiyrhMlJ/lvFzaN36owiksOSGlOvEzZJvG5h pTLqv36TvzWaxLSndGSbuICmbdHw1wtcDPkvxvUEqklUkPhutcQQTGIyvC9vXTQ//IBgO3Tnb Wi8CX4+LaqRpcEUeYbwp9/UvsRV8UZuZXjWUwOlq/yBqMPzfJ7Nkp1vGah+kDKi1T0Ea8sLNn +cZ2rio0AAizNtEACKzu2NC5Pg3SEJvNpSGXkmm5rxf0u//UcAfndWokWSk2GqprNrWyKdbIL Ry+CFeqzsNb1afwQbjZr2jLgFaHlMkaqS2QSgtxP3g== X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230604_051307_771980_C25342F0 X-CRM114-Status: GOOD ( 17.15 ) 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 Since commit e2d896c08ca3 ("Documentation: bindings: dma: Add binding for dma-channel-mask") there is a generic property to list available DMA channels for the kernel to use. The generic property has been implemented by some other platforms. So implement support for the generic one and consider the vendor specific one as deprecated. This also simplifies the YAML conversion of the BCM2835 DMA DT bindings a little bit. Cc: John Stultz Signed-off-by: Stefan Wahren --- drivers/dma/bcm2835-dma.c | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c index 0807fb9eb262..a0573977a373 100644 --- a/drivers/dma/bcm2835-dma.c +++ b/drivers/dma/bcm2835-dma.c @@ -941,12 +941,18 @@ 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; + if (of_property_read_u32(pdev->dev.of_node, "dma-channel-mask", + &chans_available)) { + 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; + } else { + dev_warn(&pdev->dev, + "brcm,dma-channel-mask is deprecated, update your device-tree\n"); + } } /* get irqs for each channel that we support */