From patchwork Thu Aug 19 19:18:08 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Munegowda, Keshava" X-Patchwork-Id: 120479 X-Patchwork-Delegate: me@felipebalbi.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7K7IApf024548 for ; Fri, 20 Aug 2010 07:18:11 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751924Ab0HTHRp (ORCPT ); Fri, 20 Aug 2010 03:17:45 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:53285 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751987Ab0HTHRc (ORCPT ); Fri, 20 Aug 2010 03:17:32 -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 o7K7HV73020735 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 20 Aug 2010 02:17:31 -0500 Received: from legion.dal.design.ti.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o7K7HSWv029887; Fri, 20 Aug 2010 02:17:29 -0500 (CDT) Received: from localhost (a0393220-desktop.apr.dhcp.ti.com [172.24.137.6]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id o7K7HQf00719; Fri, 20 Aug 2010 02:17:27 -0500 (CDT) From: Keshava Munegowda To: linux-usb@vger.kernel.org, linux-omap@vger.kernel.org Cc: Keshava Munegowda , Anand Gadiyar Subject: [RFC] [PATCH 3/5] usb: ohci: omap: IO mux mode settings for omap4 Date: Fri, 20 Aug 2010 00:48:08 +0530 Message-Id: <1282245490-24339-4-git-send-email-keshava_mgowda@ti.com> X-Mailer: git-send-email 1.6.0.4 In-Reply-To: <1282245490-24339-3-git-send-email-keshava_mgowda@ti.com> References: <1282245490-24339-1-git-send-email-keshava_mgowda@ti.com> <1282245490-24339-2-git-send-email-keshava_mgowda@ti.com> <1282245490-24339-3-git-send-email-keshava_mgowda@ti.com> 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.3 (demeter.kernel.org [140.211.167.41]); Fri, 20 Aug 2010 07:18:11 +0000 (UTC) Index: linux-2.6/arch/arm/mach-omap2/usb-ehci.c =================================================================== --- linux-2.6.orig/arch/arm/mach-omap2/usb-ehci.c +++ linux-2.6/arch/arm/mach-omap2/usb-ehci.c @@ -490,6 +490,91 @@ static void setup_ohci_io_mux(const enum } } +static void setup_4430ohci_io_mux(const enum ohci_omap3_port_mode *port_mode) +{ + /* FIXME: This funtion should use Mux frame work functions; + * for now, we are hardcodeing it + * This function will be later replaced by MUX framework API. + */ + switch (port_mode[0]) { + case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0: + case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM: + case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0: + case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM: + + /* usbb1_mm_rxdp */ + omap_writew(0x001D, 0x4A1000C4); + + /* usbb1_mm_rxdm */ + omap_writew(0x001D, 0x4A1000C8); + + case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM: + case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM: + + /* usbb1_mm_rxrcv */ + omap_writew(0x001D, 0x4A1000CA); + + case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0: + case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0: + + /* usbb1_mm_txen */ + omap_writew(0x001D, 0x4A1000D0); + + case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0: + case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM: + + /* usbb1_mm_txdat */ + omap_writew(0x001D, 0x4A1000CE); + + /* usbb1_mm_txse0 */ + omap_writew(0x001D, 0x4A1000CC); + break; + + case OMAP_OHCI_PORT_MODE_UNUSED: + default: + break; + } + + switch (port_mode[1]) { + case OMAP_OHCI_PORT_MODE_PHY_6PIN_DATSE0: + case OMAP_OHCI_PORT_MODE_PHY_6PIN_DPDM: + case OMAP_OHCI_PORT_MODE_TLL_6PIN_DATSE0: + case OMAP_OHCI_PORT_MODE_TLL_6PIN_DPDM: + + /* usbb2_mm_rxdp */ + omap_writew(0x010C, 0x4A1000F8); + + /* usbb2_mm_rxdm */ + omap_writew(0x010C, 0x4A1000F6); + + case OMAP_OHCI_PORT_MODE_PHY_4PIN_DPDM: + case OMAP_OHCI_PORT_MODE_TLL_4PIN_DPDM: + + /* usbb2_mm_rxrcv */ + omap_writew(0x010C, 0x4A1000FA); + + case OMAP_OHCI_PORT_MODE_PHY_3PIN_DATSE0: + case OMAP_OHCI_PORT_MODE_TLL_3PIN_DATSE0: + + /* usbb2_mm_txen */ + omap_writew(0x080C, 0x4A1000FC); + + case OMAP_OHCI_PORT_MODE_TLL_2PIN_DATSE0: + case OMAP_OHCI_PORT_MODE_TLL_2PIN_DPDM: + + /* usbb2_mm_txdat */ + omap_writew(0x000C, 0x4A100112); + + /* usbb2_mm_txse0 */ + omap_writew(0x000C, 0x4A100110); + break; + + case OMAP_OHCI_PORT_MODE_UNUSED: + default: + break; + } +} + void __init usb_ohci_init(const struct ohci_hcd_omap_platform_data *pdata) { platform_device_add_data(&ohci_device, pdata, sizeof(*pdata));