Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2870175pxb; Sun, 29 Aug 2021 06:14:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQOImODmEy3MKxOqgeM+/AjSZpxLe37l725vaJ00sHfroAWxO0clAi1w10AOmrkWJn60eR X-Received: by 2002:a92:c151:: with SMTP id b17mr13078441ilh.1.1630242857106; Sun, 29 Aug 2021 06:14:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630242857; cv=none; d=google.com; s=arc-20160816; b=KyzCsl+MJ1BiRVa7leoE06143v1XeNGZkJZ7Ym95yYdQYYyVMH4HJHblypbaQsS4eb C30GBT8iNCXbCaDlGY9nUCqW64K/x5ogVT7ObIiIGhElFxVOIooGQv3C4MZyhmA4ZZAS /RKffFLZgagmZvBwlMpeA1UEulqaBS+iGeVBLJdmPutdINaKAYJUh+xUP2O2tbuAoyrk Rcp0L/MXdj5GIj/GeanEcN3uU8AsRUi7kVeq3EyKycAIQSpj3Amq72aKLfjXNzMrpRcv kKfYHICVvc24mlONHBbKYItiwepxaMMv7ykPXS9RxZ66thmiH17B2b6le2QG4NhnsH1u a+Qg== 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=SJlvlacri3CKRWVtImWcfhtoM+C9mkUfVvFCIoFVLu8sHi9SyQiWMiGT4FD4wrfR7M o0q11S2BNmygW32yONVN52THIPm4sRFKbkpqtWHGisbf+iiMGQsZnSc7eCXm09C62v76 NJMg8pTEgMB+e8rz/NNYbLPxV3pkJEhuvX0SywPFNZfEOPlWqkVx0q1hUEDJnYbli257 6dOgP2T7lmnF+ra5/Nta4mKIDvxQvgMuG4fnRSLR2fENZEw1XkhvnK41G+6zMTBtVJ2/ bnCb0hhJj9viDHwQjRRPfCLfBq3/QcmYkQQ7xHws6QKkUKTmwJ7lnDWa4N1dwZd5iCsP 7ZQQ== 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-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 p15si8798406ilc.68.2021.08.29.06.14.00; Sun, 29 Aug 2021 06:14:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S235608AbhH2NOU (ORCPT + 99 others); Sun, 29 Aug 2021 09:14:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235549AbhH2NON (ORCPT ); Sun, 29 Aug 2021 09:14:13 -0400 Received: from mail-lf1-x12d.google.com (mail-lf1-x12d.google.com [IPv6:2a00:1450:4864:20::12d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6D6DC0613A3 for ; Sun, 29 Aug 2021 06:13:20 -0700 (PDT) Received: by mail-lf1-x12d.google.com with SMTP id m28so25250573lfj.6 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=UNhEj6nGyRDO19W7hWgAehe3LTlTcmFfHIuBn532QGMKMdSVcc4am3Sx9NZ4TI4jmr FJaI34dUDkd/5aId8I8ms6FhiVV7NWfM5YmQkxzfsNIj6n/Y0boXXVCsFpVneuID6IAt GA6ubwpD22pypWG56HPc3M8LcqUdYLi1cll+lMsQ3TJvjR/ZLPokoEakhmx5J0FSAX6c rIyrVu+sDOndxwcp/Whmimf5NyTCKi5ke0+CFWiKo30KTfS5iNXdaV7Dl+94TQO6AH3R 50IWYC26Fm4RortIAUbxzSCJ7tG6FFL5Wmmi/eUut94hcVI5858nPcwUkM6MW7VoGryR 12yA== X-Gm-Message-State: AOAM530GVOaIw37ZXsh1c1H+CVJ6zcR8r0A/bzyqIWu6BdfrbZQ3KMew kjjIE5tFmrQJy8ee6C7tCVXG2Q== 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 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@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(+) 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); -- 2.33.0