Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126AbaKFRVr (ORCPT ); Thu, 6 Nov 2014 12:21:47 -0500 Received: from mail-qg0-f45.google.com ([209.85.192.45]:33443 "EHLO mail-qg0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751808AbaKFRVn (ORCPT ); Thu, 6 Nov 2014 12:21:43 -0500 MIME-Version: 1.0 In-Reply-To: <1415237402-24665-1-git-send-email-kever.yang@rock-chips.com> References: <1415237402-24665-1-git-send-email-kever.yang@rock-chips.com> Date: Thu, 6 Nov 2014 18:21:42 +0100 Message-ID: Subject: Re: [PATCH v2] usb: dwc2: add bus suspend/resume for dwc2 From: Romain Perier To: Kever Yang Cc: Paul Zimmerman , Felipe Balbi , Dinh Nguyen , Heiko Stuebner , dianders@chromium.org, sonnyrao@chromium.org, addy.ke@rock-chips.com, Eddie Cai , xjq@rock-chips.com, hj@rock-chips.com, dkl@rock-chips.com, huangtao@rock-chips.com, linux-rockchip@lists.infradead.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Kever, 2014-11-06 2:30 GMT+01:00 Kever Yang : > > +static int _dwc2_hcd_suspend(struct usb_hcd *hcd) > +{ > + struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); > + u32 hprt0; > + > + if (!((hsotg->op_state == OTG_STATE_B_HOST) || > + (hsotg->op_state == OTG_STATE_A_HOST))) > + return 0; > + > + if (hsotg->lx_state != DWC2_L0) > + return 0; > + > + hprt0 = dwc2_read_hprt0(hsotg); > + if (hprt0 & HPRT0_CONNSTS) > + dwc2_port_suspend(hsotg, 1); > + > + return 0; > +} > + > +static int _dwc2_hcd_resume(struct usb_hcd *hcd) > +{ > + struct dwc2_hsotg *hsotg = dwc2_hcd_to_hsotg(hcd); > + u32 hprt0; > + > + if (!((hsotg->op_state == OTG_STATE_B_HOST) || > + (hsotg->op_state == OTG_STATE_A_HOST))) > + return 0; > + > + if (hsotg->lx_state != DWC2_L2) > + return 0; > + > + hprt0 = dwc2_read_hprt0(hsotg); > + if ((hprt0 & HPRT0_CONNSTS) && (hprt0 & HPRT0_SUSP)) > + dwc2_port_resume(hsotg); > + > + return 0; > +} Could you also define these functions under #ifdef CONFIG_PM ? Thanks. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/