From patchwork Wed Jun 12 15:28:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: manjunath.goudar@linaro.org X-Patchwork-Id: 17849 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yh0-f70.google.com (mail-yh0-f70.google.com [209.85.213.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1960023903 for ; Wed, 12 Jun 2013 15:29:39 +0000 (UTC) Received: by mail-yh0-f70.google.com with SMTP id l109sf8970915yhq.5 for ; Wed, 12 Jun 2013 08:29:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to: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=Wsl9BZz7hdHJk1erlpJUBBzWzCxM5q+1BOferFOV9ZI=; b=CsXZEuMOd8OPSmE5vhdZHkFKb+CZHEryY6+9XErDMj8aeUPjbEVKVoh8bIBAU4Jjgl F2+VjuLD7R+AZINJkXC+Wxt2nCbTsnXIUENtILKqqaoTo+RNbTyEMfjkbp/RtPqdIFaQ RbB7e9md/S7a9mJ5unErsr5KnTIeIsjg9xEj7mKr1IOOdYEXNoxpYvzNTm3p+lXaqQUE NKW1+Y/cKLjNcZzl40XROfn54yL83GMh2aTu5fjRI6DQW3fzSZmdussJDMufP2Wu/98L E+WRpZwcV6z5TQJueIK9aIKZFS3XFxQhRfUrbBXFzK7fwUn2C+zlmqWAihcHXNvJz10f ECBA== X-Received: by 10.236.14.233 with SMTP id d69mr11568396yhd.51.1371050978853; Wed, 12 Jun 2013 08:29:38 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.132 with SMTP id 4ls2992527qee.18.gmail; Wed, 12 Jun 2013 08:29:38 -0700 (PDT) X-Received: by 10.52.29.19 with SMTP id f19mr8406853vdh.100.1371050978614; Wed, 12 Jun 2013 08:29:38 -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 tn5si8779227vdc.104.2013.06.12.08.29.38 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 08:29:38 -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 p14so4045353vbm.32 for ; Wed, 12 Jun 2013 08:29:38 -0700 (PDT) X-Received: by 10.220.144.67 with SMTP id y3mr8740193vcu.17.1371050978470; Wed, 12 Jun 2013 08:29:38 -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.58.191.99 with SMTP id gx3csp148685vec; Wed, 12 Jun 2013 08:29:37 -0700 (PDT) X-Received: by 10.68.78.37 with SMTP id y5mr20308469pbw.28.1371050977334; Wed, 12 Jun 2013 08:29:37 -0700 (PDT) Received: from mail-pd0-f171.google.com (mail-pd0-f171.google.com [209.85.192.171]) by mx.google.com with ESMTPS id cy3si9681439pbb.248.2013.06.12.08.29.36 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 08:29:37 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.192.171 is neither permitted nor denied by best guess record for domain of manjunath.goudar@linaro.org) client-ip=209.85.192.171; Received: by mail-pd0-f171.google.com with SMTP id y14so7234384pdi.16 for ; Wed, 12 Jun 2013 08:29:36 -0700 (PDT) X-Received: by 10.66.20.66 with SMTP id l2mr24144738pae.205.1371050975942; Wed, 12 Jun 2013 08:29:35 -0700 (PDT) Received: from localhost.localdomain ([223.239.143.110]) by mx.google.com with ESMTPSA id ri8sm19557052pbc.3.2013.06.12.08.29.31 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 12 Jun 2013 08:29:35 -0700 (PDT) From: Manjunath Goudar To: linux-usb@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, patches@linaro.org, stern@rowland.harvard.edu, arnd@linaro.org, manjunath.goudar@linaro.org, linaro-dev@lists.linaro.org, Arnd Bergmann , Greg KH Subject: [PATCH 10/10] USB: OHCI: Properly handle ohci-spear suspend Date: Wed, 12 Jun 2013 20:58:38 +0530 Message-Id: <1371050918-29472-11-git-send-email-manjunath.goudar@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> References: <1371050918-29472-1-git-send-email-manjunath.goudar@linaro.org> X-Gm-Message-State: ALoCoQnhGFzSUNjMgrwmsdzGg0y7EecKXF3IHk++tmPWL8dCMfkXiHFG/0I7xBe6wYRjjPYBXWYn X-Original-Sender: manjunath.goudar@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: , Suspend scenario in case of ohci-spear glue was not properly handled as it was not suspending generic part of ohci controller.Calling explicitly the ohci_suspend() routine in spear_ohci_hcd_drv_suspend() will ensure proper handling of suspend scenario. Signed-off-by: Manjunath Goudar Cc: Arnd Bergmann Cc: Alan Stern Cc: Greg KH Cc: linux-usb@vger.kernel.org --- drivers/usb/host/ohci-spear.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/ohci-spear.c b/drivers/usb/host/ohci-spear.c index 31ff3fc..5a843f0 100644 --- a/drivers/usb/host/ohci-spear.c +++ b/drivers/usb/host/ohci-spear.c @@ -130,20 +130,24 @@ static int spear_ohci_hcd_drv_remove(struct platform_device *pdev) } #if defined(CONFIG_PM) -static int spear_ohci_hcd_drv_suspend(struct platform_device *dev, +static int spear_ohci_hcd_drv_suspend(struct platform_device *pdev, pm_message_t message) { - struct usb_hcd *hcd = platform_get_drvdata(dev); + struct usb_hcd *hcd = platform_get_drvdata(pdev); struct ohci_hcd *ohci = hcd_to_ohci(hcd); struct spear_ohci *sohci_p = to_spear_ohci(hcd); + bool do_wakeup = device_may_wakeup(&pdev->dev); + int ret; if (time_before(jiffies, ohci->next_statechange)) msleep(5); ohci->next_statechange = jiffies; + ret = ohci_suspend(hcd, do_wakeup); + clk_disable_unprepare(sohci_p->clk); - return 0; + return ret; } static int spear_ohci_hcd_drv_resume(struct platform_device *dev)