[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20230508104557.47889-3-wsa+renesas@sang-engineering.com>
Date: Mon, 8 May 2023 12:45:56 +0200
From: Wolfram Sang <wsa+renesas@...g-engineering.com>
To: linux-renesas-soc@...r.kernel.org
Cc: Wolfram Sang <wsa+renesas@...g-engineering.com>,
Marek Vasut <marek.vasut+renesas@...il.com>,
Yoshihiro Shimoda <yoshihiro.shimoda.uh@...esas.com>,
Lorenzo Pieralisi <lpieralisi@...nel.org>,
Krzysztof WilczyĆski <kw@...ux.com>,
Rob Herring <robh@...nel.org>,
Bjorn Helgaas <bhelgaas@...gle.com>, linux-pci@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: [RFC PATCH 2/3] PCI: rcar-host: add support for optional regulators
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 <wsa+renesas@...g-engineering.com>
---
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 <linux/phy/phy.h>
#include <linux/platform_device.h>
#include <linux/pm_runtime.h>
+#include <linux/regulator/consumer.h>
#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) {
--
2.30.2
Powered by blists - more mailing lists