From patchwork Thu Aug 21 06:45:10 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 35722 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f199.google.com (mail-ob0-f199.google.com [209.85.214.199]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6452420540 for ; Thu, 21 Aug 2014 06:45:48 +0000 (UTC) Received: by mail-ob0-f199.google.com with SMTP id wn1sf53923465obc.2 for ; Wed, 20 Aug 2014 23:45:48 -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=Dn8KzqlPXN1xDJKaNJC1F6mEjie5EhVEMjtN2jeEtJI=; b=TRyrxV54xYbmrUKCxyklYiDYPZw3xIHZIx25tI4P8qah2ZdvC5+ySH1xlzVDOXPJgm R9FXFXV9ciA5zw00P0u2UMEv+eRE/WJW/vGMB8kn/AKY5A95V/rWINE5Pze7JwxuliPi XvFXL9mWA+ErfxtJKbyJeHI4qtcIxEnQDMYsfQRmOxqEmf4GVy10eUSJy2OusaheDsJB 3IdCQ8YrTAepCo3zhSURGMZ+0FNCmalC6B+rcHcPnsNIgGEfbevVizObKtBB8Jj9RjE2 mzpJCn/lUB03v6xiRD0VUJDYwU1RJ6NLwBep8gD/XgCj77gSd9YzR+Ww8Re5Ix3WAqZl 442Q== X-Gm-Message-State: ALoCoQlGJblHubpRtmVIvTNopC+0ZcegQavzF7+xaK+f9JBTD4rJLx2lPi4gmP+0q1wiKyzj6TH5 X-Received: by 10.50.118.100 with SMTP id kl4mr1559054igb.8.1408603548016; Wed, 20 Aug 2014 23:45:48 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.95.21 with SMTP id h21ls582227qge.52.gmail; Wed, 20 Aug 2014 23:45:47 -0700 (PDT) X-Received: by 10.221.61.5 with SMTP id wu5mr40432296vcb.13.1408603547928; Wed, 20 Aug 2014 23:45:47 -0700 (PDT) Received: from mail-vc0-f176.google.com (mail-vc0-f176.google.com [209.85.220.176]) by mx.google.com with ESMTPS id n4si12067441vcf.95.2014.08.20.23.45.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 20 Aug 2014 23:45:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.176 as permitted sender) client-ip=209.85.220.176; Received: by mail-vc0-f176.google.com with SMTP id id10so10176555vcb.21 for ; Wed, 20 Aug 2014 23:45:47 -0700 (PDT) X-Received: by 10.220.247.3 with SMTP id ma3mr37923474vcb.29.1408603547761; Wed, 20 Aug 2014 23:45:47 -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.45.67 with SMTP id uj3csp111696vcb; Wed, 20 Aug 2014 23:45:47 -0700 (PDT) X-Received: by 10.70.36.135 with SMTP id q7mr65487071pdj.79.1408603546886; Wed, 20 Aug 2014 23:45:46 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id kg3si35135180pad.124.2014.08.20.23.45.46 for ; Wed, 20 Aug 2014 23:45:46 -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 S1751430AbaHUGpp (ORCPT + 5 others); Thu, 21 Aug 2014 02:45:45 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:49578 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbaHUGpo (ORCPT ); Thu, 21 Aug 2014 02:45:44 -0400 Received: by mail-pd0-f177.google.com with SMTP id p10so13257176pdj.22 for ; Wed, 20 Aug 2014 23:45:43 -0700 (PDT) X-Received: by 10.70.103.8 with SMTP id fs8mr62740942pdb.81.1408603543901; Wed, 20 Aug 2014 23:45:43 -0700 (PDT) Received: from localhost.localdomain ([117.217.72.158]) by mx.google.com with ESMTPSA id bu2sm24366148pbc.19.2014.08.20.23.45.39 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Aug 2014 23:45:42 -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@linaro.org Subject: [PATCH v3] usb: phy: msm: Make phy_reset clk and reset line optional. Date: Thu, 21 Aug 2014 07:45:10 +0100 Message-Id: <1408603510-16780-1-git-send-email-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1405628200-21776-1-git-send-email-srinivas.kandagatla@linaro.org> References: <1405628200-21776-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.176 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 --- 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. Changes since v2: - rebased patch on top of v3.17-rc1 Thanks, srini drivers/usb/phy/phy-msm-usb.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/usb/phy/phy-msm-usb.c b/drivers/usb/phy/phy-msm-usb.c index e4108ee..7f6aa32 100644 --- a/drivers/usb/phy/phy-msm-usb.c +++ b/drivers/usb/phy/phy-msm-usb.c @@ -281,7 +281,7 @@ static int msm_otg_phy_clk_reset(struct msm_otg *motg) { int ret = 0; - if (motg->pdata->phy_clk_reset && motg->phy_reset_clk) + if (motg->pdata->phy_clk_reset) ret = motg->pdata->phy_clk_reset(motg->phy_reset_clk); else if (motg->phy_rst) ret = reset_control_reset(motg->phy_rst); @@ -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"); - motg->phy_reset_clk = NULL; + + 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");