Linux PWM subsystem development
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: "Vinod Koul" <vkoul@kernel.org>,
	"Rob Herring" <robh+dt@kernel.org>,
	"Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>,
	"Conor Dooley" <conor+dt@kernel.org>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Ray Jui" <rjui@broadcom.com>,
	"Scott Branden" <sbranden@broadcom.com>,
	"Jassi Brar" <jassisinghbrar@gmail.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	"Daniel Lezcano" <daniel.lezcano@linaro.org>,
	"Amit Kucheria" <amitk@kernel.org>,
	"Zhang Rui" <rui.zhang@intel.com>,
	"Thomas Gleixner" <tglx@linutronix.de>
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 <stefan.wahren@i2se.com>,
	John Stultz <john.stultz@linaro.org>
Subject: [PATCH 02/10] dmaengine: bcm2835: also support generic dma-channel-mask
Date: Sun,  4 Jun 2023 14:12:15 +0200	[thread overview]
Message-ID: <20230604121223.9625-3-stefan.wahren@i2se.com> (raw)
In-Reply-To: <20230604121223.9625-1-stefan.wahren@i2se.com>

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 <john.stultz@linaro.org>
Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
---
 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 */
-- 
2.34.1


  parent reply	other threads:[~2023-06-04 12:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-04 12:12 [PATCH 00/10] ARM: dts: bcm283x: Improve device-trees and bindings Stefan Wahren
2023-06-04 12:12 ` [PATCH 01/10] ARM: dts: bcm283x: Fix pinctrl groups Stefan Wahren
2023-06-04 12:12 ` Stefan Wahren [this message]
2023-06-10 10:52   ` [PATCH 02/10] dmaengine: bcm2835: also support generic dma-channel-mask Stefan Wahren
2023-06-04 12:12 ` [PATCH 03/10] dt-bindings: dma: convert bcm2835-dma bindings to YAML Stefan Wahren
2023-06-09 21:48   ` Rob Herring
2023-06-04 12:12 ` [PATCH 04/10] ARM: dts: bcm2835: adjust DMA nodes Stefan Wahren
2023-06-09 21:54   ` Rob Herring
2023-06-04 12:12 ` [PATCH 05/10] dt-bindings: pwm: convert pwm-bcm2835 bindings to YAML Stefan Wahren
2023-06-07  7:56   ` Uwe Kleine-König
2023-06-09 21:59     ` Rob Herring
2023-06-13  9:02       ` Stefan Wahren
2023-06-13  9:30         ` Uwe Kleine-König
2023-06-09 21:55   ` Rob Herring
2023-06-04 12:12 ` [PATCH 06/10] ARM: dts: bcm283x: Increase pwm-cells Stefan Wahren
2023-06-07  7:56   ` Uwe Kleine-König
2023-06-04 12:12 ` [PATCH 07/10] dt-bindings: mailbox: convert bcm2835-mbox bindings to YAML Stefan Wahren
2023-06-09 21:56   ` Rob Herring
2023-06-04 12:12 ` [PATCH 08/10] dt-bindings: mmc: convert bcm2835-sdhost " Stefan Wahren
2023-06-09 21:56   ` Rob Herring
2023-06-12 14:16   ` Ulf Hansson
2023-06-04 12:12 ` [PATCH 09/10] dt-bindings: thermal: convert bcm2835-thermal " Stefan Wahren
2023-06-09 21:59   ` Rob Herring
2023-06-13  8:25   ` Daniel Lezcano
2023-06-04 12:12 ` [PATCH 10/10] dt-bindings: timer: convert bcm2835-system-timer " Stefan Wahren
2023-06-09 22:00   ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230604121223.9625-3-stefan.wahren@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=amitk@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel.lezcano@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dmaengine@vger.kernel.org \
    --cc=florian.fainelli@broadcom.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=john.stultz@linaro.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=rui.zhang@intel.com \
    --cc=sbranden@broadcom.com \
    --cc=tglx@linutronix.de \
    --cc=thierry.reding@gmail.com \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=vkoul@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox