From patchwork Mon Nov 25 19:39:50 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Mack X-Patchwork-Id: 3234101 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 82D27C045B for ; Mon, 25 Nov 2013 19:40:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DB330202EA for ; Mon, 25 Nov 2013 19:40:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C91A0202DD for ; Mon, 25 Nov 2013 19:40:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756908Ab3KYTkW (ORCPT ); Mon, 25 Nov 2013 14:40:22 -0500 Received: from mail-bk0-f45.google.com ([209.85.214.45]:46821 "EHLO mail-bk0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756872Ab3KYTkF (ORCPT ); Mon, 25 Nov 2013 14:40:05 -0500 Received: by mail-bk0-f45.google.com with SMTP id mx13so2167734bkb.18 for ; Mon, 25 Nov 2013 11:40:04 -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=t+X7XHLeqwTh7RrUypTTb9nSB8YWfff8cdjoUca4USzorjk5txo6+hoUmMiR+ZnfmV bSc1nRiyWnh0t2GhoS2T4+0i0TKVSo//x4wITObnewQS/zhSbVd+8xUPeB8UbrSkUvd4 5BAn3UBt74qeoh9SsDuHdFIoqkdw7YI6yQ+yfnletXqLRTMEggpYjLMlcipXILxALbXj zizPRzMjdgFWpV4llt8xI1qrBevqFWN7Z07f5zh2+S6w1S9Gu0Risg3xMjAtr4QDFrpj d1gou0sq+LpgO79C4M4PJKBKSc/EtNpf0CEMBsyuw6yf6IDiiFrddxZY71vH4f9v8gpO QjMw== X-Received: by 10.204.201.8 with SMTP id ey8mr2439156bkb.44.1385408404546; Mon, 25 Nov 2013 11:40:04 -0800 (PST) Received: from tamtam.fritz.box (p54AF4EE7.dip0.t-ipconnect.de. [84.175.78.231]) by mx.google.com with ESMTPSA id qe6sm47775520bkb.5.2013.11.25.11.40.03 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Nov 2013 11:40:03 -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 2/5] usb: musb: call musb_port_suspend from musb_bus_suspend Date: Mon, 25 Nov 2013 20:39:50 +0100 Message-Id: <1385408393-19707-3-git-send-email-zonque@gmail.com> X-Mailer: git-send-email 1.8.4.2 In-Reply-To: <1385408393-19707-1-git-send-email-zonque@gmail.com> References: <1385408393-19707-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;