From patchwork Sun Aug 29 13:13:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 504051 Delivered-To: patch@linaro.org Received: by 2002:a02:8629:0:0:0:0:0 with SMTP id e38csp926822jai; Sun, 29 Aug 2021 06:13:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUX63Dd09gPCnLTgFfMHMfIoam5kSGkq0fvbPD9BjAww3K2wPMliX6+KGOey4hwWzDzmNZ X-Received: by 2002:a17:906:abd7:: with SMTP id kq23mr5217906ejb.542.1630242814153; Sun, 29 Aug 2021 06:13:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630242814; cv=none; d=google.com; s=arc-20160816; b=Qvp2VjJOLfJnGvfYkPpdtmrZlFyLdJG4hsw+tCXzDaa33SdGK2tQztDebQdmmmGZ29 +wpNzTHumTiW+bpaPQ7GmGhn7DcfoiFp6Hp4UNXCOeT7U3JKYdC6gr0JEQ+tCOQy79+e gQSmapM+RYCjIWrwC9LbyMFsH7t4zHAkuZ6KF962VCmIMhpy/LIlHAaemA2giaogklue PFWxB+QxEqMFKb1nfVscU1OpQHgu3Sti8uKK+LhSf3lL53q8W+O2euj76lisqSHmj5ZC Ano0uKfpx7ZDuo9SwsbHHcAGX9sR71o9s1Kk4rD927WG+VOay9oGLbfYXdFTWXcMI7Il N5Eg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=V1qCDwrnxZyyxD18n557PC/vv86td/OsZqjd5RQRW8E=; b=SYdSgehpF+zxKgcLmbTzmCVFd6zsbOK4RZSkCWvgr3mZ8AMFcueQJqZwikep/ppN6Z qd0ETDolPgvaZngZQoaoClbZVdpdjIqC51LEwzn69ScFmLwd4K+WYq7iFeV8+YJ66ubw 6CgKYlYC7fbvSmZDIdiOxrTpel4g816w/jhDk+fQDAx3FTjPXG+wiEKzaReSNElKYnss DuZ5Tlu+R7pjbTfoyO19riU/UEQWMWPo4Addqa7ZAmlF1KhFXo2teVY147m6rwSyETnd hROFoRE2wlzqjAYR58IfltPgDQEoL3F9HLWcHtCCrQuYscB/m5Fn42hcCmpeO9jVSO2Y FYeA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jdppaH2W; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q21si12161065eds.318.2021.08.29.06.13.32; Sun, 29 Aug 2021 06:13:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jdppaH2W; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235564AbhH2NOU (ORCPT + 16 others); Sun, 29 Aug 2021 09:14:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235546AbhH2NON (ORCPT ); Sun, 29 Aug 2021 09:14:13 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5744C06175F for ; Sun, 29 Aug 2021 06:13:20 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id c8so12700066lfi.3 for ; Sun, 29 Aug 2021 06:13:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=V1qCDwrnxZyyxD18n557PC/vv86td/OsZqjd5RQRW8E=; b=jdppaH2W155GXBSpK9HAC3zcOJOHlIf4pWlevT2rBJaK2K4RL+tfztI/UYo+hW4cPu 0zCBlJzfpZvZj5m49gAwW6XfSPo+3ZkEpXYllog2PoKxHmBFWhLtG8Dn9SbQIwAHybEc veVLg9MOR1ETsT8FRVvJsnXX3ycN6piz2/RRZPfzd7VtITuX8/MCDHPs4EWcU8GKlDcV s0kPsKiT32JfX+QUOuxxOqCGgHG13Oe/BqgWg6sR611svTU2nBGGnU8oZFHMfpblERBX gM/UYdNj5mANmoAj5JXOMPo4p4426dnQEYXtW3pOafe0PvMn5iNnRorLXgzf56ZUBPJ0 WJSg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=V1qCDwrnxZyyxD18n557PC/vv86td/OsZqjd5RQRW8E=; b=dO4lflCyhtnwGKW9Rf5qC51W9f/aDv5LdGmiAfZbIu2r8Lq+j/dRZ+rWFQdNgw9euW kKN4K2HSjKwlWX+SdVBn1WXbc1uJwOetdAN6Gz3egl3EkYfDDp1NgC+7q1diueCw+1+T sq0LEh535MM3UIx+cn7W9jWRT6NZ0hv1Aszn3NJrMCpRdrqxMIeN09H2RsFrkspOVmhT +h9plWc4vMu3vn2xYKf4RNYgo+sOtNl+dkt6TPSS5N0WKROhZ0boVGi/N/YzpKzNNveZ r7pSvNL1J6FdF1KvZ8zQB2b90pLH4TyMDKmk/vNXMIxTh2nCdOus4WFJwFYUzeHOU/vm 3wJw== X-Gm-Message-State: AOAM5308Yh8JGr9/gK6lfvpEYU+dq9PljVWCy0G19kvrb9+gqbfF/Kvh fr1cv3Oq3F/00FQXtKujVgTOUA== X-Received: by 2002:a05:6512:e99:: with SMTP id bi25mr13658144lfb.486.1630242799230; Sun, 29 Aug 2021 06:13:19 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id x13sm712503lfq.262.2021.08.29.06.13.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 29 Aug 2021 06:13:18 -0700 (PDT) From: Dmitry Baryshkov To: Andy Gross , Bjorn Andersson , Ulf Hansson , Marcel Holtmann , Johan Hedberg , Luiz Augusto von Dentz , Kalle Valo , "David S. Miller" , Jakub Kicinski , Stanimir Varbanov Cc: linux-arm-msm@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-bluetooth@vger.kernel.org, ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org Subject: [RFC v2 12/13] WIP: PCI: qcom: use pwrseq to power up bus devices Date: Sun, 29 Aug 2021 16:13:04 +0300 Message-Id: <20210829131305.534417-13-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210829131305.534417-1-dmitry.baryshkov@linaro.org> References: <20210829131305.534417-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Use bus-pwrseq device tree node to power up the devices on the bus. This is to be rewritten with the proper code parsing the device tree and powering up individual devices. Signed-off-by: Dmitry Baryshkov --- drivers/pci/controller/dwc/pcie-qcom.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.33.0 diff --git a/drivers/pci/controller/dwc/pcie-qcom.c b/drivers/pci/controller/dwc/pcie-qcom.c index 8a7a300163e5..a60d41fbcd6f 100644 --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -1467,6 +1468,7 @@ static int qcom_pcie_probe(struct platform_device *pdev) struct pcie_port *pp; struct dw_pcie *pci; struct qcom_pcie *pcie; + struct pwrseq *pwrseq; int ret; pcie = devm_kzalloc(dev, sizeof(*pcie), GFP_KERNEL); @@ -1520,6 +1522,17 @@ static int qcom_pcie_probe(struct platform_device *pdev) pp->ops = &qcom_pcie_dw_ops; + pwrseq = devm_pwrseq_get_optional(dev, "bus"); + if (IS_ERR(pwrseq)) { + ret = PTR_ERR(pwrseq); + goto err_pm_runtime_put; + } + if (pwrseq) { + ret = pwrseq_full_power_on(pwrseq); + if (ret) + goto err_pm_runtime_put; + } + ret = phy_init(pcie->phy); if (ret) { pm_runtime_disable(&pdev->dev);