From patchwork Wed Apr 3 08:45:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Baltieri X-Patchwork-Id: 15845 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 74C7123E21 for ; Wed, 3 Apr 2013 08:48:32 +0000 (UTC) Received: from mail-gg0-f200.google.com (mail-gg0-f200.google.com [209.85.161.200]) by fiordland.canonical.com (Postfix) with ESMTP id 19B8EA184AF for ; Wed, 3 Apr 2013 08:48:32 +0000 (UTC) Received: by mail-gg0-f200.google.com with SMTP id i2sf1722823ggn.11 for ; Wed, 03 Apr 2013 01:48:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=7sokoDnXZfCOi0qreER+JddiBqYhC8a1YtQs2p44Tu4=; b=LoiFStX+StMq/cc/1UOUOek09Cw/eBc3ZYdhwmdJuC5H/Go4TgQv9eRdOYKOLD0hMo iPYgjE5vjtuqhU7w5CIgkhHqTXUkIgNiGWQHd82SgL0mHAGR4XQFOe8Roc+TtV/vraI1 JNfQwzFXmRxZShuKMgM4pi/lbsbRmukWMaLK4OkultWwlrpaQaZNodZGcCbOhVmquqPS N2c/Bp9MKpt8rG+iHuIqVEu38gNWOlj8nkmeHjXfjlZ46nAgG0f/sMFJB0SIt3A/R/C9 eGBmitLa6R6lME/Tw6NhWrucvDXOd7PCTfArO5wUoRx7AcETEmsrBANLCYyKc4mVwx2H 5Dmw== X-Received: by 10.224.172.200 with SMTP id m8mr709069qaz.0.1364978911630; Wed, 03 Apr 2013 01:48:31 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.25.43 with SMTP id z11ls858220qef.20.gmail; Wed, 03 Apr 2013 01:48:31 -0700 (PDT) X-Received: by 10.52.26.209 with SMTP id n17mr463623vdg.26.1364978911493; Wed, 03 Apr 2013 01:48:31 -0700 (PDT) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [2607:f8b0:400c:c02::22d]) by mx.google.com with ESMTPS id jj7si4270359vcb.34.2013.04.03.01.48.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 01:48:31 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22d; Received: by mail-vb0-f45.google.com with SMTP id w15so266610vbf.32 for ; Wed, 03 Apr 2013 01:48:31 -0700 (PDT) X-Received: by 10.58.220.129 with SMTP id pw1mr508810vec.32.1364978911331; Wed, 03 Apr 2013 01:48:31 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.59.4.204 with SMTP id cg12csp160668ved; Wed, 3 Apr 2013 01:48:30 -0700 (PDT) X-Received: by 10.15.22.76 with SMTP id e52mr1955419eeu.7.1364978910177; Wed, 03 Apr 2013 01:48:30 -0700 (PDT) Received: from mail-ea0-x233.google.com (mail-ea0-x233.google.com [2a00:1450:4013:c01::233]) by mx.google.com with ESMTPS id r7si7602796eeo.78.2013.04.03.01.48.29 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 03 Apr 2013 01:48:30 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:4013:c01::233 is neither permitted nor denied by best guess record for domain of fabio.baltieri@linaro.org) client-ip=2a00:1450:4013:c01::233; Received: by mail-ea0-f179.google.com with SMTP id f15so550354eak.10 for ; Wed, 03 Apr 2013 01:48:29 -0700 (PDT) X-Received: by 10.14.202.71 with SMTP id c47mr1743220eeo.39.1364978909418; Wed, 03 Apr 2013 01:48:29 -0700 (PDT) Received: from localhost ([2a01:2003:1:1e91:8e70:5aff:feac:ad8]) by mx.google.com with ESMTPS id q5sm6849388eeo.17.2013.04.03.01.48.22 (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Wed, 03 Apr 2013 01:48:28 -0700 (PDT) From: Fabio Baltieri To: Felipe Balbi Cc: Linus Walleij , Praveena Nadahally , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Sakethram Bommisetti , Fabio Baltieri Subject: [PATCH 11/12] usb: phy: ab8500-usb: drop link status delayed work Date: Wed, 3 Apr 2013 10:45:12 +0200 Message-Id: <1364978713-19612-12-git-send-email-fabio.baltieri@linaro.org> X-Mailer: git-send-email 1.8.1.3 In-Reply-To: <1364978713-19612-1-git-send-email-fabio.baltieri@linaro.org> References: <1364978713-19612-1-git-send-email-fabio.baltieri@linaro.org> X-Gm-Message-State: ALoCoQnVmara5Oj/N/ZiVwO4CUCioG7Qm/evGzsPzoN+B7LgkLJEgG/KTenB6MPa1NoQf/FS3okW X-Original-Sender: fabio.baltieri@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , From: Sakethram Bommisetti ab8500_usb_delayed_work was implemented as a workaroud for the internal only and now unsupported v1.0 version of AB850. This patch removes the delayed work and just leave a link status update call at probe time. Signed-off-by: Sakethram Bommisetti Acked-by: Linus Walleij Signed-off-by: Fabio Baltieri --- drivers/usb/phy/phy-ab8500-usb.c | 30 ++---------------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/drivers/usb/phy/phy-ab8500-usb.c b/drivers/usb/phy/phy-ab8500-usb.c index 0875e2b..30adfee 100644 --- a/drivers/usb/phy/phy-ab8500-usb.c +++ b/drivers/usb/phy/phy-ab8500-usb.c @@ -124,9 +124,7 @@ struct ab8500_usb { struct device *dev; struct ab8500 *ab8500; unsigned vbus_draw; - struct delayed_work dwork; struct work_struct phy_dis_work; - unsigned long link_status_wait; enum ab8500_usb_mode mode; struct regulator *v_ape; struct regulator *v_musb; @@ -556,14 +554,6 @@ static irqreturn_t ab8500_usb_link_status_irq(int irq, void *data) return IRQ_HANDLED; } -static void ab8500_usb_delayed_work(struct work_struct *work) -{ - struct ab8500_usb *ab = container_of(work, struct ab8500_usb, - dwork.work); - - abx500_usb_link_status_update(ab); -} - static void ab8500_usb_phy_disable_work(struct work_struct *work) { struct ab8500_usb *ab = container_of(work, struct ab8500_usb, @@ -634,12 +624,6 @@ static int ab8500_usb_set_peripheral(struct usb_otg *otg, } else { otg->gadget = gadget; otg->phy->state = OTG_STATE_B_IDLE; - - /* Phy will not be enabled if cable is already - * plugged-in. Schedule to enable phy. - * Use same delay to avoid any race condition. - */ - schedule_delayed_work(&ab->dwork, ab->link_status_wait); } return 0; @@ -664,11 +648,6 @@ static int ab8500_usb_set_host(struct usb_otg *otg, struct usb_bus *host) schedule_work(&ab->phy_dis_work); } else { otg->host = host; - /* Phy will not be enabled if cable is already - * plugged-in. Schedule to enable phy. - * Use same delay to avoid any race condition. - */ - schedule_delayed_work(&ab->dwork, ab->link_status_wait); } return 0; @@ -791,11 +770,6 @@ static int ab8500_usb_probe(struct platform_device *pdev) ATOMIC_INIT_NOTIFIER_HEAD(&ab->phy.notifier); - /* v1: Wait for link status to become stable. - * all: Updates form set_host and set_peripheral as they are atomic. - */ - INIT_DELAYED_WORK(&ab->dwork, ab8500_usb_delayed_work); - /* all: Disable phy when called from set_host and set_peripheral */ INIT_WORK(&ab->phy_dis_work, ab8500_usb_phy_disable_work); @@ -892,6 +866,8 @@ static int ab8500_usb_probe(struct platform_device *pdev) /* Needed to enable ID detection. */ ab8500_usb_wd_workaround(ab); + abx500_usb_link_status_update(ab); + dev_info(&pdev->dev, "revision 0x%2x driver initialized\n", rev); return 0; @@ -901,8 +877,6 @@ static int ab8500_usb_remove(struct platform_device *pdev) { struct ab8500_usb *ab = platform_get_drvdata(pdev); - cancel_delayed_work_sync(&ab->dwork); - cancel_work_sync(&ab->phy_dis_work); usb_remove_phy(&ab->phy);