From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757084Ab3LWH4z (ORCPT ); Mon, 23 Dec 2013 02:56:55 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:11425 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750877Ab3LWH4y (ORCPT ); Mon, 23 Dec 2013 02:56:54 -0500 X-AuditID: cbfee68f-b7f156d00000276c-0a-52b7ecc4ee6f Message-id: <52B7ECC7.8020508@samsung.com> Date: Mon, 23 Dec 2013 16:56:55 +0900 From: Chanwoo Choi User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130106 Thunderbird/17.0.2 MIME-version: 1.0 To: Barry Song <21cnbao@gmail.com> Cc: rjying , MyungJoo Ham , LKML , RongJun Ying , Binghua Duan Subject: Re: [PATCH 1/1] extcon: gpio: Add power resume support References: <1387526987-12455-1-git-send-email-rongjun.ying@csr.com> <52B7B9F0.1020801@samsung.com> <52B7D990.2020206@samsung.com> In-reply-to: Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrGIsWRmVeSWpSXmKPExsWyRsSkRPfIm+1BBtc/Kll8vitk0dCwg9Hi 8q45bBa3G1ewWdzqPcBsse/CH1YHNo9dO+eweuycdZfdo2/LKkaPz5vkAliiuGxSUnMyy1KL 9O0SuDKOzZ/CWnBMsWLW5xVsDYzHpLoYOTkkBEwk7p/6wA5hi0lcuLeerYuRi0NIYCmjxIGX vxhhim60PIJKLGKU6Hy1iRnCecUoceznW1aQKl4BLYmjdx+wgdgsAqoSPz6fZgGx2YDi+1/c AIuLCoRJrJx+hQWiXlDix+R7YLaIgJLE5KnfWECGMgvsZJTYf3cr2FBhAXuJlR8XMUJsm8Ik Mf3Qb7BJnALBEteuTAO7j1lAXWLSvEXMELa8xOY1b8HOkxDYxy4xo6GbGeIkAYlv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2C2cLEwSnVwOg6l31GKesEoweLPpTYrWoLbrj6 /5aw5eKHSnyHDlw31y/Vu5t7cfvrNdlKVqmLjQ5qTvEO3exgY/Cp0ljU46Or2TlxRn9fuyfx mhwpgmmssRF1mzzvHl10Vev9/Xy+jfP4dewLdtiW90cLmglV3Os1OFPa6VHNaOhyINR1VZGV /WZt0Z2/lFiKMxINtZiLihMBXmOzxiYDAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/23/2013 04:36 PM, Barry Song wrote: > 2013/12/23 Chanwoo Choi : >> On 12/23/2013 03:10 PM, Barry Song wrote: >>> 2013/12/23 Chanwoo Choi : >>>> On 12/20/2013 05:09 PM, rjying wrote: >>>>> From: Rongjun Ying >>>>> >>>>> After system resume, need send extcon uevent to userspace >>>> >>>> Why did extcon send uevent after wakeup from suspend? >>>> >>>> If extcon cable is attatched or detached on suspend state, >>>> Kernel can detect the interrupt about changed state of extcon. >>> >>> irq controller has lost power in suspend, so there is no pending interrupt. >>> and HW will not pend any interrupt when we hotplug cable during sleep. >> >> No, SoC in suspend state must maintain the minimum power under 1mA >> if completed the power-optimization on suspend state. >> >> If user insert USB cable to target, the external interrupt connected to >> USB port is happened. And kernel would be waked up from suspend state >> to operate proper interrupt handler of external interrupt. > > no. not every USB supports that. that depends on the power domain design of SoC. USB is only example for gpio control in suspend state. > >> >> Also, >> Input subsystem used gpio-keys driver for power button.. >> If user press power button in suspend state, target would be waked up from suspend state. >> It is same case both extcon gpio and gpio-keys of input subsystem. > > no. it depends on the SoC design. many SoC only support 1 special key > which can work as ON-KEY as wakeup source. and this kind of keys might > not be GPIO at all. > there is a special power domain which is still open for it. many SoC? As I knew, most SoC has supported various wakeup source. As you comment, if specific SoC support only one special key for wakeup from suspend state, I think it isn't common. Also, This patch isn't necessary on SoCs which support various wakeup source (e.g., external interrupt). As you comment, this issue has dependecy on specific SoC. Why did you think this common code? > >> >>> >>>> So, kernel would execute proper operation about interrupt >>>> after wakeup from suspend state. >>> >>> kernel only save/restore the register status of gpio, how could it >>> know whether there is a pending interrupt if the HW doesn't do it? >>> >>>> >>>> I think it isn't necessary. >>>> >>>> Thanks, >>>> Chanwoo Choi >>>> >>>>> >>>>> Change-Id: I32a9e1c6646035f95765bba79a7acaccb8ce45a7 >>>>> >>>>> Signed-off-by: Rongjun Ying >>>>> --- >>>>> drivers/extcon/extcon-gpio.c | 17 +++++++++++++++++ >>>>> 1 files changed, 17 insertions(+), 0 deletions(-) >>>>> >>>>> diff --git a/drivers/extcon/extcon-gpio.c b/drivers/extcon/extcon-gpio.c >>>>> index 7e0dff5..d916522 100644 >>>>> --- a/drivers/extcon/extcon-gpio.c >>>>> +++ b/drivers/extcon/extcon-gpio.c >>>>> @@ -159,12 +159,29 @@ static int gpio_extcon_remove(struct platform_device *pdev) >>>>> return 0; >>>>> } >>>>> >>>>> +#ifdef CONFIG_PM_SLEEP >>>>> +static int gpio_extcon_resume(struct device *dev) >>>>> +{ >>>>> + struct gpio_extcon_data *extcon_data; >>>>> + >>>>> + extcon_data = dev_get_drvdata(dev); >>>>> + queue_delayed_work(system_power_efficient_wq, &extcon_data->work, >>>>> + extcon_data->debounce_jiffies); >>>>> + return 0; >>>>> +} >>>>> +#endif >>>>> + >>>>> +static const struct dev_pm_ops gpio_extcon_pm_ops = { >>>>> + SET_SYSTEM_SLEEP_PM_OPS(NULL, gpio_extcon_resume) >>>>> +}; >>>>> + >>>>> static struct platform_driver gpio_extcon_driver = { >>>>> .probe = gpio_extcon_probe, >>>>> .remove = gpio_extcon_remove, >>>>> .driver = { >>>>> .name = "extcon-gpio", >>>>> .owner = THIS_MODULE, >>>>> + .pm = &gpio_extcon_pm_ops, >>>>> }, >>>>> }; >>>>> >>>>> >>>> >>> >>> -barry > > -barry > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/ >