From patchwork Mon May 5 09:54:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 29636 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f198.google.com (mail-ob0-f198.google.com [209.85.214.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B033B202E6 for ; Mon, 5 May 2014 09:55:01 +0000 (UTC) Received: by mail-ob0-f198.google.com with SMTP id va2sf26907245obc.1 for ; Mon, 05 May 2014 02:55:01 -0700 (PDT) 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=Odyk0hcX4oZse8hB/GWpm/IWddrEJ0/wO0pkMSotJZ0=; b=MIEiBoSh0gTKA1lfCpwzfpKQeEjY/c5dFeoi9TqF+2Hazot8Uyl1q3IU+jNrnojNDr mHeW9zoDk7fzMFva1Zk5s0VqouH1SlFbP+epxZtQ83nLJC2RvmAQM5W8oei99G9ycXqV UuHC5SUMn9+A7fe6Bs58roQ81fZqBwanh5a5ZyyBvx8uzZNW2P3nkN9DcW33KlDjTLWz xMlITDlpVGzDeQp7M08eyp1LcVZQ7Th1M66TAr+Nr42bYG6VyuJxohlIDFnajYyEnPHD NLJEsjCVUjzpC2Rjc32gu/ioEA470QfSyqp/aoSCBsH9jyX/AV4Au7t+tEgk9Dy2ZYgO es4A== X-Gm-Message-State: ALoCoQly6DXoN6BNDRAnlDm1+A/Ej3fsv4q66YV7ukdMtzLETZa0WYESja5m8cYuF3beAHDaP0ez X-Received: by 10.182.137.233 with SMTP id ql9mr2778279obb.46.1399283701317; Mon, 05 May 2014 02:55:01 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.84 with SMTP id h78ls2243776qge.54.gmail; Mon, 05 May 2014 02:55:01 -0700 (PDT) X-Received: by 10.52.119.178 with SMTP id kv18mr366737vdb.39.1399283701185; Mon, 05 May 2014 02:55:01 -0700 (PDT) Received: from mail-vc0-f170.google.com (mail-vc0-f170.google.com [209.85.220.170]) by mx.google.com with ESMTPS id tz5si1435312vdc.115.2014.05.05.02.55.01 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 05 May 2014 02:55:01 -0700 (PDT) Received-SPF: none (google.com: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) client-ip=209.85.220.170; Received: by mail-vc0-f170.google.com with SMTP id lf12so704212vcb.29 for ; Mon, 05 May 2014 02:55:01 -0700 (PDT) X-Received: by 10.220.69.72 with SMTP id y8mr27467571vci.21.1399283701064; Mon, 05 May 2014 02:55:01 -0700 (PDT) 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.221.72 with SMTP id ib8csp126999vcb; Mon, 5 May 2014 02:55:00 -0700 (PDT) X-Received: by 10.66.181.70 with SMTP id du6mr69183357pac.23.1399283700131; Mon, 05 May 2014 02:55:00 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xy8si7953798pab.283.2014.05.05.02.54.59; Mon, 05 May 2014 02:54:59 -0700 (PDT) Received-SPF: none (google.com: devicetree-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756068AbaEEJy6 (ORCPT + 8 others); Mon, 5 May 2014 05:54:58 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:60928 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756010AbaEEJy5 (ORCPT ); Mon, 5 May 2014 05:54:57 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s459stKX031613; Mon, 5 May 2014 04:54:55 -0500 Received: from DLEE71.ent.ti.com (dlee71.ent.ti.com [157.170.170.114]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id s459sto4015169; Mon, 5 May 2014 04:54:55 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE71.ent.ti.com (157.170.170.114) with Microsoft SMTP Server id 14.3.174.1; Mon, 5 May 2014 04:54:54 -0500 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 s459smBg007282; Mon, 5 May 2014 04:54:52 -0500 From: Roger Quadros To: , , , CC: , , , , , , Roger Quadros Subject: [PATCH v3 1/7] phy: omap-usb2: Use generic clock names "wkupclk" and "refclk" Date: Mon, 5 May 2014 12:54:40 +0300 Message-ID: <1399283686-6127-2-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1399283686-6127-1-git-send-email-rogerq@ti.com> References: <1399283686-6127-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: patch+caf_=patchwork-forward=linaro.org@linaro.org does not designate permitted sender hosts) 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: , As clocks might be named differently on multiple platforms, use a generic name in the driver and allow device tree node to specify the platform specific clock name. Signed-off-by: Roger Quadros Reviewed-by: Felipe Balbi --- drivers/phy/phy-omap-usb2.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/drivers/phy/phy-omap-usb2.c b/drivers/phy/phy-omap-usb2.c index a2205a8..7007c11 100644 --- a/drivers/phy/phy-omap-usb2.c +++ b/drivers/phy/phy-omap-usb2.c @@ -275,18 +275,34 @@ static int omap_usb2_probe(struct platform_device *pdev) if (IS_ERR(phy_provider)) return PTR_ERR(phy_provider); - phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k"); + phy->wkupclk = devm_clk_get(phy->dev, "wkupclk"); if (IS_ERR(phy->wkupclk)) { - dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n"); - return PTR_ERR(phy->wkupclk); + dev_warn(&pdev->dev, "unable to get wkupclk, trying old name\n"); + phy->wkupclk = devm_clk_get(phy->dev, "usb_phy_cm_clk32k"); + if (IS_ERR(phy->wkupclk)) { + dev_err(&pdev->dev, "unable to get usb_phy_cm_clk32k\n"); + return PTR_ERR(phy->wkupclk); + } else { + dev_warn(&pdev->dev, + "found usb_phy_cm_clk32k, please fix DTS\n"); + } } clk_prepare(phy->wkupclk); - phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m"); - if (IS_ERR(phy->optclk)) - dev_vdbg(&pdev->dev, "unable to get refclk960m\n"); - else + phy->optclk = devm_clk_get(phy->dev, "refclk"); + if (IS_ERR(phy->optclk)) { + dev_dbg(&pdev->dev, "unable to get refclk, trying old name\n"); + phy->optclk = devm_clk_get(phy->dev, "usb_otg_ss_refclk960m"); + if (IS_ERR(phy->optclk)) { + dev_dbg(&pdev->dev, + "unable to get usb_otg_ss_refclk960m\n"); + } else { + dev_warn(&pdev->dev, + "found usb_otg_ss_refclk960m, please fix DTS\n"); + } + } else { clk_prepare(phy->optclk); + } usb_add_phy_dev(&phy->phy);