From patchwork Tue Aug 17 00:55:06 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Baryshkov X-Patchwork-Id: 498107 Delivered-To: patch@linaro.org Received: by 2002:a02:6f15:0:0:0:0:0 with SMTP id x21csp606543jab; Mon, 16 Aug 2021 17:55:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQu/bWwfUhcWtguy6Lt/SxHtJWN0nJdJMQmvmk5n86uvoyLIqYv6AJQOyKGFJJTy/1NYCA X-Received: by 2002:a05:6402:10d7:: with SMTP id p23mr1042266edu.74.1629161746869; Mon, 16 Aug 2021 17:55:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629161746; cv=none; d=google.com; s=arc-20160816; b=vWFXq+xH5lcUTJAHc0yqUnY4GRw1TYhb/33r/o9+Fubh/vtcjfv2uSYHFzO82I31k3 xaLgkB730d1H6lyolqY2yY88y1qEJ59ED6GWg5vkkUHOLusVYrQcHobSzzu7ieTJRQg0 q9lZvDlD9ZPFiatLbV409690mIqTxwMV3jrzSy+ufiN8Z48/jaWAXNz4waHND4XkTsHx HoZUVIhJFA0fEJasRkGE+54MHQIRlKubPQUJIEcDUJ4J0KvufOYFqK6ReTV8glNKbb45 e5I+Rg9KnXqIY6yQVjkmAZHTFrkrrPP5YNBDxgOZBOm/LDI0Rc19m9iqZFNy3hSVTX8O UoOA== 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=TpzWYLTlVm4a1u+cpDX/DibFOc/Y83As8pftjQgWXKY=; b=RCjVmBxtgLxsESwb5RQac4Lvoq7O3pCYlR1kUVs6TzmSj1XXkK4X44xSsebF47hdPg Yjg86+cmzjmaiMGng+gS95UWJuUeFbpdVY/qf13VKwFExc6uqLoauGdMuzkwhqCgeCnl yu78tG6itTm5L7yjveKDiSP+Ja3DSYemkBipNC+1HZnkyVxthFnlaXTEiR+yMgU1gGbO sTSdybRTS0l+9GbyMByhTFoE6om60mddK96/wRhS+gC+TpoZ2FSHAoqmhKG9Ycmocz47 mwudHd65FGgbWc9QwQ1tyF4f8y4DF9mhgB3boHHHaYzTluteC5lC2rbOhLPmlR8TJD+Z QuUw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=q9pVfUjj; spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-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 p10si530183ejl.495.2021.08.16.17.55.46; Mon, 16 Aug 2021 17:55:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-mmc-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=q9pVfUjj; spf=pass (google.com: domain of linux-mmc-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-mmc-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 S237077AbhHQA4Q (ORCPT + 3 others); Mon, 16 Aug 2021 20:56:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40086 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236866AbhHQA4K (ORCPT ); Mon, 16 Aug 2021 20:56:10 -0400 Received: from mail-lj1-x22e.google.com (mail-lj1-x22e.google.com [IPv6:2a00:1450:4864:20::22e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E3B31C0611BD for ; Mon, 16 Aug 2021 17:55:25 -0700 (PDT) Received: by mail-lj1-x22e.google.com with SMTP id i28so8805486ljm.7 for ; Mon, 16 Aug 2021 17:55:25 -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=TpzWYLTlVm4a1u+cpDX/DibFOc/Y83As8pftjQgWXKY=; b=q9pVfUjjkZl1dsYvBgGfBt7HOGtu8qETGZwnHj79FxZbGPuB6WTuhL+bUDVxMkCegv WEQR1iewhQkT/FqzCRDxANG/lounhB5oawM+/8Wvjz87lWryGQuJU1Ie+0L8IS/wI9xd 6MQqcTbuWam46/QnO7n0r47+m4ZYylm/I0O1HTHqkqs/KB85IKXpeGKM+en0wo82yZ/W +wePJePJbzKU5tK97xy6yr5AwOC5V53tgIhaJs1E6spLUJAM9eiDG+8iQodQveBAnmPE Cr4OTMeadYhTN6g7Gvg91Z1gyUXuIDc2CvtECs4MkTfSy29nmzr39Mte6ecmEI1CyRtK aeKw== 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=TpzWYLTlVm4a1u+cpDX/DibFOc/Y83As8pftjQgWXKY=; b=IM03sxaDX0ZPiiTYs4IZzI11yFFqBh/G5WO+uz5jQ/NnQL8CeVZZJghxmR9HrLtffX PwGWA4KM4Y6HRmkaDyGLxNFYodNk2CA1tP6dWIP4DiQ3uR2x5JETM6vz/E0VFqACMqjK Ai7CEGJPX/FcyoSomN4GmxIeIZdkLklACPjaOk6iYGKxXb0DiVpHrtqVLqsnmL2Pig8j O7rjwtDkL/gUT7muNjx5DRoVPUxRiHQIN6ANXOf61eYoNsYmH7xoL8hfaK88P/xaLg1N CFCiuQqbc3UgWGjXRCyQ7ao9uY7Si0nCnQx7zqTftipqO0nX6mgVsY3RB7+Ts+4d0gFg xFbw== X-Gm-Message-State: AOAM530HJ/AK1RXhNmUlxhWysWq/YqygA3yFk6HC8iTUFCapVOYIzGgu u/Lq3g3uH/m2QqMbRI1Q7qxwAQ== X-Received: by 2002:a05:651c:1142:: with SMTP id h2mr776331ljo.289.1629161724341; Mon, 16 Aug 2021 17:55:24 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id z6sm40719lfb.251.2021.08.16.17.55.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Aug 2021 17:55:24 -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 PATCH 14/15] WIP: PCI: qcom: use pwrseq to power up bus devices Date: Tue, 17 Aug 2021 03:55:06 +0300 Message-Id: <20210817005507.1507580-15-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210817005507.1507580-1-dmitry.baryshkov@linaro.org> References: <20210817005507.1507580-1-dmitry.baryshkov@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-mmc@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 +++++++++++++ drivers/power/pwrseq/pwrseq_qca.c | 1 + 2 files changed, 14 insertions(+) -- 2.30.2 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); diff --git a/drivers/power/pwrseq/pwrseq_qca.c b/drivers/power/pwrseq/pwrseq_qca.c index 3421a4821126..4107f0a9c05d 100644 --- a/drivers/power/pwrseq/pwrseq_qca.c +++ b/drivers/power/pwrseq/pwrseq_qca.c @@ -1,3 +1,4 @@ +#define DEBUG // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2021, Linaro Ltd.