[PATCH v6 4/6] leds: is31fl32xx: Add powerdown pin for hardware shutdown mode
From: Jun Yan
Date: Wed May 20 2026 - 09:36:05 EST
The IS31FL32XX series features an SDB shutdown pin.
Driving it low (active low) places the chip into hardware shutdown
mode for power saving, while all register contents are preserved
and registers are not reset.
Deassert/assert the pin accordingly during probe() and remove()
to manage hardware shutdown mode.
Signed-off-by: Jun Yan <jerrysteve1101@xxxxxxxxx>
---
drivers/leds/leds-is31fl32xx.c | 15 ++++++++++++++-
1 file changed, 14 insertions(+), 1 deletion(-)
diff --git a/drivers/leds/leds-is31fl32xx.c b/drivers/leds/leds-is31fl32xx.c
index fe07acbb103a..b5207ad6ae96 100644
--- a/drivers/leds/leds-is31fl32xx.c
+++ b/drivers/leds/leds-is31fl32xx.c
@@ -10,6 +10,7 @@
*/
#include <linux/device.h>
+#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/kernel.h>
#include <linux/leds.h>
@@ -60,6 +61,7 @@ struct is31fl32xx_led_data {
struct is31fl32xx_priv {
const struct is31fl32xx_chipdef *cdef;
struct i2c_client *client;
+ struct gpio_desc *powerdown_gpio;
unsigned int num_leds;
struct is31fl32xx_led_data leds[];
};
@@ -421,6 +423,14 @@ static int is31fl32xx_parse_dt(struct device *dev,
const struct is31fl32xx_chipdef *cdef = priv->cdef;
int ret = 0;
+ /* Driving this GPIO line low takes the chip out of shutdown,
+ * as it is flagged as GPIO_ACTIVE_LOW in provider (such as the device tree).
+ */
+ priv->powerdown_gpio = devm_gpiod_get_optional(dev, "powerdown", GPIOD_OUT_LOW);
+ if (IS_ERR(priv->powerdown_gpio))
+ return dev_err_probe(dev, PTR_ERR(priv->powerdown_gpio),
+ "Failed to get powerdown gpio\n");
+
if ((cdef->output_frequency_setting_reg != IS31FL32XX_REG_NONE) &&
of_property_read_bool(dev_of_node(dev), "issi,22khz-pwm")) {
@@ -609,6 +619,9 @@ static void is31fl32xx_remove(struct i2c_client *client)
if (ret)
dev_err(&client->dev, "Failed to reset registers on removal (%pe)\n",
ERR_PTR(ret));
+
+ if (priv->powerdown_gpio)
+ gpiod_set_value(priv->powerdown_gpio, 1);
}
/*
@@ -643,4 +656,4 @@ module_i2c_driver(is31fl32xx_driver);
MODULE_AUTHOR("David Rivshin <drivshin@xxxxxxxxxxx>");
MODULE_DESCRIPTION("ISSI IS31FL32xx LED driver");
-MODULE_LICENSE("GPL v2");
+MODULE_LICENSE("GPL v2");
\ No newline at end of file
--
2.54.0