Re: [PATCH] power/reset: zx: Register restart handler

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
> ---
>  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@xxxxxxxxxx>
> + *
> + * 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.


--
To unsubscribe from this list: send the line "unsubscribe linux-gpio" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux