From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1425491AbcFIIBT (ORCPT ); Thu, 9 Jun 2016 04:01:19 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:49809 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1161353AbcFIIBR (ORCPT ); Thu, 9 Jun 2016 04:01:17 -0400 Subject: Re: [RFC v4 2/7] Revert "extcon: usb-gpio: switch to use pm wakeirq apis" To: Krzysztof Kozlowski , MyungJoo Ham , Chanwoo Choi , Rob Herring , Mark Rutland , Kukjin Kim , Marek Szyprowski , , , , References: <1465393686-16644-1-git-send-email-k.kozlowski@samsung.com> <1465393686-16644-3-git-send-email-k.kozlowski@samsung.com> CC: Peter Chen , "Ivan T. Ivanov" , Felipe Balbi , , Bartlomiej Zolnierkiewicz From: Roger Quadros Message-ID: <57592220.9030201@ti.com> Date: Thu, 9 Jun 2016 11:00:32 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.8.0 MIME-Version: 1.0 In-Reply-To: <1465393686-16644-3-git-send-email-k.kozlowski@samsung.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org -balbi@ti +balbi@kernel Hi, On 08/06/16 16:48, Krzysztof Kozlowski wrote: > This reverts commit 8106e404174253639731cc30a44f5b3ab764c5b7. The above commit id is not present in v4.7-rc1 and this patch doesn't apply properly. Can you please rebase this series on v4.7-rc1? > > When using PM wakeirq API only one wakeup IRQ can be set. However the > driver will support also VBUS GPIO so we need two wakeup interrupts. > --- > drivers/extcon/extcon-usb-gpio.c | 19 +++++++++++++------ > 1 file changed, 13 insertions(+), 6 deletions(-) > > diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c > index 2512660dc4b9..a36aab007022 100644 > --- a/drivers/extcon/extcon-usb-gpio.c > +++ b/drivers/extcon/extcon-usb-gpio.c > @@ -24,7 +24,6 @@ > #include > #include > #include > -#include > #include > #include > #include > @@ -143,8 +142,7 @@ static int usb_extcon_probe(struct platform_device *pdev) > } > > platform_set_drvdata(pdev, info); > - device_init_wakeup(dev, true); > - dev_pm_set_wake_irq(dev, info->id_irq); > + device_init_wakeup(dev, 1); > > /* Perform initial detection */ > usb_extcon_detect_cable(&info->wq_detcable.work); > @@ -158,9 +156,6 @@ static int usb_extcon_remove(struct platform_device *pdev) > > cancel_delayed_work_sync(&info->wq_detcable); > > - dev_pm_clear_wake_irq(&pdev->dev); > - device_init_wakeup(&pdev->dev, false); > - > return 0; > } > > @@ -170,6 +165,12 @@ static int usb_extcon_suspend(struct device *dev) > struct usb_extcon_info *info = dev_get_drvdata(dev); > int ret = 0; > > + if (device_may_wakeup(dev)) { > + ret = enable_irq_wake(info->id_irq); > + if (ret) > + return ret; > + } > + > /* > * We don't want to process any IRQs after this point > * as GPIOs used behind I2C subsystem might not be > @@ -185,6 +186,12 @@ static int usb_extcon_resume(struct device *dev) > struct usb_extcon_info *info = dev_get_drvdata(dev); > int ret = 0; > > + if (device_may_wakeup(dev)) { > + ret = disable_irq_wake(info->id_irq); > + if (ret) > + return ret; > + } > + > enable_irq(info->id_irq); > if (!device_may_wakeup(dev)) > queue_delayed_work(system_power_efficient_wq, > -- cheers, -roger