From: Andrew Morton <akpm@linux-foundation.org>
To: Oleksij Rempel <o.rempel@pengutronix.de>
Cc: linux@rempel-privat.de, kernel@pengutronix.de,
linux-arm-kernel@lists.infradead.org,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 5/6] regulator: pfuze100-regulator: provide pm_power_off_prepare handler
Date: Wed, 31 May 2017 13:59:42 -0700 [thread overview]
Message-ID: <20170531135942.20a72fe106667791e874fb20@linux-foundation.org> (raw)
In-Reply-To: <20170531061457.23744-6-o.rempel@pengutronix.de>
On Wed, 31 May 2017 08:14:56 +0200 Oleksij Rempel <o.rempel@pengutronix.de> wrote:
> On some boards the SoC can use one pin "PMIC_STBY_REQ" to notify th PMIC
> about state changes. In this case internal state of PMIC must be
> preconfigured for upcomming state change.
> It works fine with the current regulator framework, except with the
> power-off case.
>
> This patch is providing an optional pm_power_off_prepare handler
> which will configure the PMIC_StandBy state to disable all power lines.
>
> In my power consumption test on RIoTBoard, I got the following results:
> poweroff without this patch: 320 mA
> poweroff with this patch: 2 mA
> suspend to ram: 40 mA
>
> ...
>
> +static int pfuze_poweroff_pre_init(struct pfuze_chip *pfuze_chip)
> +{
> + if (pfuze_chip->chip_id != PFUZE100) {
> + dev_warn(pfuze_chip->dev, "Requested pm_power_off_prepare handler for not supoorted chip\n");
> + return -ENODEV;
> + }
> +
> + if (pm_power_off_prepare) {
> + dev_warn(pfuze_chip->dev, "pm_power_off_prepare is already registred.\n");
> + return -EBUSY;
> + }
> +
> + syspm_pfuze_chip = pfuze_chip;
> + pm_power_off_prepare = pfuze_poweroff_pre;
> +
> + return 0;
> +}
> +
Ah, there it is.
This looks a bit dodgy. What happens after someone does rmmod on this
driver?
(typo in comment: "supoorted")
(I wish we could get "poweroff" and "power_off" consistent)
next prev parent reply other threads:[~2017-05-31 20:59 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-31 6:14 [PATCH v2 0/6] iMX6: Implement power off over standby signal Oleksij Rempel
2017-05-31 6:14 ` [PATCH v2 1/6] ARM: imx6q: provide documentation for new fsl,pmic_stby_poweroff property Oleksij Rempel
2017-05-31 14:52 ` Mark Rutland
2017-06-01 6:50 ` Oleksij Rempel
2017-05-31 6:14 ` [PATCH v2 2/6] ARM: imx6: register pm_power_off handler if "fsl,pmic_stby_poweroff" is set Oleksij Rempel
2017-05-31 14:55 ` Mark Rutland
2017-05-31 6:14 ` [PATCH v2 3/6] kernel/reboot.c: export pm_power_off_prepare Oleksij Rempel
2017-05-31 20:54 ` Andrew Morton
2017-05-31 6:14 ` [PATCH v2 4/6] regulator: pfuze100: add fsl,pmic_stby_poweroff property Oleksij Rempel
2017-05-31 14:44 ` Mark Brown
2017-05-31 14:55 ` Oleksij Rempel
2017-05-31 15:56 ` Mark Brown
2017-05-31 14:56 ` Mark Rutland
2017-05-31 6:14 ` [PATCH v2 5/6] regulator: pfuze100-regulator: provide pm_power_off_prepare handler Oleksij Rempel
2017-05-31 20:59 ` Andrew Morton [this message]
2017-06-01 6:19 ` Oleksij Rempel
2017-05-31 6:14 ` [PATCH v2 6/6] ARM: dts: imx6: RIoTboard provide Standby to PowerOff option Oleksij Rempel
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=20170531135942.20a72fe106667791e874fb20@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=broonie@kernel.org \
--cc=kernel@pengutronix.de \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@rempel-privat.de \
--cc=o.rempel@pengutronix.de \
/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
all inboxes | Powered by JetHome®