From patchwork Wed Sep 7 16:19:23 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vikram pandita X-Patchwork-Id: 1127402 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 p87GMOlG004437 for ; Wed, 7 Sep 2011 16:22:26 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756484Ab1IGQVa (ORCPT ); Wed, 7 Sep 2011 12:21:30 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:49616 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756332Ab1IGQTb (ORCPT ); Wed, 7 Sep 2011 12:19:31 -0400 Received: from dlep33.itg.ti.com ([157.170.170.112]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id p87GJUQ1010503 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 7 Sep 2011 11:19:30 -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 p87GJU7F005550; Wed, 7 Sep 2011 11:19:30 -0500 (CDT) Received: from DLEE74.ent.ti.com (localhost [127.0.0.1]) by dlep26.itg.ti.com (8.13.8/8.13.8) with ESMTP id p87GJUZ0023387; Wed, 7 Sep 2011 11:19:30 -0500 (CDT) Received: from dlelxv24.itg.ti.com (172.17.1.199) by DLEE74.ent.ti.com (157.170.170.8) with Microsoft SMTP Server id 14.1.323.3; Wed, 7 Sep 2011 11:19:30 -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 p87GJUU5009827; Wed, 7 Sep 2011 11:19:30 -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 p87GJT018832; Wed, 7 Sep 2011 11:19:29 -0500 (CDT) From: Vikram Pandita To: CC: , , Vikram Pandita , Anand Gadiyar Subject: [v2 1/2] usb: musb: omap2+: fix context api's Date: Wed, 7 Sep 2011 09:19:23 -0700 Message-ID: <1315412364-21384-2-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:22:27 +0000 (UTC) From: Vikram Pandita RxFifoSz, TxFifoSz, RxFifoAddr, TxFifoAddr are all indexed registers. So before doing a context save or restore, INDEX register should be set, then only one gets to the right register offset. Signed-off-by: Vikram Pandita Signed-off-by: Anand Gadiyar --- drivers/usb/musb/musb_core.c | 2 ++ 1 files changed, 2 insertions(+), 0 deletions(-) diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 20a2873..6328aaf 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -2159,6 +2159,7 @@ static void musb_save_context(struct musb *musb) if (!epio) continue; + musb_writeb(musb_base, MUSB_INDEX, i); musb->context.index_regs[i].txmaxp = musb_readw(epio, MUSB_TXMAXP); musb->context.index_regs[i].txcsr = @@ -2234,6 +2235,7 @@ static void musb_restore_context(struct musb *musb) if (!epio) continue; + musb_writeb(musb_base, MUSB_INDEX, i); musb_writew(epio, MUSB_TXMAXP, musb->context.index_regs[i].txmaxp); musb_writew(epio, MUSB_TXCSR,