From patchwork Mon Apr 11 14:04:45 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 65523 Delivered-To: patch@linaro.org Received: by 10.55.49.19 with SMTP id x19csp1437463qkx; Mon, 11 Apr 2016 07:05:19 -0700 (PDT) X-Received: by 10.98.8.91 with SMTP id c88mr33075737pfd.47.1460383516589; Mon, 11 Apr 2016 07:05:16 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fi14si3839843pab.209.2016.04.11.07.05.16; Mon, 11 Apr 2016 07:05:16 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755310AbcDKOE4 (ORCPT + 29 others); Mon, 11 Apr 2016 10:04:56 -0400 Received: from bear.ext.ti.com ([192.94.94.41]:51756 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755086AbcDKOEx (ORCPT ); Mon, 11 Apr 2016 10:04:53 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by bear.ext.ti.com (8.13.7/8.13.7) with ESMTP id u3BE4m05032763; Mon, 11 Apr 2016 09:04:48 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3BE4moj031861; Mon, 11 Apr 2016 09:04:48 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.224.2; Mon, 11 Apr 2016 09:04:47 -0500 Received: from [192.168.2.6] (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u3BE4kad004300; Mon, 11 Apr 2016 09:04:47 -0500 Subject: [PATCH v3] extcon: usb-gpio: Don't miss event during suspend/resume To: , References: <1459951299-20578-1-git-send-email-rogerq@ti.com> <57075F23.8080703@ti.com> CC: , Grygorii Strashko , From: Roger Quadros Message-ID: <570BAEFD.2050406@ti.com> Date: Mon, 11 Apr 2016 17:04:45 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <57075F23.8080703@ti.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Pin state might have changed during suspend/resume while our interrupts were disabled and if device doesn't support wakeup. Scan for change during resume for such case. Signed-off-by: Roger Quadros --- v3: - use queue_delayed_work() instead of directly calling usb_extcon_detect_cable() v2: - only check for state change during resume if device wakeup is drivers/extcon/extcon-usb-gpio.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.5.0 diff --git a/drivers/extcon/extcon-usb-gpio.c b/drivers/extcon/extcon-usb-gpio.c index bc61d11..bad2159 100644 --- a/drivers/extcon/extcon-usb-gpio.c +++ b/drivers/extcon/extcon-usb-gpio.c @@ -185,6 +185,9 @@ static int usb_extcon_resume(struct device *dev) int ret = 0; enable_irq(info->id_irq); + if (!device_may_wakeup(dev)) + queue_delayed_work(system_power_efficient_wq, + &info->wq_detcable, 0); return ret; }