From: Flavio Amieiro <flavio@amieiro.net>
To: Lee Jones <lee@kernel.org>, Pavel Machek <pavel@kernel.org>,
Griffin Kroah-Hartman <griffin@kroah.com>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>
Cc: Flavio Amieiro <flavio@amieiro.net>,
linux-leds@vger.kernel.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH v4 2/2] leds: is31f132xx: Add support for is31fl3206
Date: Wed, 28 Oct 2026 18:31:02 -0300 [thread overview]
Message-ID: <20261028-add-is31fl3206-support-v4-2-e331cee9fcb3@amieiro.net> (raw)
In-Reply-To: <20261028-add-is31fl3206-support-v4-0-e331cee9fcb3@amieiro.net>
This chip has a different layout for the LED Control Register when
compared to the other variants. This register contains the enable bit
(in the highest nibble) but also the current control (in the lowest
nibble).
According to the datasheet, a value of 010000 (0x10) in the register
enables an LED with the output current set to maximum.
This commit adds support for this IC allowing the chipdef to define an
offset for the enable bits inside the LED Control Register.
The limitation that already existed for other variants is still in
this one: all LEDs are enabled and set with maximum current, letting
brightness be controlled by the PWM registers.
Signed-off-by: Flavio Amieiro <flavio@amieiro.net>
---
drivers/leds/leds-is31fl32xx.c | 25 +++++++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/drivers/leds/leds-is31fl32xx.c b/drivers/leds/leds-is31fl32xx.c
index 285085d27453..586713ff7d98 100644
--- a/drivers/leds/leds-is31fl32xx.c
+++ b/drivers/leds/leds-is31fl32xx.c
@@ -77,6 +77,7 @@ struct is31fl32xx_priv {
* @pwm_registers_reversed: : true if PWM registers count down instead of up
* @led_control_register_base : address of first LED control register (optional)
* @enable_bits_per_led_control_register: number of LEDs enable bits in each
+ * @enable_bits_offset_in_led_control_reg: offset of the enable bit in the LED Control Register
* @brightness_steps : number of brightness steps supported by the chip
* @reset_func : pointer to reset function
* @sw_shutdown_func : pointer to software shutdown function
@@ -88,6 +89,12 @@ struct is31fl32xx_priv {
* necessary registers to a known initialization state. This is needed
* for chips that do not have a @reset_reg.
*
+ * @enable_bit_offset_in_led_control_reg determines the offset of the
+ * enable bits from the least significant bit of the LED control
+ * register. This is needed for chips that have a LED Control Register
+ * that control more than simply the enable/disable state of the
+ * channel such as the IS31FL3206.
+ *
* @enable_bits_per_led_control_register must be >=1 if
* @led_control_register_base != %IS31FL32XX_REG_NONE.
*/
@@ -103,6 +110,7 @@ struct is31fl32xx_chipdef {
bool pwm_registers_reversed;
u8 led_control_register_base;
u8 enable_bits_per_led_control_register;
+ u8 enable_bits_offset_in_led_control_reg;
u16 brightness_steps;
int (*reset_func)(struct is31fl32xx_priv *priv);
int (*sw_shutdown_func)(struct is31fl32xx_priv *priv, bool enable);
@@ -351,6 +359,7 @@ static int is31fl32xx_init_regs(struct is31fl32xx_priv *priv)
if (cdef->led_control_register_base != IS31FL32XX_REG_NONE) {
u8 value =
GENMASK(cdef->enable_bits_per_led_control_register-1, 0);
+ value = value << cdef->enable_bits_offset_in_led_control_reg;
u8 num_regs = cdef->channels /
cdef->enable_bits_per_led_control_register;
int i;
@@ -552,7 +561,22 @@ static const struct is31fl32xx_chipdef is31fl3293_cdef = {
.sw_shutdown_func = is31fl3293_software_shutdown,
};
+static const struct is31fl32xx_chipdef is31fl3206_cdef = {
+ .channels = 12,
+ .shutdown_reg = 0x00,
+ .pwm_update_reg = 0x13,
+ .global_control_reg = 0x26,
+ .reset_reg = 0x2f,
+ .output_frequency_setting_reg = 0x27,
+ .pwm_register_base = 0x04,
+ .led_control_register_base = 0x17,
+ .enable_bits_per_led_control_register = 1,
+ .enable_bits_offset_in_led_control_reg = 4,
+ .brightness_steps = 256,
+};
+
static const struct of_device_id of_is31fl32xx_match[] = {
+ { .compatible = "issi,is31fl3206", .data = &is31fl3206_cdef, },
{ .compatible = "issi,is31fl3293", .data = &is31fl3293_cdef, },
{ .compatible = "issi,is31fl3236", .data = &is31fl3236_cdef, },
{ .compatible = "issi,is31fl3236a", .data = &is31fl3236a_cdef, },
@@ -616,6 +640,7 @@ static void is31fl32xx_remove(struct i2c_client *client)
* even though it is not used for DeviceTree based instantiation.
*/
static const struct i2c_device_id is31fl32xx_id[] = {
+ { .name = "is31fl3206" },
{ .name = "is31fl3293" },
{ .name = "is31fl3236" },
{ .name = "is31fl3236a" },
--
2.53.0
next prev parent reply other threads:[~2026-10-28 21:32 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-28 21:31 [PATCH v4 0/2] leds: Add support for the is31fl3206 LED driver Flavio Amieiro
2026-10-28 21:31 ` [PATCH v4 1/2] dt-bindings: leds: Add issi,is31fl3206 to leds-is31fl32xx Flavio Amieiro
2026-10-28 21:31 ` Flavio Amieiro [this message]
2026-10-30 13:09 ` [PATCH v4 2/2] leds: is31f132xx: Add support for is31fl3206 Griffin Kroah-Hartman
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=20261028-add-is31fl3206-support-v4-2-e331cee9fcb3@amieiro.net \
--to=flavio@amieiro.net \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=griffin@kroah.com \
--cc=krzk+dt@kernel.org \
--cc=lee@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-leds@vger.kernel.org \
--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®