From patchwork Wed Sep 7 16:19:24 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vikram pandita X-Patchwork-Id: 1127372 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p87GKr84001171 for ; Wed, 7 Sep 2011 16:20:57 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756358Ab1IGQTf (ORCPT ); Wed, 7 Sep 2011 12:19:35 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:60947 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756417Ab1IGQTd (ORCPT ); Wed, 7 Sep 2011 12:19:33 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id p87GJWSo002892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 7 Sep 2011 11:19:33 -0500 Received: from dlep26.itg.ti.com (smtp-le.itg.ti.com [157.170.170.27]) by dlep33.itg.ti.com (8.13.7/8.13.8) with ESMTP id p87GJWIH005559; Wed, 7 Sep 2011 11:19:32 -0500 (CDT) Received: from DFLE71.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p87GJWRv023448; Wed, 7 Sep 2011 11:19:32 -0500 (CDT) Received: from dlelxv24.itg.ti.com (172.17.1.199) by dfle71.ent.ti.com (128.247.5.62) with Microsoft SMTP Server id 14.1.323.3; Wed, 7 Sep 2011 11:19:32 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id p87GJWYv009837; Wed, 7 Sep 2011 11:19:32 -0500 Received: from localhost (h113-248.vpn.ti.com [172.24.113.248]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id p87GJV018836; Wed, 7 Sep 2011 11:19:31 -0500 (CDT) From: Vikram Pandita To: CC: , , Hema HK , Kishon Vijay Abraham I , Vikram Pandita Subject: [v2 2/2] usb: musb: omap2+: save and restore OTG_INTERFSEL Date: Wed, 7 Sep 2011 09:19:24 -0700 Message-ID: <1315412364-21384-3-git-send-email-vikram.pandita@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1315412364-21384-1-git-send-email-vikram.pandita@ti.com> References: <1315412364-21384-1-git-send-email-vikram.pandita@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Wed, 07 Sep 2011 16:20:57 +0000 (UTC) From: Hema HK we need to save and restore OTG_INTERFSEL register else we will be unable to function on resume after OFF mode. Reported-by: Devaraj Rangasamy Signed-off-by: Hema HK Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Vikram Pandita --- drivers/usb/musb/musb_core.h | 1 + drivers/usb/musb/omap2430.c | 6 ++++++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index b3c065a..3259a6b 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h @@ -311,6 +311,7 @@ struct musb_context_registers { u8 index, testmode; u8 devctl, busctl, misc; + u32 otg_interfsel; struct musb_csr_regs index_regs[MUSB_C_NUM_EPS]; }; diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c index ba85f27..78eb13a 100644 --- a/drivers/usb/musb/omap2430.c +++ b/drivers/usb/musb/omap2430.c @@ -491,6 +491,9 @@ static int omap2430_runtime_suspend(struct device *dev) struct omap2430_glue *glue = dev_get_drvdata(dev); struct musb *musb = glue_to_musb(glue); + musb->context.otg_interfsel = musb_readl(musb->mregs, + OTG_INTERFSEL); + omap2430_low_level_exit(musb); otg_set_suspend(musb->xceiv, 1); @@ -503,6 +506,9 @@ static int omap2430_runtime_resume(struct device *dev) struct musb *musb = glue_to_musb(glue); omap2430_low_level_init(musb); + musb_writel(musb->mregs, OTG_INTERFSEL, + musb->context.otg_interfsel); + otg_set_suspend(musb->xceiv, 0); return 0;