From: Heikki Krogerus <heikki.krogerus@linux.intel.com>
To: Ajay Gupta <ajaykuee@gmail.com>
Cc: wsa@the-dreams.de, linux-usb@vger.kernel.org,
linux-i2c@vger.kernel.org, Ajay Gupta <ajayg@nvidia.com>
Subject: Re: [PATCH v2 3/5] usb: typec: ucsi: ccg: enable runtime pm support
Date: Tue, 21 May 2019 16:37:27 +0300 [thread overview]
Message-ID: <20190521133727.GK1887@kuha.fi.intel.com> (raw)
In-Reply-To: <20190520183750.2932-4-ajayg@nvidia.com>
Hi,
On Mon, May 20, 2019 at 11:37:48AM -0700, Ajay Gupta wrote:
> +static int ucsi_ccg_resume(struct device *dev)
> +{
> + struct i2c_client *client = to_i2c_client(dev);
> + struct ucsi_ccg *uc = i2c_get_clientdata(client);
> + struct ucsi *ucsi = uc->ucsi;
> + struct ucsi_control c;
> + int ret;
> +
> + /* restore UCSI notification enable mask */
> + UCSI_CMD_SET_NTFY_ENABLE(c, UCSI_ENABLE_NTFY_ALL);
> + ret = ucsi_send_command(ucsi, &c, NULL, 0);
> + if (ret < 0) {
> + dev_err(uc->dev, "%s: failed to set notification enable - %d\n",
> + __func__, ret);
> + }
> + return 0;
> +}
I would prefer that we did this for all methods in ucsi.c, not just
ccgx. Could you add resume callback to struct ucsi_ppm, and then call
it here.
> +static int ucsi_ccg_runtime_suspend(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static int ucsi_ccg_runtime_resume(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static int ucsi_ccg_runtime_idle(struct device *dev)
> +{
> + return 0;
> +}
> +
> +static const struct dev_pm_ops ucsi_ccg_pm = {
> + .suspend = ucsi_ccg_suspend,
> + .resume = ucsi_ccg_resume,
> + .runtime_suspend = ucsi_ccg_runtime_suspend,
> + .runtime_resume = ucsi_ccg_runtime_resume,
> + .runtime_idle = ucsi_ccg_runtime_idle,
> +};
> +
> static struct i2c_driver ucsi_ccg_driver = {
> .driver = {
> .name = "ucsi_ccg",
> + .pm = &ucsi_ccg_pm,
> },
> .probe = ucsi_ccg_probe,
> .remove = ucsi_ccg_remove,
thanks,
--
heikki
next prev parent reply other threads:[~2019-05-21 13:37 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-20 18:37 [PATCH v2 0/5] usb: typec: ucsi: ccg: add runtime pm support Ajay Gupta
2019-05-20 18:37 ` [PATCH v2 1/5] i2c: nvidia-gpu: refactor master_xfer Ajay Gupta
2019-05-20 18:37 ` [PATCH v2 2/5] i2c: nvidia-gpu: add runtime pm support Ajay Gupta
2019-05-20 18:37 ` [PATCH v2 3/5] usb: typec: ucsi: ccg: enable " Ajay Gupta
2019-05-21 13:37 ` Heikki Krogerus [this message]
2019-05-21 13:49 ` Heikki Krogerus
2019-05-21 17:44 ` Ajay Gupta
2019-05-22 11:12 ` Heikki Krogerus
2019-05-20 18:37 ` [PATCH v2 4/5] i2c: nvidia-gpu: resume ccgx i2c client Ajay Gupta
2019-05-20 18:37 ` [PATCH v2 5/5] usb: typec: ucsi: ccg: add runtime pm workaround Ajay Gupta
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=20190521133727.GK1887@kuha.fi.intel.com \
--to=heikki.krogerus@linux.intel.com \
--cc=ajayg@nvidia.com \
--cc=ajaykuee@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=wsa@the-dreams.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;
as well as URLs for NNTP newsgroup(s).