From nobody Sat May 10 05:46:26 2025 Delivered-To: importer2@patchew.org Received-SPF: pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; envelope-from=linux-kernel-owner@vger.kernel.org; helo=vger.kernel.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1612336017; cv=none; d=zohomail.com; s=zohoarc; b=CErrIJ0GBbCFMJEuKii3+rfggjgWxaPdAoEYBfSgjsS3LnVLLaUPy5OxR9ALshHIiJKdtdrLk8HToSuF1Fs2d4+QePDDCfFMEGznkEQ4bsse3rvjnEYbsCM94hERkp3DI+KAG87KfHgFTAyiG0q1t1kAWled3boclt+FW/KMysk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1612336017; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:MIME-Version:Message-ID:References:Sender:Subject:To; bh=IkgIlVbMu0Xql5v71p0O9PuzjO1yEJ52fRMKZKCahDo=; b=d/1oFAXBJJVuXcopyUwQ+sc+El8G2dT5xGzhJgKmIBn4LQM8oqaQ8dVdN+GFCiI1BEBCTYIqax6vkWtLJUrB1Vtxnln8mSQslLaeCqo6WxcBgqLoIZE3jFHYE/T360m1RTyTPEZKwuL09DtBzvxLhSXDBlF1p94jRYqFFgR0P5c= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mx.zohomail.com with SMTP id 1612336017875276.0078121841616; Tue, 2 Feb 2021 23:06:57 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232227AbhBCHGe (ORCPT ); Wed, 3 Feb 2021 02:06:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:35558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232034AbhBCHD0 (ORCPT ); Wed, 3 Feb 2021 02:03:26 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 713CE64F7C; Wed, 3 Feb 2021 07:02:01 +0000 (UTC) Received: by mail.kernel.org with local (Exim 4.94) (envelope-from ) id 1l7CAo-001CAf-7r; Wed, 03 Feb 2021 08:01:58 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1612335721; bh=MMNo+h3HEqIoqHzAyjt4M5/YBbQxBfZXIFkLGwOoWfA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PZB4TT+DYLy810UDcivav4AxNXtzTUSCSHk+qpJ4JrjlhfHBlnePtsImAdPVSefl+ 94TMiVZhtsLeRsksWM1ucqBRfFlXHhuv6D8hd+tOP/9I3TRuMoT+mw4zgZnxdP2w4U XlIg+cyLwbw0flSutndMnhVtqp6pQ6YOt+qrEEODRktMbf0S0POrm3xw0Ufv2kFmGt x2Bs8YB1DfZ9GkuSdyVBwggSplPfvbUIxwOJS7a1s7uCy3yV1hSmL7Od4c93eDCilm cVbW6txQVlVgeWEzlKF2ILYs2T3jgjdafphb4BlFMAJnND7T9me2H/3SoClSUAZQir yZgPqx0MWvEvw== From: Mauro Carvalho Chehab Cc: Mauro Carvalho Chehab , Binghui Wang , Bjorn Helgaas , Lorenzo Pieralisi , Rob Herring , Xiaowei Song , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org Subject: [PATCH v2 08/11] PCI: dwc: pcie-kirin: add support for a regulator Date: Wed, 3 Feb 2021 08:01:52 +0100 Message-Id: X-Mailer: git-send-email 2.29.2 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: Mauro Carvalho Chehab To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" On Kirin 970 designs, a power supply is required to enable a PCI bridge and other components of the board. For instance, on HiKey 970, the Hi6421v600 regulator provides a power line (LDO33) which powers on the PCI bridge, the M.2 slot, the mini PCIe 1x slot and the Realtek 8169 Ethernet card. Without enabling such power supply, the PCI resource allocation fails. Signed-off-by: Mauro Carvalho Chehab --- drivers/pci/controller/dwc/pcie-kirin.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/pci/controller/dwc/pcie-kirin.c b/drivers/pci/controll= er/dwc/pcie-kirin.c index 2bce6e3750d4..005fc4c2ad7f 100644 --- a/drivers/pci/controller/dwc/pcie-kirin.c +++ b/drivers/pci/controller/dwc/pcie-kirin.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "pcie-designware.h" @@ -335,8 +336,21 @@ static long kirin970_pcie_get_resource(struct kirin_pc= ie *kirin_pcie, struct platform_device *pdev) { struct device *dev =3D &pdev->dev; + struct regulator *reg; int ret; =20 + reg =3D devm_regulator_get(dev, "pcie_vdd"); + if (IS_ERR_OR_NULL(reg)) { + if (PTR_ERR(reg) =3D=3D -EPROBE_DEFER) + return PTR_ERR(reg); + } else { + ret =3D regulator_enable(reg); + if (ret) { + dev_err(dev, "Failed to enable regulator\n"); + return ret; + } + } + kirin970_pcie_get_eyeparam(kirin_pcie); =20 kirin_pcie->gpio_id_reset[0] =3D of_get_named_gpio(dev->of_node, --=20 2.29.2