From patchwork Wed Feb 14 12:06:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 128329 Delivered-To: patch@linaro.org Received: by 10.46.124.24 with SMTP id x24csp535109ljc; Wed, 14 Feb 2018 04:08:34 -0800 (PST) X-Google-Smtp-Source: AH8x2242rYShEqoay76M8D2cncw7/Z7sCnYwtRNJ4kBMurK/Dy63v68Ly78/9tKCCDqztPu44PZ0 X-Received: by 10.99.60.72 with SMTP id i8mr3684271pgn.399.1518610114766; Wed, 14 Feb 2018 04:08:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518610114; cv=none; d=google.com; s=arc-20160816; b=n2zGlzvNKhlh8ikFP41Rjjw3lC6o53E6Oa/egePsR0hf69KR4OrevEBcaknRoMHdjP oTe+7qxWqY7lNZiAguGMkrN7us1zcMZKr0Q17fcp/eNyY4UYln607fgGvEZiqNoQLWYv 9pF0gaJ1fu63jAss6bbD830IkJTX4yH6Kcy3ia3S+an7MYJq21iEOgUHiFuwUnAeEWK3 iZ5mvtknSs0w2n8/dZwOqsaNocU9UyNwXyNpO4poMLSncUppVv/8JZcs9iHKDmyvJQbF rW5ANPDjeUiCe/pMSUJC/sIh8eFMMJ041ygVOiPl1XVtr4kwwtifldgs+C0W5DlwHRGY eyDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=6OsknS+lN0VyF0rZ20R+Tvm4QTk1Z6WcJo9jS1/bBmE=; b=pVr/tRU2THriz+bCeP0a7xRSVyvvYZ+izStkjtj+BYfcCbOTX6yAFa9VUvB3dm68pH NIBswMXs1thIznNkzaVYx5BAhmfaaVvW/aPz9800EZqvNFyKYXl6EVHcqzO3RtM+6woU c+w/CdYiMxdB83RQ287XPa8a9s5eMMEahxk/BRBFLukoHOqw6P2h4D4ggXdKojJquTHl LffIOYDx3XV0NPCKv3mdHqt0TNyyi6jdqI9lin+UO3j95XhlwXigk4qdzmo9WxjeLXxt n1a5YeYccxyUxVbQ6p/Rf0TeKMgQQ+skmrVJnrlDedrHG/dQ+NmeHHTY1upy+wNJjLDq emrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UwdlKI/7; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s10si1237425pgp.43.2018.02.14.04.08.34; Wed, 14 Feb 2018 04:08:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=UwdlKI/7; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754718AbeBNMId (ORCPT + 10 others); Wed, 14 Feb 2018 07:08:33 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:38683 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754616AbeBNMIb (ORCPT ); Wed, 14 Feb 2018 07:08:31 -0500 Received: by mail-wm0-f66.google.com with SMTP id 141so21498318wme.3 for ; Wed, 14 Feb 2018 04:08:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=RqJ3BYVeuYBptkKHwGMwzPtUmYYXpnAW8gG1vbubnuc=; b=UwdlKI/79uvc41k+ybDfLFT+/PYsTrHOPpIY0UNfp9V14HZAO7zTjdf2+G5/JspzWw C8iNqef1twVhWkckVywrdqY6en9zCJBMYknbKHhTuP5i3mJHz+M34s7imVQ7w2wpD3vx veC0QKKSOd8Pi99NBhHNDwdSzO37ya9hqpf1g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=RqJ3BYVeuYBptkKHwGMwzPtUmYYXpnAW8gG1vbubnuc=; b=RtRaJNAXLA8zb1egd7oyHjRtLHTlYuxcHqzQUfpKUNRnbNXy6Lcx7i+LB3eDF69IH9 8epiRPz/WMFmgj7rFUIBU8jh7AAX7KhZEpn4eOiJ47IPJGI4FzQsWNbYgVB5DUByKEKc q4pllJAZ3pWSVcSHa2jys7ktSU95TdVM4GIoFhNzIPW97B/Dj9P1mxXffjqE8NPg2oZX K4TGt1AoEfsxqsD4wfxU4J3q5R4Q7aqjK+a84CT27VoggTitcTanknNQ0k/KgchT66lf e8MvygmiZCgIr4HuiNRLKEY2fGdiD9iE2Fpilkpy8obzHRjQ/PDmW/Ba41Q7I3NOpBXW zV9g== X-Gm-Message-State: APf1xPDVyIyXyrZaReaC88gfBnfNrdjVpGXn47hCtkWXEC6znLaeYjyF oij7zk8GXbk/p+GU1esRkZU0cw== X-Received: by 10.28.174.210 with SMTP id x201mr3740379wme.105.1518610110469; Wed, 14 Feb 2018 04:08:30 -0800 (PST) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id p29sm15665587wmf.9.2018.02.14.04.08.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 14 Feb 2018 04:08:29 -0800 (PST) From: srinivas.kandagatla@linaro.org To: stanimir.varbanov@linaro.org, svarbanov@mm-sol.com, linux-pci@vger.kernel.org, bhelgaas@google.com Cc: linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH v2] PCI: qcom: add missing supplies required for msm8996 Date: Wed, 14 Feb 2018 12:06:16 +0000 Message-Id: <20180214120616.23428-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.15.1 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Srinivas Kandagatla This patch adds supplies that are required for msm8996. vdda is analog supply that go in to controller, and vddpe_3v3 is supply to PCIe endpoint. Without these supplies PCIe endpoints which require power supplies are not enumerated at all, as there is no one to power it up. Signed-off-by: Srinivas Kandagatla --- Changes since v1: - specify only one vddpe as suggested by Stan .../devicetree/bindings/pci/qcom,pcie.txt | 4 ++++ drivers/pci/dwc/pcie-qcom.c | 24 ++++++++++++++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) -- 2.15.1 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/pci/qcom,pcie.txt b/Documentation/devicetree/bindings/pci/qcom,pcie.txt index 3c9d321b3d3b..1fd703bd73e0 100644 --- a/Documentation/devicetree/bindings/pci/qcom,pcie.txt +++ b/Documentation/devicetree/bindings/pci/qcom,pcie.txt @@ -189,6 +189,10 @@ Value type: Definition: A phandle to the analog power supply for IC which generates reference clock +- vddpe-3v3-supply: + Usage: optional + Value type: + Definition: A phandle to the PCIe endpoint power supply - phys: Usage: required for apq8084 diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c index 3e89909f8cb9..519a2ae416eb 100644 --- a/drivers/pci/dwc/pcie-qcom.c +++ b/drivers/pci/dwc/pcie-qcom.c @@ -101,13 +101,14 @@ struct qcom_pcie_resources_1_0_0 { struct reset_control *core; struct regulator *vdda; }; - +#define QCOM_PCIE_2_3_2_MAX_SUPPLY 2 struct qcom_pcie_resources_2_3_2 { struct clk *aux_clk; struct clk *master_clk; struct clk *slave_clk; struct clk *cfg_clk; struct clk *pipe_clk; + struct regulator_bulk_data supplies[QCOM_PCIE_2_3_2_MAX_SUPPLY]; }; struct qcom_pcie_resources_2_4_0 { @@ -521,6 +522,14 @@ static int qcom_pcie_get_resources_2_3_2(struct qcom_pcie *pcie) struct qcom_pcie_resources_2_3_2 *res = &pcie->res.v2_3_2; struct dw_pcie *pci = pcie->pci; struct device *dev = pci->dev; + int ret; + + res->supplies[0].supply = "vdda"; + res->supplies[1].supply = "vddpe-3v3"; + ret = devm_regulator_bulk_get(dev, QCOM_PCIE_2_3_2_MAX_SUPPLY, + res->supplies); + if (ret) + return ret; res->aux_clk = devm_clk_get(dev, "aux"); if (IS_ERR(res->aux_clk)) @@ -550,6 +559,8 @@ static void qcom_pcie_deinit_2_3_2(struct qcom_pcie *pcie) clk_disable_unprepare(res->master_clk); clk_disable_unprepare(res->cfg_clk); clk_disable_unprepare(res->aux_clk); + + regulator_bulk_disable(QCOM_PCIE_2_3_2_MAX_SUPPLY, res->supplies); } static void qcom_pcie_post_deinit_2_3_2(struct qcom_pcie *pcie) @@ -567,10 +578,16 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie) u32 val; int ret; + ret = regulator_bulk_enable(QCOM_PCIE_2_3_2_MAX_SUPPLY, res->supplies); + if (ret < 0) { + dev_err(dev, "cannot enable regulators\n"); + return ret; + } + ret = clk_prepare_enable(res->aux_clk); if (ret) { dev_err(dev, "cannot prepare/enable aux clock\n"); - return ret; + goto err_aux_clk; } ret = clk_prepare_enable(res->cfg_clk); @@ -621,6 +638,9 @@ static int qcom_pcie_init_2_3_2(struct qcom_pcie *pcie) err_cfg_clk: clk_disable_unprepare(res->aux_clk); +err_aux_clk: + regulator_bulk_disable(QCOM_PCIE_2_3_2_MAX_SUPPLY, res->supplies); + return ret; }