linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Wahren <stefan.wahren@i2se.com>
To: Rob Herring <robh+dt@kernel.org>,
	Nicolas Saenz Julienne <nsaenz@kernel.org>
Cc: Florian Fainelli <f.fainelli@gmail.com>,
	Ray Jui <rjui@broadcom.com>,
	Scott Branden <sbranden@broadcom.com>,
	bcm-kernel-feedback-list@broadcom.com,
	Arnd Bergmann <arnd@arndb.de>, Olof Johansson <olof@lixom.net>,
	soc@kernel.org, Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-watchdog@vger.kernel.org,
	Stefan Wahren <stefan.wahren@i2se.com>
Subject: [PATCH V2 2/7] watchdog: bcm2835_wdt: consider system-power-controller property
Date: Sun,  6 Jun 2021 14:16:12 +0200	[thread overview]
Message-ID: <1622981777-5023-3-git-send-email-stefan.wahren@i2se.com> (raw)
In-Reply-To: <1622981777-5023-1-git-send-email-stefan.wahren@i2se.com>

Until now all Raspberry Pi boards used the power off function of the SoC.
But the Raspberry Pi 400 uses gpio-poweroff for the whole board which
possibly cannot register the poweroff handler because the it's
already registered by this watchdog driver. So consider the
system-power-controller property for registering, which is already
defined in soc/bcm/brcm,bcm2835-pm.txt .

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>
Reviewed-by: Nicolas Saenz Julienne <nsaenz@kernel.org>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/watchdog/bcm2835_wdt.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/drivers/watchdog/bcm2835_wdt.c b/drivers/watchdog/bcm2835_wdt.c
index dec6ca0..9490717 100644
--- a/drivers/watchdog/bcm2835_wdt.c
+++ b/drivers/watchdog/bcm2835_wdt.c
@@ -205,9 +205,13 @@ static int bcm2835_wdt_probe(struct platform_device *pdev)
 	if (err)
 		return err;
 
-	if (pm_power_off == NULL) {
-		pm_power_off = bcm2835_power_off;
-		bcm2835_power_off_wdt = wdt;
+	if (of_device_is_system_power_controller(pdev->dev.parent->of_node)) {
+		if (!pm_power_off) {
+			pm_power_off = bcm2835_power_off;
+			bcm2835_power_off_wdt = wdt;
+		} else {
+			dev_info(dev, "Poweroff handler already present!\n");
+		}
 	}
 
 	dev_info(dev, "Broadcom BCM2835 watchdog timer");
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2021-06-06 12:19 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06 12:16 [PATCH V2 0/7] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
2021-06-06 12:16 ` [PATCH V2 1/7] ARM: dts: bcm283x: Fix up MMC node names Stefan Wahren
2021-06-08 10:07   ` nicolas saenz julienne
2021-06-06 12:16 ` Stefan Wahren [this message]
2021-06-15 21:17   ` [PATCH V2 2/7] watchdog: bcm2835_wdt: consider system-power-controller property Stefan Wahren
2021-06-22  7:12   ` Stefan Wahren
2021-06-28 16:31     ` Guenter Roeck
2021-06-06 12:16 ` [PATCH V2 3/7] ARM: dts: Move BCM2711 RPi specific into separate dtsi Stefan Wahren
2021-06-08 10:08   ` nicolas saenz julienne
2021-06-06 12:16 ` [PATCH V2 4/7] dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema Stefan Wahren
2021-06-08 21:43   ` nicolas saenz julienne
2021-06-06 12:16 ` [PATCH V2 5/7] ARM: dts: bcm283x: Fix up GPIO LED node names Stefan Wahren
2021-06-08 10:08   ` nicolas saenz julienne
2021-06-06 12:16 ` [PATCH V2 6/7] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
2021-06-08 10:08   ` nicolas saenz julienne
2021-06-06 12:16 ` [PATCH V2 7/7] arm64: dts: broadcom: Add reference to RPi 400 Stefan Wahren
2021-06-08 10:09   ` nicolas saenz julienne

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=1622981777-5023-3-git-send-email-stefan.wahren@i2se.com \
    --to=stefan.wahren@i2se.com \
    --cc=arnd@arndb.de \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=f.fainelli@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-rpi-kernel@lists.infradead.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=nsaenz@kernel.org \
    --cc=olof@lixom.net \
    --cc=rjui@broadcom.com \
    --cc=robh+dt@kernel.org \
    --cc=sbranden@broadcom.com \
    --cc=soc@kernel.org \
    --cc=wim@linux-watchdog.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;
as well as URLs for NNTP newsgroup(s).