lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <HE1PR04MB1450F391B7E253626AE0AFA08B610@HE1PR04MB1450.eurprd04.prod.outlook.com>
Date:   Wed, 4 Jan 2017 06:43:50 +0000
From:   Peter Chen <peter.chen@....com>
To:     Roger Quadros <rogerq@...com>,
        "myungjoo.ham@...sung.com" <myungjoo.ham@...sung.com>,
        "cw00.choi@...sung.com" <cw00.choi@...sung.com>
CC:     "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/1] extcon: usb-gpio: add pinctrl operation during system
 PM

 
>
>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@....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.
>

Oh, yes. I should consider wakeup condition. For GPIO pins,
if wakeup is requested by user, the pinctrl should NOT in
sleep state.

Peter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ