devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Sébastien SZYMANSKI" <sebastien.szymanski@armadeus.com>
To: Stefan Wahren <stefan.wahren@i2se.com>,
	Sebastian Reichel <sre@kernel.org>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, Marek Vasut <marex@denx.de>,
	Pawel Moll <pawel.moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	David Woodhouse <dwmw2@infradead.org>,
	linux-pm@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Sascha Hauer <kernel@pengutronix.de>,
	Kumar Gala <galak@codeaurora.org>,
	Shawn Guo <shawn.guo@linaro.org>,
	Fabio Estevam <festevam@gmail.com>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH RFC 2/3] power: mxs_power: add driver for mxs power subsystem
Date: Thu, 22 Jan 2015 10:37:33 +0100	[thread overview]
Message-ID: <54C0C4DD.2040302@armadeus.com> (raw)
In-Reply-To: <54C0AFE4.3020701@i2se.com>

Hello,

On 01/22/2015 09:08 AM, Stefan Wahren wrote:
> 
> In the meantime i made some bugfixes on these patches. Now i think it
> would be better to integrate the on-chip regulator driver into the patch
> series. That would clarify the function of the power driver.
> 

I was about to resend this series with a poweroff driver for the imx28
SoCs. Should I wait this series get merged?

I thought adding a poweroff child node like this:

power: power@80044000 {
	...
	poweroff: poweroff@80044100 {
		compatible = "fsl,imx28-poweroff";
		reg = <0x80044100 0x10>;
	};
	...
};

Here is the driver:

/*
 * MXS SoCs reset code.
 *
 * Copyright (c) 2015 Armadeus Systems.
 *
 * Author: Sébastien Szymanski <sebastien.szymanski@armadeus.com>
 *
 * based on imx-snvs-poweroff.c
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
 * only version 2 as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 */

#include <linux/err.h>
#include <linux/init.h>
#include <linux/io.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/of.h>
#include <linux/of_address.h>
#include <linux/platform_device.h>

#define MXS_SET_ADDR                    0x4

#define POWER_RESET_UNLOCK__KEY         (0x3E77 << 16)
#define POWER_RESET_PWD                 0x1

static void __iomem *power_reset;

static void do_mxs_poweroff(void)
{
        writel(POWER_RESET_UNLOCK__KEY | POWER_RESET_PWD,
               power_reset + MXS_SET_ADDR);
}

static int mxs_poweroff_probe(struct platform_device *pdev)
{
        power_reset = of_iomap(pdev->dev.of_node, 0);
        if (!power_reset) {
                dev_err(&pdev->dev, "failed to get memory\n");
                return -ENODEV;
        }

        pm_power_off = do_mxs_poweroff;

        dev_info(&pdev->dev, "power off function set!\n");

        return 0;
}

static const struct of_device_id of_mxs_poweroff_match[] = {
        { .compatible = "fsl,imx28-poweroff", },
        {},
};
MODULE_DEVICE_TABLE(of, of_mxs_poweroff_match);

static struct platform_driver mxs_poweroff_driver = {
        .probe = mxs_poweroff_probe,
        .driver = {
                .name = "mxs-poweroff",
                .of_match_table = of_match_ptr(of_mxs_poweroff_match),
        },
};

static int __init mxs_poweroff_init(void)
{
        return platform_driver_register(&mxs_poweroff_driver);
}
device_initcall(mxs_poweroff_init);

Best Regards,

-- 
Sébastien SZYMANSKI
Software Engineer
Armadeus Systems - A new vision of the embedded world
sebastien.szymanski@armadeus.com
Tel: +33 (0)9 72 29 41 44
Fax: +33 (0)9 72 28 79 26

  reply	other threads:[~2015-01-22  9:37 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-20 20:14 [PATCH RFC 0/3] power: mxs_power: add driver for mxs power subsystem Stefan Wahren
2014-11-20 20:14 ` [PATCH RFC 1/3] DT: add binding " Stefan Wahren
2014-11-20 20:14 ` [PATCH RFC 2/3] power: mxs_power: add driver " Stefan Wahren
2015-01-21 23:01   ` Sebastian Reichel
2015-01-22  8:08     ` Stefan Wahren
2015-01-22  9:37       ` Sébastien SZYMANSKI [this message]
2015-01-22  9:48         ` Stefan Wahren
     [not found]       ` <54C0AFE4.3020701-eS4NqCHxEME@public.gmane.org>
2015-01-25 15:04         ` Sebastian Reichel
     [not found]           ` <20150125150431.GE2719-SfvFxonMDyemK9LvCR3Hrw@public.gmane.org>
2015-01-26 19:46             ` Stefan Wahren
2015-01-27  0:16               ` Mark Brown
2015-01-27 18:35                 ` Stefan Wahren
     [not found]                   ` <1954124242.301697.1422383709733.JavaMail.open-xchange-h4m1HHXQYNE54XbDmwzAWMgmgJlYmuWJ@public.gmane.org>
2015-01-27 19:43                     ` Mark Brown
2015-01-28 22:22                       ` Stefan Wahren
2015-01-28 22:59                         ` Sebastian Reichel
     [not found]                           ` <20150128225937.GA12749-SfvFxonMDyemK9LvCR3Hrw@public.gmane.org>
2015-02-03 20:41                             ` Stefan Wahren
2015-02-20 10:57                               ` Stefan Wahren
     [not found]                                 ` <1766258118.893447.1424429861770.JavaMail.open-xchange-h4m1HHXQYNGvCDav5jC2oMgmgJlYmuWJ@public.gmane.org>
2015-02-23 15:38                                   ` Sebastian Reichel
2015-02-26 19:20                                     ` Stefan Wahren
2014-11-20 20:14 ` [PATCH RFC 3/3] ARM: dts: enable power subsystem for i.MX28 Stefan Wahren
2014-11-20 21:32   ` Fabio Estevam
2014-11-20 22:57     ` Stefan Wahren
2014-11-21 13:55       ` Fabio Estevam
2014-11-26 10:26 ` [PATCH RFC 0/3] power: mxs_power: add driver for mxs power subsystem 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=54C0C4DD.2040302@armadeus.com \
    --to=sebastien.szymanski@armadeus.com \
    --cc=dbaryshkov@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dwmw2@infradead.org \
    --cc=festevam@gmail.com \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=marex@denx.de \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=sre@kernel.org \
    --cc=stefan.wahren@i2se.com \
    /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).