From: Nora Schiffer <nora.schiffer@ew.tq-group.com>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>
Cc: Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Isai Gaspar <isaiezequiel.gaspar@nxp.com>,
linux@ew.tq-group.com, linux-leds@vger.kernel.org,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
Nora Schiffer <nora.schiffer@ew.tq-group.com>
Subject: [PATCH 3/7] leds: pca995x: add support for reset GPIO
Date: Wed, 2 Sep 2026 14:22:11 +0200 [thread overview]
Message-ID: <1d5436e3a143d72c04c2bfd1d7fee2674e0af8e5.1788350618.git.nora.schiffer@ew.tq-group.com> (raw)
In-Reply-To: <6d3600f99c77c31166f0b6a5ccfb7f518b53c4c9.1788350618.git.nora.schiffer@ew.tq-group.com>
The PCA995x has a reset pin. Use it to reset the LED driver if provided
in the Device Tree.
Signed-off-by: Nora Schiffer <nora.schiffer@ew.tq-group.com>
---
drivers/leds/leds-pca995x.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/leds/leds-pca995x.c b/drivers/leds/leds-pca995x.c
index fee6216cd1bd0..8eb9847b9709f 100644
--- a/drivers/leds/leds-pca995x.c
+++ b/drivers/leds/leds-pca995x.c
@@ -8,6 +8,7 @@
* Copyright 2023 Marek Vasut
*/
+#include <linux/gpio.h>
#include <linux/i2c.h>
#include <linux/leds.h>
#include <linux/module.h>
@@ -121,6 +122,7 @@ static int pca995x_probe(struct i2c_client *client)
struct fwnode_handle *led_fwnodes[PCA995X_MAX_OUTPUTS] = { 0 };
struct device *dev = &client->dev;
const struct pca995x_chipdef *chipdef;
+ struct gpio_desc *reset_gpio;
struct pca995x_chip *chip;
struct pca995x_led *led;
int i, j, reg, ret;
@@ -130,6 +132,16 @@ static int pca995x_probe(struct i2c_client *client)
if (!dev_fwnode(dev))
return -ENODEV;
+ reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
+ if (IS_ERR(reset_gpio))
+ return dev_err_probe(dev, PTR_ERR(reset_gpio),
+ "failed to request reset GPIO\n");
+ if (reset_gpio) {
+ usleep_range(3, 4);
+ gpiod_set_value_cansleep(reset_gpio, 0);
+ usleep_range(1500, 1600);
+ }
+
chip = devm_kzalloc(dev, sizeof(*chip), GFP_KERNEL);
if (!chip)
return -ENOMEM;
--
TQ-Systems GmbH | Mühlstraße 2, Gut Delling | 82229 Seefeld, Germany
Amtsgericht München, HRB 105018
Geschäftsführer: Detlef Schneider, Rüdiger Stahl, Stefan Schneider
https://www.tq-group.com/
next prev parent reply other threads:[~2026-09-02 12:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 12:22 [PATCH 1/7] dt-bindings: leds: pca995x: describe reset-gpios property Nora Schiffer
2026-09-02 12:22 ` [PATCH 2/7] dt-bindings: leds: pca995x: describe output-gain property Nora Schiffer
2026-09-02 12:22 ` Nora Schiffer [this message]
2026-09-02 12:22 ` [PATCH 4/7] leds: pca995x: make output gain configurable Nora Schiffer
2026-09-02 12:22 ` [PATCH 5/7] leds: pca995x: add sysfs files for error reporting Nora Schiffer
2026-09-02 12:22 ` [PATCH 6/7] leds: pca995x: do not use full on LED mode Nora Schiffer
2026-09-02 12:22 ` [PATCH 7/7] leds: pca995x: add support for group brightness control Nora Schiffer
2026-09-07 7:41 ` [PATCH 1/7] dt-bindings: leds: pca995x: describe reset-gpios property Krzysztof Kozlowski
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=1d5436e3a143d72c04c2bfd1d7fee2674e0af8e5.1788350618.git.nora.schiffer@ew.tq-group.com \
--to=nora.schiffer@ew.tq-group.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=isaiezequiel.gaspar@nxp.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--cc=linux@ew.tq-group.com \
--cc=pavel@kernel.org \
--cc=robh@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
all inboxes | Powered by JetHome®