From: Roger Quadros <rogerq@ti.com>
To: Peter Chen <peter.chen@nxp.com>, <myungjoo.ham@samsung.com>,
<cw00.choi@samsung.com>
Cc: <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/1] extcon: usb-gpio: add pinctrl operation during system PM
Date: Tue, 3 Jan 2017 11:57:19 +0200 [thread overview]
Message-ID: <ee98009c-0bfe-e19f-e5cc-c2342d08afae@ti.com> (raw)
In-Reply-To: <1483431473-24813-1-git-send-email-peter.chen@nxp.com>
Hi Peter,
On 03/01/17 10:17, Peter Chen wrote:
> At some systems, the pinctrl setting will be lost or needs to
> set as "sleep" state to save power consumption. So, we need to
> configure pinctrl as "sleep" state when system enters suspend,
> and as "default" state after system resumes. In this way, the
> pinctrl value can be recovered as "default" state after resuming.
>
> Signed-off-by: Peter Chen <peter.chen@nxp.com>
> ---
> drivers/extcon/extcon-usb-gpio.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c
> index d589c5f..f7172ae 100644
> --- a/drivers/extcon/extcon-usb-gpio.c
> +++ b/drivers/extcon/extcon-usb-gpio.c
> @@ -244,6 +244,7 @@ static int usb_extcon_suspend(struct device *dev)
> disable_irq(info->id_irq);
> if (info->vbus_gpiod)
> disable_irq(info->vbus_irq);
> + pinctrl_pm_select_sleep_state(dev);
>
> return ret;
> }
> @@ -253,6 +254,7 @@ static int usb_extcon_resume(struct device *dev)
> struct usb_extcon_info *info = dev_get_drvdata(dev);
> int ret = 0;
>
> + pinctrl_pm_select_default_state(dev);
> if (device_may_wakeup(dev)) {
> if (info->id_gpiod) {
> ret = disable_irq_wake(info->id_irq);
>
How does this work if wake from suspend is desired?
pinctrl sleep state might not support wakeup.
cheers,
-roger
next prev parent reply other threads:[~2017-01-03 9:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-03 8:17 Peter Chen
2017-01-03 9:57 ` Roger Quadros [this message]
2017-01-04 6:43 ` Peter Chen
2017-01-03 14:55 ` kbuild test robot
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=ee98009c-0bfe-e19f-e5cc-c2342d08afae@ti.com \
--to=rogerq@ti.com \
--cc=cw00.choi@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=myungjoo.ham@samsung.com \
--cc=peter.chen@nxp.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
Powered by JetHome