From: Andreas Kemnade <akemnade@kernel.org>
To: Lee Jones <lee@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Alistair Francis <alistair@alistair23.me>,
Liam Girdwood <lgirdwood@gmail.com>,
Mark Brown <broonie@kernel.org>, Shawn Guo <shawnguo@kernel.org>,
Sascha Hauer <s.hauer@pengutronix.de>,
Pengutronix Kernel Team <kernel@pengutronix.de>,
Fabio Estevam <festevam@gmail.com>, Frank Li <Frank.li@nxp.com>
Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
Andreas Kemnade <akemnade@kernel.org>,
Peng Fan <peng.fan@nxp.com>
Subject: [PATCH v3 2/3] regulator: sy7636a: add gpios and input regulator
Date: Wed, 17 Sep 2025 09:14:30 +0200 [thread overview]
Message-ID: <20250917-sy7636-rsrc-v3-2-331237d507a2@kernel.org> (raw)
In-Reply-To: <20250917-sy7636-rsrc-v3-0-331237d507a2@kernel.org>
Initialize input regulator and gpios to proper values to have things
basically working as well as in the case when these things are
hardwired.
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Signed-off-by: Andreas Kemnade <akemnade@kernel.org>
---
drivers/regulator/sy7636a-regulator.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/drivers/regulator/sy7636a-regulator.c b/drivers/regulator/sy7636a-regulator.c
index 27e3d939b7bb9..551647bc10520 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,30 @@ 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, "enable",
+ 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->vcom_en_gpio),
+ "failed to get vcom-en gpio\n");
+
+ /* if chip was not enabled, give it time to wake up */
+ if (data->en_gpio)
+ usleep_range(2500, 4000);
+
platform_set_drvdata(pdev, data);
ret = regmap_write(regmap, SY7636A_REG_POWER_ON_DELAY_TIME, 0x0);
--
2.47.3
next prev parent reply other threads:[~2025-09-17 7:15 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-17 7:14 [PATCH v3 0/3] regulator: sy7636a: define and init all resources needed Andreas Kemnade
2025-09-17 7:14 ` [PATCH v3 1/3] dt-bindings: mfd: sy7636a: Add missing gpio pins and supply Andreas Kemnade
2025-10-08 15:31 ` (subset) " Lee Jones
2025-10-20 13:15 ` Andreas Kemnade
2025-10-21 10:46 ` Lee Jones
2025-09-17 7:14 ` Andreas Kemnade [this message]
2025-09-17 7:14 ` [PATCH v3 3/3] ARM: dts: imx: e70k02: add sy7636 Andreas Kemnade
2025-10-20 12:48 ` Shawn Guo
2025-10-17 11:24 ` (subset) [PATCH v3 0/3] regulator: sy7636a: define and init all resources needed Mark Brown
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250917-sy7636-rsrc-v3-2-331237d507a2@kernel.org \
--to=akemnade@kernel.org \
--cc=Frank.li@nxp.com \
--cc=alistair@alistair23.me \
--cc=broonie@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=festevam@gmail.com \
--cc=imx@lists.linux.dev \
--cc=kernel@pengutronix.de \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=lgirdwood@gmail.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peng.fan@nxp.com \
--cc=robh@kernel.org \
--cc=s.hauer@pengutronix.de \
--cc=shawnguo@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).