From patchwork Wed Oct 6 03:54: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: 515284 Delivered-To: patch@linaro.org Received: by 2002:ac0:890a:0:0:0:0:0 with SMTP id 10csp155828imy; Tue, 5 Oct 2021 20:56:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzs2GSCmTd3i3AEZp5sU/XY8zfhIjnXG65BB8X+T9Fe6IpgnBK3fFyHEsTUlP8FGi3aposQ X-Received: by 2002:a50:8405:: with SMTP id 5mr31116870edp.228.1633492592395; Tue, 05 Oct 2021 20:56:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633492592; cv=none; d=google.com; s=arc-20160816; b=yGl3HWh4rBWixqqPYa2owb5H/7/8q2WZgLpIe1E8CYrC7YpRFCz3PsVFrB9/TmVH75 k8TjDofebCm8Wn2OK/Z4NffWYQvd28gTltD5FbhxRCe3+mX3Dne1RG9fN8oCCrjtes6m n4gI9PFJFBgOSCpyBPq2dXnQ3SKllKJSt52mYTibs2CzwMeGpy07Isf93v0TJ700g7Jz l5EZW05r4QkwbtT12QfJRY1G53cPklRqFgPPS46ncIz8C2KqdwK7p01QcjaQT0Q6OQi+ 4VPUHQxyhPkJbCR7gPsL9iomaUMwWL1snNnM5tm91IAaHDCfFdPTTtjZSPIPNbu1sCae uwSA== 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=cntTQV+8xT1gaPRWwmEttMqurpErGQCflfEN/t0ShBw=; b=uC7S7FIWHAx/sQQv8UDX+StmDG8hB52jx6mnBojJTmBEvtvkZzDme4UHqQbGbpOSp8 e4j7itDm2urvt/bXVuYv8w3hgRUUs+/my835XlVItz5FLXT73SuXofXN3GvisRXrXNIx KOxNaaYqGgvZ2ebgE8fJ/mMQ46avv4VxXvifLu/vgNFkxYTfRvdvCzZ2A/1K+HNz6t3u AdOjhchX/IesapancvnDSY1n15DY347FqqURX4QHYnM1TCjQa+KYGDzdVYforfxDlN4C jhnkuVRA2w6zQpSiCraJubOTfR2eV3H8CKlFTNvSj/vCtD9KwYY6WjP3+Kgsh3V/6xc+ s7GA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nI8QFgOb; 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 lf1si3914347ejb.498.2021.10.05.20.56.32; Tue, 05 Oct 2021 20:56:32 -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=nI8QFgOb; 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 S230473AbhJFD6R (ORCPT + 17 others); Tue, 5 Oct 2021 23:58:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32990 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237300AbhJFD5I (ORCPT ); Tue, 5 Oct 2021 23:57:08 -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 C2924C0613A3 for ; Tue, 5 Oct 2021 20:54:25 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id y23so4777358lfb.0 for ; Tue, 05 Oct 2021 20:54: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=cntTQV+8xT1gaPRWwmEttMqurpErGQCflfEN/t0ShBw=; b=nI8QFgOb018OHBusf4YC2JeMjW54+ysmQEB8kR7Xsem1gHesZm4WMMnTqiCIMiIJic WI7/wxQI+UPOYHBu3IM8HVi9QtbP9cW2z7Dw6JKWTuCV4ApU9PGZzJrmoVoO8ohQJUx2 ofFLe3i5sE2uwNgAtXM+eSdn8y8WAry7pokGo4W4zYARZ5um+aTBPwVaXMYetwnPHqnt EukYtJv6K7yZzw+gQsNKLblw67yWlUpB+YUL310GiTZMoiBbS2CMLfTpElLBXjmOdr5n Qg+qq3q8Cw/VMVHNvozcdAKgFGZYFF40fyNeJ64thfSGSgOSto4way/p2ww9JO/ImxaM 5Lww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=cntTQV+8xT1gaPRWwmEttMqurpErGQCflfEN/t0ShBw=; b=4Sh5fw5DuSmmm/usjn09645HUw4eFgy3NbMGWWnNTEBCvYFM7nHScwq5r1pOscUqXP hU5ZAdpepIGVMPgFaFXkoOLZXxEc5oJGgVXOvucO1/0Pol77sb8H4B3HM1fWfIlJgeE8 x6MI1Dj4rBf2ksw65hmkdz0xTFjLizldMLDq58iwtxco5aV99hr/xPZm3HZYKFDj6W8l lb4z6gTVD7z5QhzBU5mnQ5OE3gOkC76trsJa1ajJ3TOGqAp4wSUnBDfZXOvBbZF4RUgD wWGTwtJV8oS/XeDjwCzlyW0M4pq1kr0alWWFYYWC4sDWwsY9gJuw8X4bASIUrLjDpy4+ ih/w== X-Gm-Message-State: AOAM532j/WwTjVZwjKL085vXQ57c136JMI3bfVCXHO6fHaf/Lm/wsKUc TbmhV5sQvA/AJYN8LGzAH4KNmg== X-Received: by 2002:ac2:59d0:: with SMTP id x16mr7310130lfn.107.1633492464220; Tue, 05 Oct 2021 20:54:24 -0700 (PDT) Received: from eriador.lan ([37.153.55.125]) by smtp.gmail.com with ESMTPSA id s4sm2142967lfd.103.2021.10.05.20.54.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Oct 2021 20:54:23 -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: [PATCH v1 14/15] WIP: PCI: qcom: use pwrseq to power up bus devices Date: Wed, 6 Oct 2021 06:54:06 +0300 Message-Id: <20211006035407.1147909-15-dmitry.baryshkov@linaro.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20211006035407.1147909-1-dmitry.baryshkov@linaro.org> References: <20211006035407.1147909-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..f398283912c7 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(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);