From patchwork Mon Jul 9 13:48:10 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Damodar Santhapuri X-Patchwork-Id: 1173091 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 2646A3FC2A for ; Mon, 9 Jul 2012 14:05:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754049Ab2GINsT (ORCPT ); Mon, 9 Jul 2012 09:48:19 -0400 Received: from arroyo.ext.ti.com ([192.94.94.40]:44546 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753975Ab2GINsQ (ORCPT ); Mon, 9 Jul 2012 09:48:16 -0400 Received: from dbdp20.itg.ti.com ([172.24.170.38]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id q69DmFpe023353; Mon, 9 Jul 2012 08:48:15 -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 q69DmEfE025154; Mon, 9 Jul 2012 19:18:14 +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; Mon, 9 Jul 2012 19:18:14 +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 q69DmCwi015544; Mon, 9 Jul 2012 19:18:14 +0530 From: Damodar Santhapuri To: CC: , , Ajay Kumar Gupta , Damodar Santhapuri Subject: [PATCH 3/3] usb: musb: dsps: enable phy control for am335x Date: Mon, 9 Jul 2012 19:18:10 +0530 Message-ID: <1341841690-23899-3-git-send-email-x0132156@ti.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1341841690-23899-1-git-send-email-x0132156@ti.com> References: <1341841690-23899-1-git-send-email-x0132156@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 --- Earlier version of this patch based on function pointer was submitted at http://marc.info/?l=linux-usb&m=133583281512646&w=2 and was not accepted as Felipe wanted this to be done through system conrol module driver. 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 f7271c3..171352c 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);