From patchwork Mon Jun 30 17:29:49 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 32788 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-qg0-f71.google.com (mail-qg0-f71.google.com [209.85.192.71]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id ACA0A203F4 for ; Mon, 30 Jun 2014 17:29:57 +0000 (UTC) Received: by mail-qg0-f71.google.com with SMTP id f51sf5604644qge.2 for ; Mon, 30 Jun 2014 10:29:57 -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=0ZBDNNShaKtqoFCl5Z+koBVgD+rA6uEdrbIUx/lb/Ug=; b=Zg04DP/002q0hvHUopZJp3U/36DlB4pLmkGVqKqHHg3at08FSy0ERv6Q7lHMfVae7p Qaz0kuz/AmfiPvS9HotMbPoBOvRhtNiFg0MQZkT61FP3ofM2OmAMj1qKj8A+cxlQ5XVA n/fzRNayKSRpuN1FZ8OjfeTNBfK5YwSuYPq9TkoCl8OBgVr6Bjuf4UnZAn2oCe7aRS3b jifJz67BbGyzz6A42WVNkEWeDAOXbHeBI2Q3r+F/ZEfj+UKrJEE7OI6tYfPCJWgRL3L8 ebXHT5Rihw+ztkXA8+XyR2Pq+mPZhD8sWk13kj1MfE6PdvNRNVsoqmedhHfoby7ByYGZ N99Q== X-Gm-Message-State: ALoCoQm3xB//kNX2FiNdZ5MC3nINrhWOka0S0atVDpRouJAv7S6Y4kcqdo5SaPvXra8JzCXS4zIo X-Received: by 10.58.229.227 with SMTP id st3mr21748353vec.5.1404149397525; Mon, 30 Jun 2014 10:29:57 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.30.165 with SMTP id d34ls1665996qgd.25.gmail; Mon, 30 Jun 2014 10:29:57 -0700 (PDT) X-Received: by 10.58.236.170 with SMTP id uv10mr4773416vec.31.1404149397428; Mon, 30 Jun 2014 10:29:57 -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 g6si8285642vcn.29.2014.06.30.10.29.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 30 Jun 2014 10:29:57 -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 id10so7832482vcb.2 for ; Mon, 30 Jun 2014 10:29:57 -0700 (PDT) X-Received: by 10.58.112.65 with SMTP id io1mr1777678veb.61.1404149397359; Mon, 30 Jun 2014 10:29:57 -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 tc5csp156889vcb; Mon, 30 Jun 2014 10:29:56 -0700 (PDT) X-Received: by 10.68.229.68 with SMTP id so4mr53155295pbc.110.1404149396669; Mon, 30 Jun 2014 10:29:56 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id sv10si23856365pab.201.2014.06.30.10.29.56; Mon, 30 Jun 2014 10:29:56 -0700 (PDT) Received-SPF: none (google.com: linux-usb-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 S1756139AbaF3R3z (ORCPT + 3 others); Mon, 30 Jun 2014 13:29:55 -0400 Received: from mail-we0-f179.google.com ([74.125.82.179]:51381 "EHLO mail-we0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754315AbaF3R3y (ORCPT ); Mon, 30 Jun 2014 13:29:54 -0400 Received: by mail-we0-f179.google.com with SMTP id w62so8523085wes.10 for ; Mon, 30 Jun 2014 10:29:53 -0700 (PDT) X-Received: by 10.180.76.134 with SMTP id k6mr2739119wiw.49.1404149393328; Mon, 30 Jun 2014 10:29:53 -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 d4sm16033180wik.20.2014.06.30.10.29.52 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Jun 2014 10:29:52 -0700 (PDT) From: Srinivas Kandagatla To: linux-usb@vger.kernel.org, Felipe Balbi Cc: gregkh@linuxfoundation.org, linux-arm-msm@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v1 2/3] usb: phy: msm: Make phy_reset clk and reset line optional. Date: Mon, 30 Jun 2014 18:29:49 +0100 Message-Id: <1404149389-11928-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1404149311-11831-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1404149311-11831-1-git-send-email-srinivas.kandagatla@linaro.org> Sender: linux-usb-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-usb@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");