From patchwork Fri Aug 31 11:09:48 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "B, Ravi" X-Patchwork-Id: 1392691 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 855363FDFB for ; Fri, 31 Aug 2012 11:10:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752226Ab2HaLKO (ORCPT ); Fri, 31 Aug 2012 07:10:14 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:42228 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751780Ab2HaLKL (ORCPT ); Fri, 31 Aug 2012 07:10:11 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id q7VBA4jm022290; Fri, 31 Aug 2012 06:10:05 -0500 Received: from DBDE70.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7VBA2D5015231; Fri, 31 Aug 2012 16:40:03 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by dbde70.ent.ti.com (172.24.170.148) with Microsoft SMTP Server id 14.1.323.3; Fri, 31 Aug 2012 16:40:02 +0530 Received: from localhost.localdomain (dbdp20.itg.ti.com [172.24.170.38]) by dbdp32.itg.ti.com (8.13.8/8.13.8) with ESMTP id q7VB9xiN021790; Fri, 31 Aug 2012 16:40:02 +0530 From: Ravi Babu To: CC: , , , , Subject: [PATCH v9 02/13] usb: musb: dsps: enable phy control for am335x Date: Fri, 31 Aug 2012 16:39:48 +0530 Message-ID: <1346411399-23964-3-git-send-email-ravibabu@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1346411399-23964-1-git-send-email-ravibabu@ti.com> References: <1346411399-23964-1-git-send-email-ravibabu@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 From: Ajay Kumar Gupta Enabled the phy control logic for am335x also based on usbss revision register. Signed-off-by: Ajay Kumar Gupta Signed-off-by: Santhapuri, Damodar Signed-off-by: Ravi Babu --- arch/arm/plat-omap/include/plat/usb.h | 1 + drivers/usb/musb/musb_dsps.c | 17 +++++++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/arch/arm/plat-omap/include/plat/usb.h b/arch/arm/plat-omap/include/plat/usb.h index c2aa4ae..6459b10 100644 --- a/arch/arm/plat-omap/include/plat/usb.h +++ b/arch/arm/plat-omap/include/plat/usb.h @@ -121,6 +121,7 @@ extern void am35x_set_mode(u8 musb_mode); /* TI81XX specific definitions */ #define MUSB_USBSS_REV_816X 0x9 #define MUSB_USBSS_REV_814X 0xb +#define MUSB_USBSS_REV_33XX 0xd /* TI816X PHY controls bits */ #define TI816X_USBPHY0_NORMAL_MODE (1 << 0) diff --git a/drivers/usb/musb/musb_dsps.c b/drivers/usb/musb/musb_dsps.c index 960258d..e62fa05 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -141,16 +141,21 @@ static void musb_dsps_phy_control(struct dsps_glue *glue, u8 on) if (glue->usbss_rev == MUSB_USBSS_REV_816X) { usbphycfg |= TI816X_USBPHY0_NORMAL_MODE; usbphycfg &= ~TI816X_USBPHY_REFCLK_OSC; - } else if (glue->usbss_rev == MUSB_USBSS_REV_814X) { - usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN - | USBPHY_DPINPUT | USBPHY_DMINPUT); - usbphycfg |= (USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN - | USBPHY_DPOPBUFCTL | USBPHY_DMOPBUFCTL); + } else if (glue->usbss_rev == MUSB_USBSS_REV_814X || + glue->usbss_rev == MUSB_USBSS_REV_33XX) { + usbphycfg &= ~(USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN); + usbphycfg |= USBPHY_OTGVDET_EN | USBPHY_OTGSESSEND_EN; + if (glue->usbss_rev == MUSB_USBSS_REV_814X) { + usbphycfg &= ~(USBPHY_DPINPUT | USBPHY_DMINPUT); + usbphycfg |= USBPHY_DPOPBUFCTL + | USBPHY_DMOPBUFCTL; + } } } else { if (glue->usbss_rev == MUSB_USBSS_REV_816X) usbphycfg &= ~TI816X_USBPHY0_NORMAL_MODE; - else if (glue->usbss_rev == MUSB_USBSS_REV_814X) + else if (glue->usbss_rev == MUSB_USBSS_REV_814X || + glue->usbss_rev == MUSB_USBSS_REV_33XX) usbphycfg |= USBPHY_CM_PWRDN | USBPHY_OTG_PWRDN; } __raw_writel(usbphycfg, glue->usb_ctrl);