From patchwork Wed Feb 15 12:31:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 94000 Delivered-To: patch@linaro.org Received: by 10.140.20.99 with SMTP id 90csp2005678qgi; Wed, 15 Feb 2017 04:31:59 -0800 (PST) X-Received: by 10.84.231.2 with SMTP id f2mr43481546plk.117.1487161919444; Wed, 15 Feb 2017 04:31:59 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q16si3646857pfj.40.2017.02.15.04.31.59; Wed, 15 Feb 2017 04:31:59 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752111AbdBOMbm (ORCPT + 25 others); Wed, 15 Feb 2017 07:31:42 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:14254 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751666AbdBOMbk (ORCPT ); Wed, 15 Feb 2017 07:31:40 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id v1FCVafK030786; Wed, 15 Feb 2017 06:31:36 -0600 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 v1FCVaVc029637; Wed, 15 Feb 2017 06:31:36 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.294.0; Wed, 15 Feb 2017 06:31:36 -0600 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id v1FCVU36015293; Wed, 15 Feb 2017 06:31:34 -0600 From: Roger Quadros To: , CC: , , Roger Quadros Subject: [PATCH 2/2] extcon: palmas: Don't miss GPIO events during suspend/resume Date: Wed, 15 Feb 2017 14:31:29 +0200 Message-ID: <1487161889-15550-3-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487161889-15550-1-git-send-email-rogerq@ti.com> References: <1487161889-15550-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The USB cable state can change during suspend/resume so be sure to check and update the extcon state. Signed-off-by: Roger Quadros --- drivers/extcon/extcon-palmas.c | 6 ++++++ 1 file changed, 6 insertions(+) -- 2.7.4 diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c index 634ba70..97bacb4 100644 --- a/drivers/extcon/extcon-palmas.c +++ b/drivers/extcon/extcon-palmas.c @@ -408,6 +408,12 @@ static int palmas_usb_resume(struct device *dev) if (palmas_usb->enable_gpio_id_detection) disable_irq_wake(palmas_usb->gpio_id_irq); } + + /* check if GPIO states changed while suspend/resume */ + if (palmas_usb->enable_gpio_vbus_detection) + palmas_vbus_irq_handler(palmas_usb->gpio_vbus_irq, palmas_usb); + palmas_gpio_id_detect(&palmas_usb->wq_detectid.work); + return 0; }; #endif