From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753531AbbDGLse (ORCPT ); Tue, 7 Apr 2015 07:48:34 -0400 Received: from mail-bn1on0141.outbound.protection.outlook.com ([157.56.110.141]:61472 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752863AbbDGLs0 (ORCPT ); Tue, 7 Apr 2015 07:48:26 -0400 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; From: Ramneek Mehresh To: , CC: , , , Ramneek Mehresh Subject: [PATCH 3/9] usb:fsl:otg: Signal host drv when host is otg Date: Tue, 7 Apr 2015 17:28:33 +0530 Message-ID: <1428407919-24655-3-git-send-email-ramneek.mehresh@freescale.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1428407919-24655-1-git-send-email-ramneek.mehresh@freescale.com> References: <1428407919-24655-1-git-send-email-ramneek.mehresh@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.168.50;CTRY:US;IPV:NLI;EFV:NLI;BMV:1;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(189002)(199003)(36756003)(48376002)(50466002)(105606002)(229853001)(86362001)(76176999)(6806004)(85426001)(106466001)(47776003)(50226001)(46102003)(50986999)(87936001)(77096005)(33646002)(19580405001)(76506005)(104016003)(62966003)(2950100001)(92566002)(19580395003)(77156002);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR03MB176;H:tx30smr01.am.freescale.net;FPR:;SPF:Fail;MLV:sfv;MX:1;A:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB176; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5002010)(5005006);SRVR:BY2PR03MB176;BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB176; X-Forefront-PRVS: 0539EEBD11 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Apr 2015 11:48:23.1868 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d;Ip=[192.88.168.50];Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR03MB176 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Set is_otg boolean flag to signal host driver when host is running in context of otg host suspend/resume Signed-off-by: Ramneek Mehresh --- drivers/usb/phy/phy-fsl-usb.c | 7 ++++++- include/linux/usb.h | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/usb/phy/phy-fsl-usb.c b/drivers/usb/phy/phy-fsl-usb.c index f90093a..26168da 100644 --- a/drivers/usb/phy/phy-fsl-usb.c +++ b/drivers/usb/phy/phy-fsl-usb.c @@ -463,6 +463,7 @@ void otg_reset_controller(void) int fsl_otg_start_host(struct otg_fsm *fsm, int on) { struct usb_otg *otg = fsm->otg; + struct usb_bus *host = otg->host; struct device *dev; struct fsl_otg *otg_dev = container_of(otg->usb_phy, struct fsl_otg, phy); @@ -485,6 +486,7 @@ int fsl_otg_start_host(struct otg_fsm *fsm, int on) else { otg_reset_controller(); VDBG("host on......\n"); + host->is_otg = 1; if (dev->driver->pm && dev->driver->pm->resume) { retval = dev->driver->pm->resume(dev); if (fsm->id) { @@ -510,8 +512,11 @@ int fsl_otg_start_host(struct otg_fsm *fsm, int on) else { VDBG("host off......\n"); if (dev && dev->driver) { - if (dev->driver->pm && dev->driver->pm->suspend) + if (dev->driver->pm && + dev->driver->pm->suspend) { + host->is_otg = 1; retval = dev->driver->pm->suspend(dev); + } if (fsm->id) /* default-b */ fsl_otg_drv_vbus(fsm, 0); diff --git a/include/linux/usb.h b/include/linux/usb.h index 7ee1b5c..c3a6702 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h @@ -329,6 +329,7 @@ struct usb_bus { * for control transfers? */ u8 otg_port; /* 0, or number of OTG/HNP port */ + unsigned is_otg:1; /* true when host is also otg */ unsigned is_b_host:1; /* true during some HNP roleswitches */ unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ unsigned no_stop_on_short:1; /* -- 1.8.3.1