From patchwork Thu Feb 27 14:18:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 25455 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6B8AF20543 for ; Thu, 27 Feb 2014 14:19:59 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id kx10sf5638459pab.5 for ; Thu, 27 Feb 2014 06:19:58 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe:content-type; bh=9OOYJaVf6oqZ/E0jQmcRF/Ze3tEQous3A0Sh4osOJ+w=; b=drYIC+AZN9SMh8B+//eMpkpN6lZeLTIOnocKK8bEyI/3SG0nKiCpziR1BSj2hpobEA dkVpPNXXniDEmkOx6/4Xo99S0bANq6WlsRsTL6zzoRdSjfUtq3tPY4jB9x+C0trNHuFS bLUVcNfI/tR28rMboVE9FC5v+uLHDJmjgui0d4MKMhQYFVs/DCHDSqhJkEcnZlkG20cf OY3fd+3hILox+El594ANE8J4xkz3TNZd7N9OBX6zNbDvF1pEdfOJ+rZcMQzY/5f5hPlI SIfF4JAEV4ArjvSmLZtboOVF0uqNfYVVPG/X7S+nl7W99dqcLpzXmN+qyQC2jwhwyUEP weVQ== X-Gm-Message-State: ALoCoQn9zDiwYRKp4Ure/85IkmJNTW0/Dy50GnFiq69bPP7FyCeZ2GDG8FHBvnyE6e+hPBAoLBvd X-Received: by 10.66.140.8 with SMTP id rc8mr5996127pab.41.1393510798508; Thu, 27 Feb 2014 06:19:58 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.104.142 with SMTP id a14ls703008qgf.31.gmail; Thu, 27 Feb 2014 06:19:58 -0800 (PST) X-Received: by 10.52.172.39 with SMTP id az7mr14971vdc.87.1393510798416; Thu, 27 Feb 2014 06:19:58 -0800 (PST) Received: from mail-ve0-f182.google.com (mail-ve0-f182.google.com [209.85.128.182]) by mx.google.com with ESMTPS id tr5si1199039vdc.65.2014.02.27.06.19.58 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 27 Feb 2014 06:19:58 -0800 (PST) Received-SPF: neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.128.182; Received: by mail-ve0-f182.google.com with SMTP id jy13so3843412veb.41 for ; Thu, 27 Feb 2014 06:19:58 -0800 (PST) X-Received: by 10.221.22.71 with SMTP id qv7mr1256228vcb.34.1393510798326; Thu, 27 Feb 2014 06:19:58 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.220.174.196 with SMTP id u4csp20192vcz; Thu, 27 Feb 2014 06:19:57 -0800 (PST) X-Received: by 10.68.242.33 with SMTP id wn1mr13523269pbc.154.1393510797250; Thu, 27 Feb 2014 06:19:57 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mp8si4767316pbc.142.2014.02.27.06.19.56; Thu, 27 Feb 2014 06:19:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752692AbaB0OT0 (ORCPT + 5 others); Thu, 27 Feb 2014 09:19:26 -0500 Received: from comal.ext.ti.com ([198.47.26.152]:49642 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751155AbaB0OTG (ORCPT ); Thu, 27 Feb 2014 09:19:06 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id s1REIeCX006231; Thu, 27 Feb 2014 08:18:40 -0600 Received: from DLEE70.ent.ti.com (dlemailx.itg.ti.com [157.170.170.113]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1REIeX1000804; Thu, 27 Feb 2014 08:18:40 -0600 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Thu, 27 Feb 2014 08:18:40 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1REIXBd006792; Thu, 27 Feb 2014 08:18:37 -0600 From: Roger Quadros To: , , CC: , , , , , , Roger Quadros , Samuel Ortiz , Tero Kristo Subject: [PATCH v9 1/9] mfd: omap-usb-host: Get clocks based on hardware revision Date: Thu, 27 Feb 2014 16:18:23 +0200 Message-ID: <1393510711-4697-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393510711-4697-1-git-send-email-rogerq@ti.com> References: <1393510711-4697-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: rogerq@ti.com X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.128.182 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Not all revisions have all the clocks so get the necessary clocks based on hardware revision. This should avoid un-necessary clk_get failure messages that were observed earlier. Also remove the dummy USB host clocks from the OMAP3 clock data. These are no longer expected by the driver. CC: Lee Jones CC: Samuel Ortiz CC: Tero Kristo Acked-by: Mike Turquette [OMAP3 CLK data] Signed-off-by: Roger Quadros --- arch/arm/mach-omap2/cclock3xxx_data.c | 4 ---- drivers/clk/ti/clk-3xxx.c | 4 ---- drivers/mfd/omap-usb-host.c | 43 ++++++++++++++++++++++++++--------- 3 files changed, 32 insertions(+), 19 deletions(-) diff --git a/arch/arm/mach-omap2/cclock3xxx_data.c b/arch/arm/mach-omap2/cclock3xxx_data.c index 3b05aea..4299a55 100644 --- a/arch/arm/mach-omap2/cclock3xxx_data.c +++ b/arch/arm/mach-omap2/cclock3xxx_data.c @@ -3495,10 +3495,6 @@ static struct omap_clk omap3xxx_clks[] = { CLK(NULL, "dss_tv_fck", &dss_tv_fck), CLK(NULL, "dss_96m_fck", &dss_96m_fck), CLK(NULL, "dss2_alwon_fck", &dss2_alwon_fck), - CLK(NULL, "utmi_p1_gfclk", &dummy_ck), - CLK(NULL, "utmi_p2_gfclk", &dummy_ck), - CLK(NULL, "xclk60mhsp1_ck", &dummy_ck), - CLK(NULL, "xclk60mhsp2_ck", &dummy_ck), CLK(NULL, "init_60m_fclk", &dummy_ck), CLK(NULL, "gpt1_fck", &gpt1_fck), CLK(NULL, "aes2_ick", &aes2_ick), diff --git a/drivers/clk/ti/clk-3xxx.c b/drivers/clk/ti/clk-3xxx.c index d323023..0d1750a 100644 --- a/drivers/clk/ti/clk-3xxx.c +++ b/drivers/clk/ti/clk-3xxx.c @@ -130,10 +130,6 @@ static struct ti_dt_clk omap3xxx_clks[] = { DT_CLK(NULL, "dss_tv_fck", "dss_tv_fck"), DT_CLK(NULL, "dss_96m_fck", "dss_96m_fck"), DT_CLK(NULL, "dss2_alwon_fck", "dss2_alwon_fck"), - DT_CLK(NULL, "utmi_p1_gfclk", "dummy_ck"), - DT_CLK(NULL, "utmi_p2_gfclk", "dummy_ck"), - DT_CLK(NULL, "xclk60mhsp1_ck", "dummy_ck"), - DT_CLK(NULL, "xclk60mhsp2_ck", "dummy_ck"), DT_CLK(NULL, "init_60m_fclk", "dummy_ck"), DT_CLK(NULL, "gpt1_fck", "gpt1_fck"), DT_CLK(NULL, "aes2_ick", "aes2_ick"), diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c index 0c3c9a0..c63bfdf 100644 --- a/drivers/mfd/omap-usb-host.c +++ b/drivers/mfd/omap-usb-host.c @@ -665,22 +665,43 @@ static int usbhs_omap_probe(struct platform_device *pdev) goto err_mem; } - need_logic_fck = false; + /* Set all clocks as invalid to begin with */ + omap->ehci_logic_fck = ERR_PTR(-ENODEV); + omap->init_60m_fclk = ERR_PTR(-ENODEV); + omap->utmi_p1_gfclk = ERR_PTR(-ENODEV); + omap->utmi_p2_gfclk = ERR_PTR(-ENODEV); + omap->xclk60mhsp1_ck = ERR_PTR(-ENODEV); + omap->xclk60mhsp2_ck = ERR_PTR(-ENODEV); + for (i = 0; i < omap->nports; i++) { - if (is_ehci_phy_mode(i) || is_ehci_tll_mode(i) || - is_ehci_hsic_mode(i)) - need_logic_fck |= true; + omap->utmi_clk[i] = ERR_PTR(-ENODEV); + omap->hsic480m_clk[i] = ERR_PTR(-ENODEV); + omap->hsic60m_clk[i] = ERR_PTR(-ENODEV); } - omap->ehci_logic_fck = ERR_PTR(-EINVAL); - if (need_logic_fck) { - omap->ehci_logic_fck = devm_clk_get(dev, "ehci_logic_fck"); - if (IS_ERR(omap->ehci_logic_fck)) { - ret = PTR_ERR(omap->ehci_logic_fck); - dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret); + /* for OMAP3 i.e. USBHS REV1 */ + if (omap->usbhs_rev == OMAP_USBHS_REV1) { + need_logic_fck = false; + for (i = 0; i < omap->nports; i++) { + if (is_ehci_phy_mode(pdata->port_mode[i]) || + is_ehci_tll_mode(pdata->port_mode[i]) || + is_ehci_hsic_mode(pdata->port_mode[i])) + + need_logic_fck |= true; + } + + if (need_logic_fck) { + omap->ehci_logic_fck = devm_clk_get(dev, + "ehci_logic_fck"); + if (IS_ERR(omap->ehci_logic_fck)) { + ret = PTR_ERR(omap->ehci_logic_fck); + dev_dbg(dev, "ehci_logic_fck failed:%d\n", ret); + } } + goto initialize; } + /* for OMAP4+ i.e. USBHS REV2+ */ omap->utmi_p1_gfclk = devm_clk_get(dev, "utmi_p1_gfclk"); if (IS_ERR(omap->utmi_p1_gfclk)) { ret = PTR_ERR(omap->utmi_p1_gfclk); @@ -748,7 +769,6 @@ static int usbhs_omap_probe(struct platform_device *pdev) } if (is_ehci_phy_mode(pdata->port_mode[0])) { - /* for OMAP3, clk_set_parent fails */ ret = clk_set_parent(omap->utmi_p1_gfclk, omap->xclk60mhsp1_ck); if (ret != 0) @@ -776,6 +796,7 @@ static int usbhs_omap_probe(struct platform_device *pdev) ret); } +initialize: omap_usbhs_init(dev); if (dev->of_node) {