linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Haojian Zhuang <haojian.zhuang@linaro.org>
To: Jun Nie <jun.nie@linaro.org>
Cc: linus.walleij@linaro.org, linux-gpio@vger.kernel.org,
	tony@atomide.com, shawn.guo@linaro.org, wan.zhijun@zte.com.cn,
	jason.liu@linaro.org
Subject: Re: [PATCH] power/reset: zx: Register restart handler
Date: Mon, 29 Jun 2015 14:32:05 +0800	[thread overview]
Message-ID: <1435559525.1744.6.camel@linaro.org> (raw)
In-Reply-To: <1435547191-18405-1-git-send-email-jun.nie@linaro.org>

On Mon, 2015-06-29 at 11:06 +0800, Jun Nie wrote:
> Register with kernel restart handler instead of setting arm_pm_restart
> directly.
> 
> Signed-off-by: Jun Nie <jun.nie@linaro.org>
> ---
>  drivers/power/reset/Kconfig     |  7 ++++
>  drivers/power/reset/Makefile    |  1 +
>  drivers/power/reset/zx-reboot.c | 79 +++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 87 insertions(+)
>  create mode 100644 drivers/power/reset/zx-reboot.c
> 
> diff --git a/drivers/power/reset/zx-reboot.c b/drivers/power/reset/zx-reboot.c
> new file mode 100644
> index 0000000..fbfee0b
> --- /dev/null
> +++ b/drivers/power/reset/zx-reboot.c
> @@ -0,0 +1,79 @@
> +/*
> + * ZTE zx296702 SoC reset code
> + *
> + * Copyright (c) 2015 Linaro Ltd.
> + *
> + * Author: Jun Nie <jun.nie@linaro.org>
> + *
> + * This program is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License version 2 as
> + * published by the Free Software Foundation.
> + */
> +
> +#include <linux/delay.h>
> +#include <linux/io.h>
> +#include <linux/module.h>
> +#include <linux/notifier.h>
> +#include <linux/of_address.h>
> +#include <linux/platform_device.h>
> +#include <linux/reboot.h>
> +
> +#include <asm/proc-fns.h>
> +
> +static void __iomem *base;
> +
> +static int zx_restart_handler(struct notifier_block *this,
> +			      unsigned long mode, void *cmd)
> +{
> +	struct device_node *np;
> +	void __iomem *pcu_base;
> +
> +	np = of_find_compatible_node(NULL, NULL, "zte,zx296702-pcu");
> +	pcu_base = of_iomap(np, 0);

Why not move these above code into zx_reboot_probe()? And you can check
the value of pcu_base at there.



      reply	other threads:[~2015-06-29  6:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-29  3:06 [PATCH] power/reset: zx: Register restart handler Jun Nie
2015-06-29  6:32 ` Haojian Zhuang [this message]

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=1435559525.1744.6.camel@linaro.org \
    --to=haojian.zhuang@linaro.org \
    --cc=jason.liu@linaro.org \
    --cc=jun.nie@linaro.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=tony@atomide.com \
    --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;
as well as URLs for NNTP newsgroup(s).