linux-watchdog.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: Stefan Wahren <stefan.wahren@i2se.com>
Cc: Rob Herring <robh+dt@kernel.org>,
	Nicolas Saenz Julienne <nsaenz@kernel.org>,
	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>,
	devicetree@vger.kernel.org, linux-rpi-kernel@lists.infradead.org,
	linux-arm-kernel@lists.infradead.org,
	linux-watchdog@vger.kernel.org
Subject: Re: [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property
Date: Wed, 2 Jun 2021 03:37:58 -0700	[thread overview]
Message-ID: <20210602103758.GA1865238@roeck-us.net> (raw)
In-Reply-To: <1622366775-5309-3-git-send-email-stefan.wahren@i2se.com>

On Sun, May 30, 2021 at 11:26:11AM +0200, Stefan Wahren wrote:
> 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: 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
> 

  reply	other threads:[~2021-06-02 10:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-30  9:26 [PATCH 0/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
2021-05-30  9:26 ` [PATCH 1/6] ARM: dts: bcm283x: Fix up MMC node names Stefan Wahren
2021-05-30  9:26 ` [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property Stefan Wahren
2021-06-02 10:37   ` Guenter Roeck [this message]
     [not found]   ` <e61ba6f5b906fd26a61e9c79ef4dcf4792a364d7.camel@kernel.org>
2021-06-02 10:40     ` Guenter Roeck
2021-05-30  9:26 ` [PATCH 3/6] ARM: dts: Move BCM2711 RPi specific into separate dtsi Stefan Wahren
     [not found]   ` <86a7cded6e3e17b0ab347e55b38a44e10bc4e46a.camel@kernel.org>
2021-06-01 18:51     ` Stefan Wahren
2021-05-30  9:26 ` [PATCH 4/6] dt-bindings: arm: bcm2835: Add Raspberry Pi 400 to DT schema Stefan Wahren
2021-06-04 21:31   ` Rob Herring
2021-05-30  9:26 ` [PATCH 5/6] ARM: dts: Add Raspberry Pi 400 support Stefan Wahren
2021-05-30  9:26 ` [PATCH 6/6] arm64: dts: broadcom: Add reference to RPi 400 Stefan Wahren

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=20210602103758.GA1865238@roeck-us.net \
    --to=linux@roeck-us.net \
    --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=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=stefan.wahren@i2se.com \
    --cc=wim@linux-watchdog.org \
    --subject='Re: [PATCH 2/6] watchdog: bcm2835_wdt: consider system-power-controller property' \
    /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

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).