[PATCH v2 1/2] gpio: fxl6408: Add optional reset gpio control
From: Jisheng Zhang
Date: Sun Nov 16 2025 - 19:33:05 EST
Add optional active low reset-gpios pin control. If present, de-assert
the specified reset gpio pin to bring the chip out of reset.
Signed-off-by: Jisheng Zhang <jszhang@xxxxxxxxxx>
---
drivers/gpio/gpio-fxl6408.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/gpio/gpio-fxl6408.c b/drivers/gpio/gpio-fxl6408.c
index 86ebc66b1104..7074831639ce 100644
--- a/drivers/gpio/gpio-fxl6408.c
+++ b/drivers/gpio/gpio-fxl6408.c
@@ -13,6 +13,7 @@
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/regmap.h>
+#include <linux/regulator/consumer.h>
#define FXL6408_REG_DEVICE_ID 0x01
#define FXL6408_MF_FAIRCHILD 0b101
@@ -104,6 +105,7 @@ static int fxl6408_identify(struct device *dev, struct regmap *regmap)
static int fxl6408_probe(struct i2c_client *client)
{
struct device *dev = &client->dev;
+ struct gpio_desc *reset_gpio;
int ret;
struct gpio_regmap_config gpio_config = {
.parent = dev,
@@ -114,6 +116,10 @@ static int fxl6408_probe(struct i2c_client *client)
.ngpio_per_reg = FXL6408_NGPIO,
};
+ reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_LOW);
+ if (IS_ERR(reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(reset_gpio), "Failed to get reset gpio\n");
+
gpio_config.regmap = devm_regmap_init_i2c(client, ®map);
if (IS_ERR(gpio_config.regmap))
return dev_err_probe(dev, PTR_ERR(gpio_config.regmap),
--
2.51.0