From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965769AbbEERra (ORCPT ); Tue, 5 May 2015 13:47:30 -0400 Received: from mail-bl2on0110.outbound.protection.outlook.com ([65.55.169.110]:58400 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S965577AbbEERr1 (ORCPT ); Tue, 5 May 2015 13:47:27 -0400 Authentication-Results: spf=fail (sender IP is 192.88.158.2) 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, 5 May 2015 23:28:30 +0530 Message-ID: <1430848716-32157-3-git-send-email-ramneek.mehresh@freescale.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1430848716-32157-1-git-send-email-ramneek.mehresh@freescale.com> References: <1430848716-32157-1-git-send-email-ramneek.mehresh@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10019020)(6009001)(339900001)(199003)(189002)(33646002)(105606002)(87936001)(19580395003)(85426001)(6806004)(76506005)(48376002)(86362001)(107886002)(5001960100002)(104016003)(77096005)(2950100001)(47776003)(62966003)(77156002)(50466002)(76176999)(229853001)(106466001)(36756003)(92566002)(110136002)(46102003)(50226001)(19580405001)(2351001)(50986999)(42866002)(4001430100001);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR0301MB1573;H:az84smr01.freescale.net;FPR:;SPF:Fail;MLV:sfv;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB1573; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BY2PR0301MB1573;BCL:0;PCL:0;RULEID:;SRVR:BY2PR0301MB1573; X-Forefront-PRVS: 0567A15835 X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 May 2015 17:47:23.1443 (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.158.2];Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY2PR0301MB1573 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