Linux Power Management development
 help / color / mirror / Atom feed
From: Sebastian Reichel <sre@kernel.org>
To: Jun Nie <jun.nie@linaro.org>
Cc: haojian.zhuang@linaro.org, dbaryshkov@gmail.com,
	dwmw2@infradead.org, linux-pm@vger.kernel.org,
	shawn.guo@linaro.org, wan.zhijun@zte.com.cn,
	jason.liu@linaro.org
Subject: Re: [PATCH v2] power/reset: zx: Register restart handler
Date: Mon, 13 Jul 2015 14:00:19 +0200	[thread overview]
Message-ID: <20150713120019.GB9128@earth> (raw)
In-Reply-To: <1436171730-21175-1-git-send-email-jun.nie@linaro.org>

[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]

Hi,

On Mon, Jul 06, 2015 at 04:35:30PM +0800, Jun Nie wrote:
> Register with kernel restart handler instead of setting arm_pm_restart
> directly.
> 
> [...]
>
> +static void __iomem *base;
> +static void __iomem *pcu_base;
> +
> +static int zx_restart_handler(struct notifier_block *this,
> +			      unsigned long mode, void *cmd)
> +{
> +	writel_relaxed(1, base + 0xb0);
> +	writel_relaxed(1, pcu_base + 0x34);
> +
> +	while (1)
> +		cpu_do_idle();

mdelay(some_time);
pr_emerg("Unable to restart system\n");

> +
> +	return NOTIFY_DONE;
> +}
> +
>
> [...]
>
> +static int zx_reboot_probe(struct platform_device *pdev)
> +{
> +	struct device_node *np = pdev->dev.of_node;
> +	int err;
> +
> +	base = of_iomap(np, 0);
> +	if (!base) {
> +		WARN(1, "failed to map base address");
> +		return -ENODEV;
> +	}
> +
> +	np = of_find_compatible_node(NULL, NULL, "zte,zx296702-pcu");
> +	pcu_base = of_iomap(np, 0);
> +	if (!pcu_base) {
> +		iounmap(base);
> +		WARN(1, "failed to map pcu_base address");
> +		return -ENODEV;
> +	}
> +
> +	err = register_restart_handler(&zx_restart_nb);
> +	if (err)
> +		dev_err(&pdev->dev, "Register restart handler failed(err=%d)\n",
> +			err);
> +
> +	return err;
> +}
> +
> +static const struct of_device_id zx_reboot_of_match[] = {
> +	{ .compatible = "zte,sysctrl" },
> +	{}
> +};

Where's the DT Binding Documentation?

> [...]

-- Sebastian

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-07-13 12:00 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-06  8:35 [PATCH v2] power/reset: zx: Register restart handler Jun Nie
2015-07-13 12:00 ` Sebastian Reichel [this message]
2015-07-14  1:42   ` Jun Nie
2015-07-14  6:27     ` Sebastian Reichel

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=20150713120019.GB9128@earth \
    --to=sre@kernel.org \
    --cc=dbaryshkov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=haojian.zhuang@linaro.org \
    --cc=jason.liu@linaro.org \
    --cc=jun.nie@linaro.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=wan.zhijun@zte.com.cn \
    /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