From patchwork Thu Feb 20 11:39:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 25034 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qa0-f69.google.com (mail-qa0-f69.google.com [209.85.216.69]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 7A0A4203C6 for ; Thu, 20 Feb 2014 11:41:27 +0000 (UTC) Received: by mail-qa0-f69.google.com with SMTP id w8sf3235492qac.4 for ; Thu, 20 Feb 2014 03:41:27 -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=ocRLbJnBROsOjhDvaCoqPMYN3UvFwnQbD21St/qvO+8=; b=mLGY2/2w0AZ4tcQq7XwJ6Ytrmqm/1rube7CY4Bh6HhzcTXw87tkAaaWojzNaYINPtl rOvrw4MrTgOGlBCfgeR0Ptcnf7vR209Qq5PnS9AQNN0l6L497P/N489L1ClZvWfRREOW OXnEdOPNaWew/j96j26pU1Z7SLFS7Z/HJytMSA0PhDC+j13vuf6/7ceVZYlx0kyM/x3w t9L8sQpXcI3Fxp73BByVHg7zwp3fpt5kPmFmndq5/HE45Ljeuu3E69QEIFl4AaHIAxX+ kLKp21dknbehGnWlho3MnYQ4SJ907pB7lTj1wubbMwYaTfifMxH3Dq/P49CR3XdrBh6k 5CKw== X-Gm-Message-State: ALoCoQm51Vvpt4HcYY7VB5HeCmUTDpE7fGCVIXAkaZVYNGbNtjMgg1yxKkWYCdKscZ3QWI9E1Iu/ X-Received: by 10.52.179.138 with SMTP id dg10mr485202vdc.2.1392896487169; Thu, 20 Feb 2014 03:41:27 -0800 (PST) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.24.215 with SMTP id 81ls497027qgr.14.gmail; Thu, 20 Feb 2014 03:41:27 -0800 (PST) X-Received: by 10.221.27.194 with SMTP id rr2mr742343vcb.60.1392896487051; Thu, 20 Feb 2014 03:41:27 -0800 (PST) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id uw4si1354327vdc.14.2014.02.20.03.41.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 20 Feb 2014 03:41:27 -0800 (PST) Received-SPF: neutral (google.com: 209.85.220.176 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id la4so1698117vcb.7 for ; Thu, 20 Feb 2014 03:41:27 -0800 (PST) X-Received: by 10.221.26.10 with SMTP id rk10mr778049vcb.0.1392896486961; Thu, 20 Feb 2014 03:41:26 -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 u4csp51676vcz; Thu, 20 Feb 2014 03:41:26 -0800 (PST) X-Received: by 10.68.143.196 with SMTP id sg4mr1342240pbb.155.1392896485450; Thu, 20 Feb 2014 03:41:25 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yn4si3075503pab.226.2014.02.20.03.41.24; Thu, 20 Feb 2014 03:41:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of devicetree-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 S1753158AbaBTLlO (ORCPT + 9 others); Thu, 20 Feb 2014 06:41:14 -0500 Received: from arroyo.ext.ti.com ([192.94.94.40]:52942 "EHLO arroyo.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752928AbaBTLkt (ORCPT ); Thu, 20 Feb 2014 06:40:49 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by arroyo.ext.ti.com (8.13.7/8.13.7) with ESMTP id s1KBeKSM018864; Thu, 20 Feb 2014 05:40:20 -0600 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1KBeK8m023139; Thu, 20 Feb 2014 05:40:20 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.3.174.1; Thu, 20 Feb 2014 05:40:19 -0600 Received: from localhost.localdomain (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id s1KBeDwU007718; Thu, 20 Feb 2014 05:40:17 -0600 From: Roger Quadros To: , , CC: , , , , , , , , Roger Quadros , Samuel Ortiz Subject: [PATCH v8 01/14] mfd: omap-usb-host: Get clocks based on hardware revision Date: Thu, 20 Feb 2014 13:39:56 +0200 Message-ID: <1392896409-5101-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1392896409-5101-1-git-send-email-rogerq@ti.com> References: <1392896409-5101-1-git-send-email-rogerq@ti.com> MIME-Version: 1.0 Sender: devicetree-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: devicetree@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.220.176 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. CC: Lee Jones CC: Samuel Ortiz Signed-off-by: Roger Quadros --- drivers/mfd/omap-usb-host.c | 43 ++++++++++++++++++++++++++++++++----------- 1 file changed, 32 insertions(+), 11 deletions(-) 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) {