From: Bjorn Andersson <bjorn.andersson@sonymobile.com>
To: Stephen Boyd <sboyd@codeaurora.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: pmic8xxx-pwrkey - Support shutdown
Date: Mon, 13 Jul 2015 16:13:26 -0700 [thread overview]
Message-ID: <20150713231326.GG15178@usrtlx11787.corpusers.net> (raw)
In-Reply-To: <1436231329-17997-1-git-send-email-sboyd@codeaurora.org>
On Mon 06 Jul 18:08 PDT 2015, Stephen Boyd wrote:
> On pm8xxx PMICs, shutdown and restart are signaled to the PMIC
> via a pin called PS_HOLD. When this pin goes low, the PMIC
> performs a configurable power sequence. Add a .shutdown hook so
> that we can properly configure this power sequence for shutdown
> or restart depending on the system state.
>
> Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
> ---
> drivers/input/misc/pmic8xxx-pwrkey.c | 287 ++++++++++++++++++++++++++++++++++-
> 1 file changed, 280 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/input/misc/pmic8xxx-pwrkey.c b/drivers/input/misc/pmic8xxx-pwrkey.c
[..]
>
> /**
> * struct pmic8xxx_pwrkey - pmic8xxx pwrkey information
> * @key_press_irq: key press irq number
> + * @regmap: device regmap
Please also document the shutdown_fn.
> */
> struct pmic8xxx_pwrkey {
> int key_press_irq;
> + struct regmap *regmap;
> + int (*shutdown_fn)(struct pmic8xxx_pwrkey *, bool);
> +};
> +
> +struct pm8xxx_nbs {
> + int (*shutdown_fn)(struct pmic8xxx_pwrkey *, bool);
> };
This struct is unused.
[..]
> static struct platform_driver pmic8xxx_pwrkey_driver = {
> .probe = pmic8xxx_pwrkey_probe,
> .remove = pmic8xxx_pwrkey_remove,
> + .shutdown = pmic8xxx_pwrkey_shutdown,
I tried to find pros/cons of using this approach instead of register a
reboot notifier like I did in the pm8941 driver, but I haven't come up
with any good reason to pick one or the other.
> .driver = {
> .name = "pm8xxx-pwrkey",
> .pm = &pm8xxx_pwr_key_pm_ops,
With above nits I think this looks good.
Regards,
Bjorn
next prev parent reply other threads:[~2015-07-13 23:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 1:08 [PATCH] Input: pmic8xxx-pwrkey - Support shutdown Stephen Boyd
2015-07-13 23:13 ` Bjorn Andersson [this message]
2015-07-13 23:27 ` Stephen Boyd
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=20150713231326.GG15178@usrtlx11787.corpusers.net \
--to=bjorn.andersson@sonymobile.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sboyd@codeaurora.org \
/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