From patchwork Thu Jul 17 20:16:40 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 33810 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-oa0-f70.google.com (mail-oa0-f70.google.com [209.85.219.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 1E2DB20CA0 for ; Thu, 17 Jul 2014 20:17:20 +0000 (UTC) Received: by mail-oa0-f70.google.com with SMTP id eb12sf7386400oac.9 for ; Thu, 17 Jul 2014 13:17:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=335hcgiY+omoQU7emVKeGlzWcO2jsyehD7nWQHFe/rw=; b=COu+PDMKh9VDmQK0GMWU6kIuNNYt7JhfV28lbSmZQCDVETzRPGdTlEbO9l0K19jk6U MLRws3yLmOdO1GEactNfbbjyoZA1Bc6MUD+i7NiP2862B8uoB3d9tjMhLtVXZSItJAvl ZKTcc8BoCxFPbN5ZKFfeU7t+IxtjZg70za6HO7LfjhqnBqnAuL2eEuaTdwCg/6/foHg5 Qqv8qtxvoM6PaYJnrssuV3s1lOqg10EUtqOwsUBqfH+LMMXYjqp91vqoJpqWE0/7IUbS WzCpfKyTWD0DsDZljLUyErTvgjoOSibcNAL6DX0UoP2njIXkLHBtmnNv3UDOcTzxFWRi puXA== X-Gm-Message-State: ALoCoQlfNxTQEDYY3ypY2JaNEC8Aqd1l/T+CzC/uYjE//OyGhgX3541pWNMMbxa9bGAlvQ7QPLde X-Received: by 10.182.197.204 with SMTP id iw12mr18572398obc.17.1405628239629; Thu, 17 Jul 2014 13:17:19 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.91.201 with SMTP id z67ls794874qgd.94.gmail; Thu, 17 Jul 2014 13:17:19 -0700 (PDT) X-Received: by 10.236.88.225 with SMTP id a61mr65911434yhf.2.1405628239512; Thu, 17 Jul 2014 13:17:19 -0700 (PDT) Received: from mail-vc0-f182.google.com (mail-vc0-f182.google.com [209.85.220.182]) by mx.google.com with ESMTPS id o67si9482591yhb.88.2014.07.17.13.17.19 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 17 Jul 2014 13:17:19 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) client-ip=209.85.220.182; Received: by mail-vc0-f182.google.com with SMTP id hy4so5769029vcb.13 for ; Thu, 17 Jul 2014 13:17:19 -0700 (PDT) X-Received: by 10.221.26.10 with SMTP id rk10mr43601689vcb.0.1405628239132; Thu, 17 Jul 2014 13:17:19 -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.221.37.5 with SMTP id tc5csp64345vcb; Thu, 17 Jul 2014 13:17:18 -0700 (PDT) X-Received: by 10.66.240.38 with SMTP id vx6mr31512282pac.66.1405628237076; Thu, 17 Jul 2014 13:17:17 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id qz5si3451296pbb.179.2014.07.17.13.17.16; Thu, 17 Jul 2014 13:17:16 -0700 (PDT) Received-SPF: none (google.com: linux-kernel-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 S1755112AbaGQURD (ORCPT + 22 others); Thu, 17 Jul 2014 16:17:03 -0400 Received: from mail-wi0-f180.google.com ([209.85.212.180]:56256 "EHLO mail-wi0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754384AbaGQURA (ORCPT ); Thu, 17 Jul 2014 16:17:00 -0400 Received: by mail-wi0-f180.google.com with SMTP id n3so3418985wiv.7 for ; Thu, 17 Jul 2014 13:16:58 -0700 (PDT) X-Received: by 10.194.63.196 with SMTP id i4mr49456780wjs.50.1405628218593; Thu, 17 Jul 2014 13:16:58 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-2-99-226-247.as13285.net. [2.99.226.247]) by mx.google.com with ESMTPSA id fc7sm8535178wjc.37.2014.07.17.13.16.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Jul 2014 13:16:57 -0700 (PDT) From: Srinivas Kandagatla To: Felipe Balbi Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2] usb: phy: msm: Make phy_reset clk and reset line optional. Date: Thu, 17 Jul 2014 21:16:40 +0100 Message-Id: <1405628200-21776-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: srinivas.kandagatla@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.182 as permitted sender) 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: , This patch makes the phy reset clk and reset line optional as this clk is not available on boards like IFC6410 with APQ8064. phy-reset clk is only used as argument to the mach level callbacks, so this patch adds condition before clk_get calls so that the driver wouldn't fail on SOCs which do not have this support. Signed-off-by: Srinivas Kandagatla tested-by: Prakash Burla --- Hi Felipe, With this new patch now the error message is only printed if the SOC actually supports the phy reset clk, for SOCs like APQ8064 where there is no phy reset clock or the callback which takes it there is no point in doing a clk_get call in the first place. Thanks, srini drivers/usb/phy/phy-msm-usb.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index c929370..aa8e2b9 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -279,11 +279,11 @@ static int msm_otg_link_clk_reset(struct msm_otg *motg, bool assert) static int msm_otg_phy_clk_reset(struct msm_otg *motg) { - int ret; + int ret = 0; if (motg->pdata->phy_clk_reset) ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk); - else + else if (motg->phy_rst) ret = reset_control_reset(motg->phy_rst); if (ret) @@ -1466,7 +1466,7 @@ static int msm_otg_read_dt(struct platform_device *pdev, struct msm_otg *motg) motg->phy_rst = devm_reset_control_get(&pdev->dev, "phy"); if (IS_ERR(motg->phy_rst)) - return PTR_ERR(motg->phy_rst); + motg->phy_rst = NULL; pdata->mode = of_usb_get_dr_mode(node); if (pdata->mode == USB_DR_MODE_UNKNOWN) @@ -1554,11 +1554,14 @@ static int msm_otg_probe(struct platform_device *pdev) phy = &motg->phy; phy->dev = &pdev->dev; - motg->phy_reset_clk = devm_clk_get(&pdev->dev, + if (motg->pdata->phy_clk_reset) { + motg->phy_reset_clk = devm_clk_get(&pdev->dev, np ? "phy" : "usb_phy_clk"); - if (IS_ERR(motg->phy_reset_clk)) { - dev_err(&pdev->dev, "failed to get usb_phy_clk\n"); - return PTR_ERR(motg->phy_reset_clk); + + if (IS_ERR(motg->phy_reset_clk)) { + dev_err(&pdev->dev, "failed to get usb_phy_clk\n"); + return PTR_ERR(motg->phy_reset_clk); + } } motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");