From patchwork Tue Nov 26 12:31:12 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 3238941 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 403E39F475 for ; Tue, 26 Nov 2013 12:31:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EB755203C4 for ; Tue, 26 Nov 2013 12:31:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4AEEF2015E for ; Tue, 26 Nov 2013 12:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756739Ab3KZMbZ (ORCPT ); Tue, 26 Nov 2013 07:31:25 -0500 Received: from mail-bk0-f44.google.com ([209.85.214.44]:44698 "EHLO mail-bk0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755189Ab3KZMbX (ORCPT ); Tue, 26 Nov 2013 07:31:23 -0500 Received: by mail-bk0-f44.google.com with SMTP id d7so2580196bkh.3 for ; Tue, 26 Nov 2013 04:31:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=6PnfAHfJ4g7C3v+AmAmvsqGkqYFmD0ITP5cdINo3QKI=; b=Oi4PeEbZxBYsaGPE9dkEYhS+rkoSvgdvwNJTfDIMPfdbZ6I/e4haEFSHNjbp8hoBUU GZo0jT6F3uOiPE8s7onnoe0QLYQAX6E3Pc+WbcBMCkymH0ywZpUiVLfmm2D/SlS66OrO XQ3+zRK7f3jcbRJtdu7/5lzv4lu1xpOgmvS1KM/YRCYENXxZnKWkqum5ZhVhY+FYE4DK YOkifFrPqB8mLjACaVHa80HbFqa90czTycVPS8aMfZQv8E5i46IIGH0Pf8lpILmB5cfq TRRRKKU+Es/Gh0zHfUWvBW2XGdFrsV/ZVKUVFYAZ/9RX9SKzwAxw+MLm46ez17D1kZWD jDrw== X-Received: by 10.204.200.78 with SMTP id ev14mr5688416bkb.32.1385469082077; Tue, 26 Nov 2013 04:31:22 -0800 (PST) Received: from tamtam.fritz.box ([2001:4dd0:ff00:9394:224:d7ff:fec6:a0ec]) by mx.google.com with ESMTPSA id b7sm50912648bkg.1.2013.11.26.04.31.20 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Nov 2013 04:31:21 -0800 (PST) From: Daniel Mack To: balbi@ti.com Cc: bigeasy@linutronix.de, linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, neumann@teufel.de, Daniel Mack Subject: [PATCH v4 2/4] usb: musb: call musb_port_suspend from musb_bus_suspend Date: Tue, 26 Nov 2013 13:31:12 +0100 Message-Id: <1385469074-19312-3-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1385469074-19312-1-git-send-email-zonque@gmail.com> References: <1385469074-19312-1-git-send-email-zonque@gmail.com> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Make musb_port_suspend() externally available, and call it when to host goes into suspend. This allows the core to go into suspend while a device is connected. Signed-off-by: Daniel Mack --- drivers/usb/musb/musb_host.c | 2 ++ drivers/usb/musb/musb_host.h | 2 ++ drivers/usb/musb/musb_virthub.c | 2 +- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index 6582a20..81caf9f 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c @@ -2433,6 +2433,8 @@ static int musb_bus_suspend(struct usb_hcd *hcd) struct musb *musb = hcd_to_musb(hcd); u8 devctl; + musb_port_suspend(musb, true); + if (!is_host_active(musb)) return 0; diff --git a/drivers/usb/musb/musb_host.h b/drivers/usb/musb/musb_host.h index 960d735..e660af9 100644 --- a/drivers/usb/musb/musb_host.h +++ b/drivers/usb/musb/musb_host.h @@ -92,6 +92,7 @@ extern void musb_host_rx(struct musb *, u8); extern void musb_root_disconnect(struct musb *musb); extern void musb_host_resume_root_hub(struct musb *musb); extern void musb_host_poke_root_hub(struct musb *musb); +extern void musb_port_suspend(struct musb *musb, bool do_suspend); #else static inline struct musb *hcd_to_musb(struct usb_hcd *hcd) { @@ -121,6 +122,7 @@ static inline void musb_root_disconnect(struct musb *musb) {} static inline void musb_host_resume_root_hub(struct musb *musb) {} static inline void musb_host_poll_rh_status(struct musb *musb) {} static inline void musb_host_poke_root_hub(struct musb *musb) {} +static inline void musb_port_suspend(struct musb *musb, bool do_suspend) {} #endif struct usb_hcd; diff --git a/drivers/usb/musb/musb_virthub.c b/drivers/usb/musb/musb_virthub.c index 9af6bba..e977441 100644 --- a/drivers/usb/musb/musb_virthub.c +++ b/drivers/usb/musb/musb_virthub.c @@ -44,7 +44,7 @@ #include "musb_core.h" -static void musb_port_suspend(struct musb *musb, bool do_suspend) +void musb_port_suspend(struct musb *musb, bool do_suspend) { struct usb_otg *otg = musb->xceiv->otg; u8 power;