From: Daniel Mack <daniel@zonque.org>
To: Matt Ranostay <mranostay@gmail.com>, dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org
Subject: Re: [PATCH RESEND v4] cap11xx: add runtime PM support
Date: Fri, 2 Oct 2015 16:38:00 +0200 [thread overview]
Message-ID: <560E96C8.3060507@zonque.org> (raw)
In-Reply-To: <1443763140-16368-2-git-send-email-mranostay@gmail.com>
On 10/02/2015 07:19 AM, Matt Ranostay wrote:
> Puts device into DEEP SLEEP when no LEDs are in in the on-state, and no
> input_handlers are in use. Also uses *_autosuspend to prevent a LED
> trigger from constantly suspending and resuming device.
>
> Signed-off-by: Matt Ranostay <mranostay@gmail.com>
> ---
> drivers/input/keyboard/cap11xx.c | 84 +++++++++++++++++++++++++++++++---------
> 1 file changed, 65 insertions(+), 19 deletions(-)
>
...
> +static void cap11xx_shutdown_act(void *data)
> +{
> + struct i2c_client *i2c_client = data;
> + struct cap11xx_priv *priv = i2c_get_clientdata(i2c_client);
> +
> + cap11xx_set_sleep(priv, true);
> + pm_runtime_disable(&i2c_client->dev);
> + pm_runtime_set_suspended(&i2c_client->dev);
> +}
> +
> static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
> const struct i2c_device_id *id)
> {
> @@ -363,6 +374,14 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client,
> if (IS_ERR(priv->regmap))
> return PTR_ERR(priv->regmap);
>
> + error = devm_add_action(dev, cap11xx_shutdown_act, i2c_client);
Why not implement cap11xx_i2c_driver.remove or .shutdown for this?
Otherwise, this looks good to me.
Thanks,
Daniel
next prev parent reply other threads:[~2015-10-02 14:38 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-02 5:18 [PATCH RESEND v4] cap11xx: add runtime PM support Matt Ranostay
2015-10-02 5:19 ` Matt Ranostay
2015-10-02 14:38 ` Daniel Mack [this message]
2015-10-02 17:11 ` Matt Ranostay
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=560E96C8.3060507@zonque.org \
--to=daniel@zonque.org \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=mranostay@gmail.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.