[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20250906143240.GA12656@nxa18884-linux.ap.freescale.net>
Date: Sat, 6 Sep 2025 22:32:40 +0800
From: Peng Fan <peng.fan@....nxp.com>
To: Andreas Kemnade <akemnade@...nel.org>
Cc: Lee Jones <lee@...nel.org>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzk+dt@...nel.org>,
Conor Dooley <conor+dt@...nel.org>,
Alistair Francis <alistair@...stair23.me>,
Liam Girdwood <lgirdwood@...il.com>,
Mark Brown <broonie@...nel.org>, Shawn Guo <shawnguo@...nel.org>,
Sascha Hauer <s.hauer@...gutronix.de>,
Pengutronix Kernel Team <kernel@...gutronix.de>,
Fabio Estevam <festevam@...il.com>, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, imx@...ts.linux.dev,
linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 3/4] regulator: sy7636a: add gpios and input regulator
On Sat, Sep 06, 2025 at 11:09:14AM +0200, Andreas Kemnade wrote:
>Initialize input regulator and gpios to proper values to have things
>basically working as well as in the case when these things are
>hardwired.
>
>Signed-off-by: Andreas Kemnade <akemnade@...nel.org>
>---
> drivers/regulator/sy7636a-regulator.c | 26 ++++++++++++++++++++++++++
> 1 file changed, 26 insertions(+)
>
>diff --git a/drivers/regulator/sy7636a-regulator.c b/drivers/regulator/sy7636a-regulator.c
>index 27e3d939b7bb9..bd8739624c727 100644
>--- a/drivers/regulator/sy7636a-regulator.c
>+++ b/drivers/regulator/sy7636a-regulator.c
>@@ -12,6 +12,7 @@
> #include <linux/mfd/sy7636a.h>
> #include <linux/module.h>
> #include <linux/platform_device.h>
>+#include <linux/regulator/consumer.h>
> #include <linux/regulator/driver.h>
> #include <linux/regulator/machine.h>
> #include <linux/regmap.h>
>@@ -19,6 +20,8 @@
> struct sy7636a_data {
> struct regmap *regmap;
> struct gpio_desc *pgood_gpio;
>+ struct gpio_desc *en_gpio;
>+ struct gpio_desc *vcom_en_gpio;
> };
>
> static int sy7636a_get_vcom_voltage_op(struct regulator_dev *rdev)
>@@ -98,6 +101,29 @@ static int sy7636a_regulator_probe(struct platform_device *pdev)
> data->regmap = regmap;
> data->pgood_gpio = gdp;
>
>+ ret = devm_regulator_get_enable_optional(&pdev->dev, "vin");
>+ if (ret)
>+ return dev_err_probe(&pdev->dev, ret,
>+ "failed to get vin regulator\n");
>+
>+ data->en_gpio = devm_gpiod_get_optional(&pdev->dev, "en",
>+ GPIOD_OUT_HIGH);
>+ if (IS_ERR(data->en_gpio))
>+ return dev_err_probe(&pdev->dev,
>+ PTR_ERR(data->en_gpio),
>+ "failed to get en gpio\n");
>+
>+ /* Let VCOM just follow the default power on sequence */
>+ data->vcom_en_gpio = devm_gpiod_get_optional(&pdev->dev,
>+ "vcom-en", GPIOD_OUT_LOW);
>+ if (IS_ERR(data->vcom_en_gpio))
>+ return dev_err_probe(&pdev->dev,
>+ PTR_ERR(data->en_gpio),
>+ "failed to get en gpio\n");
Nit: s/en/vcom en/
>+
>+ if (data->en_gpio)
>+ usleep_range(2500, 4000);
It would be better to add a comment on this delay.
Regards
Peng
Powered by blists - more mailing lists