From patchwork Tue Jun 14 14:04:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 70000 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2066405qgf; Tue, 14 Jun 2016 07:04:52 -0700 (PDT) X-Received: by 10.202.80.5 with SMTP id e5mr4949316oib.182.1465913092120; Tue, 14 Jun 2016 07:04:52 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v16si38804328pfa.219.2016.06.14.07.04.51; Tue, 14 Jun 2016 07:04:52 -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 S932087AbcFNOEt (ORCPT + 30 others); Tue, 14 Jun 2016 10:04:49 -0400 Received: from bear.ext.ti.com ([198.47.19.11]:44792 "EHLO bear.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751976AbcFNOEr (ORCPT ); Tue, 14 Jun 2016 10:04:47 -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 u5EE4eDY000932; Tue, 14 Jun 2016 09:04:40 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5EE4epp004848; Tue, 14 Jun 2016 09:04:40 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.294.0; Tue, 14 Jun 2016 09:04:40 -0500 Received: from lta0400828d.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id u5EE4bEO022360; Tue, 14 Jun 2016 09:04:38 -0500 From: Roger Quadros To: , CC: , , , , , Roger Quadros Subject: [PATCH] extcon: palmas: Fix boot up state of VBUS when using GPIO detection Date: Tue, 14 Jun 2016 17:04:35 +0300 Message-ID: <1465913075-30166-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If USB cable is connected prior to boot, we don't get any interrupts so we must manually check the VBUS state and report it during probe. If we don't do it then USB controller will never know that peripheral cable was connected till the user unplugs and replugs the cable. Fixes: b7aad8e2685b ("extcon: palmas: Add the support for VBUS detection by using GPIO") Signed-off-by: Roger Quadros --- drivers/extcon/extcon-palmas.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c index 8b3226d..caff46c 100644 --- a/drivers/extcon/extcon-palmas.c +++ b/drivers/extcon/extcon-palmas.c @@ -360,6 +360,8 @@ static int palmas_usb_probe(struct platform_device *pdev) palmas_enable_irq(palmas_usb); /* perform initial detection */ + 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); device_set_wakeup_capable(&pdev->dev, true); return 0;