From patchwork Mon May 8 10:45:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 13234303 X-Patchwork-Delegate: kw@linux.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CF594C7EE26 for ; Mon, 8 May 2023 10:46:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235067AbjEHKqt (ORCPT ); Mon, 8 May 2023 06:46:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235065AbjEHKq3 (ORCPT ); Mon, 8 May 2023 06:46:29 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD3692C3EB for ; Mon, 8 May 2023 03:46:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=/52t7v/z2bjuNS cAobOGif1HPE5n1Q25yFrY/RjA0b0=; b=t06NfYZW23apf2nJJZd1BWICzCM3Qt DEHZxnFQB2q0GJe5q3y9reAgnUjm1pChQRAiTiAYE51UIl5QrCKIlls2c8CWf60t jEa1nVtk1umCHGjcimZKNN191UuUkoGb/pHhcZF7nqSvHe67GFMssKSl7i2uZ+Qt plOPKEqtwQwrY= Received: (qmail 1693272 invoked from network); 8 May 2023 12:46:09 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 8 May 2023 12:46:09 +0200 X-UD-Smtp-Session: l3s3148p1@x6G4WCz7noEujnsI From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Marek Vasut , Yoshihiro Shimoda , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski , Conor Dooley , linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 1/3] dt-bindings: PCI: rcar-pci-host: add optional regulators Date: Mon, 8 May 2023 12:45:55 +0200 Message-Id: <20230508104557.47889-2-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230508104557.47889-1-wsa+renesas@sang-engineering.com> References: <20230508104557.47889-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Support regulators found on the e.g. KingFisher board. Signed-off-by: Wolfram Sang --- Documentation/devicetree/bindings/pci/rcar-pci-host.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml b/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml index 8fdfbc763d70..23e44f78e62e 100644 --- a/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml +++ b/Documentation/devicetree/bindings/pci/rcar-pci-host.yaml @@ -68,6 +68,12 @@ properties: phy-names: const: pcie + vpcie1v5-supply: + description: The 1.5v regulator to use for PCIe. + + vpcie3v3-supply: + description: The 3.3v regulator to use for PCIe. + required: - compatible - reg @@ -121,5 +127,7 @@ examples: clock-names = "pcie", "pcie_bus"; power-domains = <&sysc R8A7791_PD_ALWAYS_ON>; resets = <&cpg 319>; + vpcie1v5-supply = <&pcie_1v5>; + vpcie3v3-supply = <&pcie_3v3>; }; }; From patchwork Mon May 8 10:45:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 13234304 X-Patchwork-Delegate: kw@linux.com Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A95C1C77B75 for ; Mon, 8 May 2023 10:46:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235073AbjEHKqz (ORCPT ); Mon, 8 May 2023 06:46:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235077AbjEHKqa (ORCPT ); Mon, 8 May 2023 06:46:30 -0400 Received: from mail.zeus03.de (www.zeus03.de [194.117.254.33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C9C4427F24 for ; Mon, 8 May 2023 03:46:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=k1; bh=Su+LIM099dBNN5 I/2zqemLMlE9HMV3Yah2C6jRkZbDk=; b=iyP8TDXVUIrCjCS5ppDQZq5VQ7viSa g5ULeT4CgvfOXRExfuT4YfkL4WkKrTXJbLcPTJON2Hjf1g0bNpNrJjcJQs1oC3+Y g029BS/M/mZNlBbIk6mM5zxFjMhXq4pKUU0zMZn0IHM2H6e30roEoANk8/JTucTW iAwBgNzjjAeHk= Received: (qmail 1693319 invoked from network); 8 May 2023 12:46:10 +0200 Received: by mail.zeus03.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 8 May 2023 12:46:10 +0200 X-UD-Smtp-Session: l3s3148p1@5w7EWCz7tsMujnsI From: Wolfram Sang To: linux-renesas-soc@vger.kernel.org Cc: Wolfram Sang , Marek Vasut , Yoshihiro Shimoda , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 2/3] PCI: rcar-host: add support for optional regulators Date: Mon, 8 May 2023 12:45:56 +0200 Message-Id: <20230508104557.47889-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230508104557.47889-1-wsa+renesas@sang-engineering.com> References: <20230508104557.47889-1-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org The KingFisher board has regulators. They just need to be en-/disabled, so we can leave the handling to devm. Signed-off-by: Wolfram Sang --- drivers/pci/controller/pcie-rcar-host.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index e80e56b2a842..b0e4834176d2 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "pcie-rcar.h" @@ -992,6 +993,14 @@ static int rcar_pcie_probe(struct platform_device *pdev) pcie->dev = dev; platform_set_drvdata(pdev, host); + err = devm_regulator_get_enable_optional(dev, "vpcie3v3"); + if (err < 0 && err != -ENODEV) + dev_err_probe(dev, err, "error enabling 3.3V regulator"); + + err = devm_regulator_get_enable_optional(dev, "vpcie1v5"); + if (err < 0 && err != -ENODEV) + dev_err_probe(dev, err, "error enabling 1.5V regulator"); + pm_runtime_enable(pcie->dev); err = pm_runtime_get_sync(pcie->dev); if (err < 0) {