From patchwork Thu Jul 12 10:10:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Santhapuri, Damodar" X-Patchwork-Id: 1188221 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 03048E0038 for ; Thu, 12 Jul 2012 10:12:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759175Ab2GLKMX (ORCPT ); Thu, 12 Jul 2012 06:12:23 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:36751 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759138Ab2GLKMS (ORCPT ); Thu, 12 Jul 2012 06:12:18 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id q6CACGPt006940; Thu, 12 Jul 2012 05:12:17 -0500 Received: from DBDE71.ent.ti.com (localhost [127.0.0.1]) by dbdp20.itg.ti.com (8.13.8/8.13.8) with ESMTP id q6CACGt8020001; Thu, 12 Jul 2012 15:42:16 +0530 (IST) Received: from dbdp32.itg.ti.com (172.24.170.251) by DBDE71.ent.ti.com (172.24.170.149) with Microsoft SMTP Server id 14.1.323.3; Thu, 12 Jul 2012 15:42:15 +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 q6CACE5h001082; Thu, 12 Jul 2012 15:42:15 +0530 From: Damodar Santhapuri To: CC: , , Ajay Kumar Gupta , Damodar Santhapuri Subject: [PATCH v3 3/3] usb: musb: dsps: enable phy control for am335x Date: Thu, 12 Jul 2012 15:40:37 +0530 Message-ID: <1342087837-32161-3-git-send-email-damodar.santhapuri@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1342087837-32161-1-git-send-email-damodar.santhapuri@ti.com> References: <1342087837-32161-1-git-send-email-damodar.santhapuri@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: Damodar Santhapuri --- 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 72eda64..46b07cc 100644 --- a/drivers/usb/musb/musb_dsps.c +++ b/drivers/usb/musb/musb_dsps.c @@ -140,16 +140,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);