From patchwork Thu Jan 10 16:51:31 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 1961341 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) by patchwork1.kernel.org (Postfix) with ESMTP id 1CB933FC85 for ; Thu, 10 Jan 2013 16:59:44 +0000 (UTC) Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.76 #1 (Red Hat Linux)) id 1TtLPf-00077q-MY; Thu, 10 Jan 2013 16:55:32 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.76 #1 (Red Hat Linux)) id 1TtLMK-0005a3-Jq for linux-arm-kernel@lists.infradead.org; Thu, 10 Jan 2013 16:52:06 +0000 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r0AGq1QO028077; Thu, 10 Jan 2013 10:52:01 -0600 Received: from DFLE73.ent.ti.com (dfle73.ent.ti.com [128.247.5.110]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0AGq1SU030102; Thu, 10 Jan 2013 10:52:01 -0600 Received: from dlelxv22.itg.ti.com (172.17.1.197) by dfle73.ent.ti.com (128.247.5.110) with Microsoft SMTP Server id 14.1.323.3; Thu, 10 Jan 2013 10:52:01 -0600 Received: from rockdesk.itg.ti.com (h113-58.vpn.ti.com [172.24.113.58]) by dlelxv22.itg.ti.com (8.13.8/8.13.8) with ESMTP id r0AGpYI9023935; Thu, 10 Jan 2013 10:51:59 -0600 From: Roger Quadros To: Subject: [PATCH 11/14] ARM: OMAP2+: omap4panda: Provide USB Host's PHY platform data Date: Thu, 10 Jan 2013 18:51:31 +0200 Message-ID: <1357836694-30788-12-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.7.4.1 In-Reply-To: <1357836694-30788-1-git-send-email-rogerq@ti.com> References: <1357836694-30788-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130110_115204_923830_4E95204A X-CRM114-Status: GOOD ( 14.85 ) X-Spam-Score: -7.6 (-------) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-7.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -5.0 RCVD_IN_DNSWL_HI RBL: Sender listed at http://www.dnswl.org/, high trust [198.47.26.153 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.7 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: sameo@linux.intel.com, tony@atomide.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, kishon@ti.com, linux-arm-kernel@lists.infradead.org, rogerq@ti.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-arm-kernel-bounces@lists.infradead.org Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Provide platform data for the USB host's PHY. Also get rid of managing PHY clock. This will now be done by the phy driver. For that to work we create a clock alias that links the PHY clock name to the PHY device name. Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/board-omap4panda.c | 31 ++++++++++++++++++++----------- 1 files changed, 20 insertions(+), 11 deletions(-) diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c index ee76830..350c4db 100644 --- a/arch/arm/mach-omap2/board-omap4panda.c +++ b/arch/arm/mach-omap2/board-omap4panda.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include @@ -139,6 +140,18 @@ static struct platform_device *panda_devices[] __initdata = { &btwilink_device, }; +static struct nop_usb_xceiv_platform_data phy_pdata0 = { + .type = USB_PHY_TYPE_UNDEFINED, + /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */ + .clk_rate = 19200000, +}; + +static struct usbhs_phy_config phy_config0 = { + .name = "nop_usb_xceiv", + .pdata = &phy_pdata0, + .pdata_size = sizeof(phy_pdata0), +}; + static struct usbhs_omap_platform_data usbhs_bdata __initdata = { .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED, @@ -146,7 +159,8 @@ static struct usbhs_omap_platform_data usbhs_bdata __initdata = { .phy_reset = false, .reset_gpio_port[0] = -EINVAL, .reset_gpio_port[1] = -EINVAL, - .reset_gpio_port[2] = -EINVAL + .reset_gpio_port[2] = -EINVAL, + .phy_config[0] = &phy_config0, }; static struct gpio panda_ehci_gpios[] __initdata = { @@ -157,16 +171,6 @@ static struct gpio panda_ehci_gpios[] __initdata = { static void __init omap4_ehci_init(void) { int ret; - struct clk *phy_ref_clk; - - /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */ - phy_ref_clk = clk_get(NULL, "auxclk3_ck"); - if (IS_ERR(phy_ref_clk)) { - pr_err("Cannot request auxclk3\n"); - return; - } - clk_set_rate(phy_ref_clk, 19200000); - clk_prepare_enable(phy_ref_clk); /* disable the power to the usb hub prior to init and reset phy+hub */ ret = gpio_request_array(panda_ehci_gpios, @@ -180,6 +184,11 @@ static void __init omap4_ehci_init(void) gpio_export(GPIO_HUB_NRESET, 0); gpio_set_value(GPIO_HUB_NRESET, 1); + /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */ + ret = clk_add_alias("main_clk", "nop_usb_xceiv.0", "auxclk3_ck", NULL); + if (ret) + pr_err("Failed to add main_clk alias to auxclk3_ck\n"); + usbhs_init(&usbhs_bdata); /* enable power to hub */