From patchwork Wed Jun 18 17:01:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 32150 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-yk0-f200.google.com (mail-yk0-f200.google.com [209.85.160.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E32A6206A0 for ; Wed, 18 Jun 2014 17:01:13 +0000 (UTC) Received: by mail-yk0-f200.google.com with SMTP id 20sf2346605yks.7 for ; Wed, 18 Jun 2014 10:01:13 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=jJxxO76LOTyfoum/3Ic8MpvdnRAjgLfYmIqFwrhStNc=; b=RINS/kCcCIAO3RcmYTGBFzTqiQ3sTsw1svCOF6ENbnri+VQharnLaIa6bDh10EnQx5 cvXd8CPgfFyMTq8GkQZ3tX4casQbTM4ThPdDWsjvMjkslFyxtgXIWdnh44lRkMJc/j7B CqnHEsGDcfyVogUPTHgWDcxuqqMI7mCpu15OGbz85y5HTfzPc7hI/QMrX98eLuVvksE2 FfWtcnN/0rzwnvv+vME4xoBadFYWLtag3fqqnXyuhupy6IGPU1xkVobV8ug/zquptvgZ wx6PlrbcYejAe/E2zTmhxOvWcLK5Ia1AQ2Ma4xzoP2fUyEJCbiiOO7qkrtSJ+IDsec/E NM3w== X-Gm-Message-State: ALoCoQmAtD3dFk7n0TrxeF+bIYNRoSNWhvdvYzkBJJjCMoO5SQ1XFFiYUVDGAw/fyc3soSCKvXfG X-Received: by 10.236.175.42 with SMTP id y30mr24992yhl.42.1403110873742; Wed, 18 Jun 2014 10:01:13 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.84.72 with SMTP id k66ls186005qgd.96.gmail; Wed, 18 Jun 2014 10:01:13 -0700 (PDT) X-Received: by 10.58.30.1 with SMTP id o1mr2294866veh.37.1403110873598; Wed, 18 Jun 2014 10:01:13 -0700 (PDT) Received: from mail-vc0-f171.google.com (mail-vc0-f171.google.com [209.85.220.171]) by mx.google.com with ESMTPS id b5si1146652vec.50.2014.06.18.10.01.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 18 Jun 2014 10:01:13 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.171 as permitted sender) client-ip=209.85.220.171; Received: by mail-vc0-f171.google.com with SMTP id id10so1076368vcb.16 for ; Wed, 18 Jun 2014 10:01:13 -0700 (PDT) X-Received: by 10.58.168.146 with SMTP id zw18mr2292138veb.32.1403110873514; Wed, 18 Jun 2014 10:01:13 -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.54.6 with SMTP id vs6csp299920vcb; Wed, 18 Jun 2014 10:01:13 -0700 (PDT) X-Received: by 10.67.30.97 with SMTP id kd1mr4096851pad.15.1403110872677; Wed, 18 Jun 2014 10:01:12 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id pw11si2809432pab.184.2014.06.18.10.01.12; Wed, 18 Jun 2014 10:01:12 -0700 (PDT) Received-SPF: none (google.com: linux-arm-msm-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 S1753615AbaFRRBH (ORCPT + 3 others); Wed, 18 Jun 2014 13:01:07 -0400 Received: from mail-wg0-f48.google.com ([74.125.82.48]:58858 "EHLO mail-wg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753557AbaFRRBF (ORCPT ); Wed, 18 Jun 2014 13:01:05 -0400 Received: by mail-wg0-f48.google.com with SMTP id n12so1161467wgh.7 for ; Wed, 18 Jun 2014 10:01:04 -0700 (PDT) X-Received: by 10.180.38.107 with SMTP id f11mr6860785wik.59.1403110864445; Wed, 18 Jun 2014 10:01:04 -0700 (PDT) Received: from srini-ThinkPad-X1-Carbon-2nd.dlink.com (host-2-99-228-46.as13285.net. [2.99.228.46]) by mx.google.com with ESMTPSA id hs8sm26600681wib.10.2014.06.18.10.01.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Jun 2014 10:01:03 -0700 (PDT) From: Srinivas Kandagatla To: linux-usb@vger.kernel.org Cc: Felipe Balbi , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [RFC PATCH 2/3] usb: phy: msm: Make phy_reset clk and reset line optional. Date: Wed, 18 Jun 2014 18:01:00 +0100 Message-Id: <1403110860-3883-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1403110801-3790-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1403110801-3790-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-arm-msm@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.171 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. Signed-off-by: Srinivas Kandagatla --- drivers/usb/phy/phy-msm-usb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index ced34f3..3bb559d 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) + if (motg->pdata->phy_clk_reset && motg->phy_reset_clk) 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) @@ -1464,7 +1464,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) @@ -1556,7 +1556,7 @@ static int msm_otg_probe(struct platform_device *pdev) 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); + motg->phy_reset_clk = NULL; } motg->clk = devm_clk_get(&pdev->dev, np ? "core" : "usb_hs_clk");