* [PATCH v5 1/3] dt-bindings: leds: is31fl32xx: convert the binding to yaml
2025-07-21 10:55 [PATCH v5 0/3] Add support for is31fl3236a LED controller Pawel Zalewski
@ 2025-07-21 10:55 ` Pawel Zalewski
2025-07-21 11:16 ` Krzysztof Kozlowski
2025-07-21 10:55 ` [PATCH v5 2/3] dt-bindings: leds: issi,is31fl3236: add support for is31fl3236a Pawel Zalewski
2025-07-21 10:55 ` [PATCH v5 3/3] leds/leds-is31fl32xx: " Pawel Zalewski
2 siblings, 1 reply; 9+ messages in thread
From: Pawel Zalewski @ 2025-07-21 10:55 UTC (permalink / raw)
To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-leds, linux-kernel, Pavel Machek, devicetree,
Pawel Zalewski, Lucca Fachinetti
From: Lucca Fachinetti <luccafachinetti@gmail.com>
Add datasheets for reference, NB that I was not able to find an
up-to-date, funtional direct URL for si-en products datasheet
so they were skipped.
Signed-off-by: Lucca Fachinetti <luccafachinetti@gmail.com>
Co-developed-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
---
.../devicetree/bindings/leds/issi,is31fl3236.yaml | 96 ++++++++++++++++++++++
.../devicetree/bindings/leds/leds-is31fl32xx.txt | 52 ------------
2 files changed, 96 insertions(+), 52 deletions(-)
diff --git a/Documentation/devicetree/bindings/leds/issi,is31fl3236.yaml b/Documentation/devicetree/bindings/leds/issi,is31fl3236.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..d8164876611f5e629215fe2715ebff1745f93a26
--- /dev/null
+++ b/Documentation/devicetree/bindings/leds/issi,is31fl3236.yaml
@@ -0,0 +1,96 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/leds/issi,is31fl3236.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: is31fl32xx and Si-En SN32xx IC LED driver
+
+maintainers:
+ - Pavel Machek <pavel@ucw.cz>
+ - Lee Jones <lee@kernel.org>
+
+description: |
+ The is31fl32xx/SN32xx family of LED drivers are I2C devices with multiple
+ constant-current channels, each with independent 256-level PWM control.
+ Each LED is represented as a sub-node of the device.
+
+ For more product information please see the links below:
+ https://www.lumissil.com/assets/pdf/core/IS31FL3236_DS.pdf
+ https://www.lumissil.com/assets/pdf/core/IS31FL3235_DS.pdf
+ https://www.lumissil.com/assets/pdf/core/IS31FL3218_DS.pdf
+ https://www.lumissil.com/assets/pdf/core/IS31FL3216_DS.pdf
+
+properties:
+ compatible:
+ enum:
+ - issi,is31fl3236
+ - issi,is31fl3235
+ - issi,is31fl3218
+ - issi,is31fl3216
+ - si-en,sn3218
+ - si-en,sn3216
+
+ reg:
+ maxItems: 1
+
+ "#address-cells":
+ const: 1
+
+ "#size-cells":
+ const: 0
+
+patternProperties:
+ "^led@[1-9a-f][0-9a-f]*$":
+ type: object
+ $ref: common.yaml#
+ unevaluatedProperties: false
+
+ properties:
+ reg:
+ description:
+ LED channel number (1..N)
+ minimum: 0x1
+ maximum: 0x24
+
+ required:
+ - reg
+
+required:
+ - compatible
+ - reg
+ - "#size-cells"
+ - "#address-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/leds/common.h>
+
+ i2c {
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led-controller@3c {
+ compatible = "issi,is31fl3236";
+ reg = <0x3c>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ led@1 {
+ reg = <0x1>;
+ label = "led1:red";
+ };
+ led@2 {
+ reg = <0x2>;
+ label = "led1:green";
+ };
+ led@3 {
+ reg = <0x3>;
+ label = "led1:blue";
+ };
+ };
+ };
+...
+
diff --git a/Documentation/devicetree/bindings/leds/leds-is31fl32xx.txt b/Documentation/devicetree/bindings/leds/leds-is31fl32xx.txt
deleted file mode 100644
index 926c2117942c4dc200fcd68156864f544b11a326..0000000000000000000000000000000000000000
--- a/Documentation/devicetree/bindings/leds/leds-is31fl32xx.txt
+++ /dev/null
@@ -1,52 +0,0 @@
-Binding for ISSI IS31FL32xx and Si-En SN32xx LED Drivers
-
-The IS31FL32xx/SN32xx family of LED drivers are I2C devices with multiple
-constant-current channels, each with independent 256-level PWM control.
-Each LED is represented as a sub-node of the device.
-
-Required properties:
-- compatible: one of
- issi,is31fl3236
- issi,is31fl3235
- issi,is31fl3218
- issi,is31fl3216
- si-en,sn3218
- si-en,sn3216
-- reg: I2C slave address
-- address-cells : must be 1
-- size-cells : must be 0
-
-LED sub-node properties:
-- reg : LED channel number (1..N)
-- label : (optional)
- see Documentation/devicetree/bindings/leds/common.txt
-- linux,default-trigger : (optional)
- see Documentation/devicetree/bindings/leds/common.txt
-
-
-Example:
-
-is31fl3236: led-controller@3c {
- compatible = "issi,is31fl3236";
- reg = <0x3c>;
- #address-cells = <1>;
- #size-cells = <0>;
-
- led@1 {
- reg = <1>;
- label = "EB:blue:usr0";
- };
- led@2 {
- reg = <2>;
- label = "EB:blue:usr1";
- };
- ...
- led@36 {
- reg = <36>;
- label = "EB:blue:usr35";
- };
-};
-
-For more product information please see the links below:
-http://www.issi.com/US/product-analog-fxled-driver.shtml
-http://www.si-en.com/product.asp?parentid=890
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v5 2/3] dt-bindings: leds: issi,is31fl3236: add support for is31fl3236a
2025-07-21 10:55 [PATCH v5 0/3] Add support for is31fl3236a LED controller Pawel Zalewski
2025-07-21 10:55 ` [PATCH v5 1/3] dt-bindings: leds: is31fl32xx: convert the binding to yaml Pawel Zalewski
@ 2025-07-21 10:55 ` Pawel Zalewski
2025-07-21 11:16 ` Krzysztof Kozlowski
2025-07-21 10:55 ` [PATCH v5 3/3] leds/leds-is31fl32xx: " Pawel Zalewski
2 siblings, 1 reply; 9+ messages in thread
From: Pawel Zalewski @ 2025-07-21 10:55 UTC (permalink / raw)
To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-leds, linux-kernel, Pavel Machek, devicetree,
Pawel Zalewski
Add an additional and optional control property for setting
the output PWM frequency to 22kHz that exists on is31fl3236a.
The default is 3kHz and this option puts the operational frequency
outside of the audible range.
Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
---
.../devicetree/bindings/leds/issi,is31fl3236.yaml | 24 ++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/Documentation/devicetree/bindings/leds/issi,is31fl3236.yaml b/Documentation/devicetree/bindings/leds/issi,is31fl3236.yaml
index d8164876611f5e629215fe2715ebff1745f93a26..58f5aa4d0b644fe550e2c48b141c41c37fdf98e9 100644
--- a/Documentation/devicetree/bindings/leds/issi,is31fl3236.yaml
+++ b/Documentation/devicetree/bindings/leds/issi,is31fl3236.yaml
@@ -17,6 +17,7 @@ description: |
For more product information please see the links below:
https://www.lumissil.com/assets/pdf/core/IS31FL3236_DS.pdf
+ https://www.lumissil.com/assets/pdf/core/IS31FL3236A_DS.pdf
https://www.lumissil.com/assets/pdf/core/IS31FL3235_DS.pdf
https://www.lumissil.com/assets/pdf/core/IS31FL3218_DS.pdf
https://www.lumissil.com/assets/pdf/core/IS31FL3216_DS.pdf
@@ -25,6 +26,7 @@ properties:
compatible:
enum:
- issi,is31fl3236
+ - issi,is31fl3236a
- issi,is31fl3235
- issi,is31fl3218
- issi,is31fl3216
@@ -40,6 +42,12 @@ properties:
"#size-cells":
const: 0
+ issi,22kHz-pwm:
+ type: boolean
+ description:
+ When present, the chip's PWM will operate at ~22kHz as opposed
+ to ~3kHz to move the operating frequency out of the audible range.
+
patternProperties:
"^led@[1-9a-f][0-9a-f]*$":
type: object
@@ -56,6 +64,22 @@ patternProperties:
required:
- reg
+allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - issi,is31fl3236
+ - issi,is31fl3235
+ - issi,is31fl3218
+ - issi,is31fl3216
+ - si-en,sn3218
+ - si-en,sn3216
+ then:
+ properties:
+ issi,22kHz-pwm: false
+
required:
- compatible
- reg
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread
* [PATCH v5 3/3] leds/leds-is31fl32xx: add support for is31fl3236a
2025-07-21 10:55 [PATCH v5 0/3] Add support for is31fl3236a LED controller Pawel Zalewski
2025-07-21 10:55 ` [PATCH v5 1/3] dt-bindings: leds: is31fl32xx: convert the binding to yaml Pawel Zalewski
2025-07-21 10:55 ` [PATCH v5 2/3] dt-bindings: leds: issi,is31fl3236: add support for is31fl3236a Pawel Zalewski
@ 2025-07-21 10:55 ` Pawel Zalewski
2 siblings, 0 replies; 9+ messages in thread
From: Pawel Zalewski @ 2025-07-21 10:55 UTC (permalink / raw)
To: Lee Jones, Pavel Machek, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-leds, linux-kernel, Pavel Machek, devicetree,
Pawel Zalewski
Add an additional and optional control register for setting
the output PWM frequency to 22kHz. The default is 3kHz and
this option puts the operational frequency outside of the
audible range.
Signed-off-by: Pawel Zalewski <pzalewski@thegoodpenguin.co.uk>
---
drivers/leds/leds-is31fl32xx.c | 47 ++++++++++++++++++++++++++++++++++++------
1 file changed, 41 insertions(+), 6 deletions(-)
diff --git a/drivers/leds/leds-is31fl32xx.c b/drivers/leds/leds-is31fl32xx.c
index 8793330dd4142f49f15d6ee9d87468c08509859f..5ec1ca71f326378e3a714a886260b86002feffa9 100644
--- a/drivers/leds/leds-is31fl32xx.c
+++ b/drivers/leds/leds-is31fl32xx.c
@@ -32,6 +32,8 @@
#define IS31FL3216_CONFIG_SSD_ENABLE BIT(7)
#define IS31FL3216_CONFIG_SSD_DISABLE 0
+#define IS31FL32XX_PWM_FREQUENCY_22kHz 0x01
+
struct is31fl32xx_priv;
struct is31fl32xx_led_data {
struct led_classdev cdev;
@@ -53,6 +55,7 @@ struct is31fl32xx_priv {
* @pwm_update_reg : address of PWM Update register
* @global_control_reg : address of Global Control register (optional)
* @reset_reg : address of Reset register (optional)
+ * @output_frequency_setting_reg: address of output frequency register (optional)
* @pwm_register_base : address of first PWM register
* @pwm_registers_reversed: : true if PWM registers count down instead of up
* @led_control_register_base : address of first LED control register (optional)
@@ -76,6 +79,7 @@ struct is31fl32xx_chipdef {
u8 pwm_update_reg;
u8 global_control_reg;
u8 reset_reg;
+ u8 output_frequency_setting_reg;
u8 pwm_register_base;
bool pwm_registers_reversed;
u8 led_control_register_base;
@@ -90,6 +94,19 @@ static const struct is31fl32xx_chipdef is31fl3236_cdef = {
.pwm_update_reg = 0x25,
.global_control_reg = 0x4a,
.reset_reg = 0x4f,
+ .output_frequency_setting_reg = IS31FL32XX_REG_NONE,
+ .pwm_register_base = 0x01,
+ .led_control_register_base = 0x26,
+ .enable_bits_per_led_control_register = 1,
+};
+
+static const struct is31fl32xx_chipdef is31fl3236a_cdef = {
+ .channels = 36,
+ .shutdown_reg = 0x00,
+ .pwm_update_reg = 0x25,
+ .global_control_reg = 0x4a,
+ .reset_reg = 0x4f,
+ .output_frequency_setting_reg = 0x4b,
.pwm_register_base = 0x01,
.led_control_register_base = 0x26,
.enable_bits_per_led_control_register = 1,
@@ -101,6 +118,7 @@ static const struct is31fl32xx_chipdef is31fl3235_cdef = {
.pwm_update_reg = 0x25,
.global_control_reg = 0x4a,
.reset_reg = 0x4f,
+ .output_frequency_setting_reg = IS31FL32XX_REG_NONE,
.pwm_register_base = 0x05,
.led_control_register_base = 0x2a,
.enable_bits_per_led_control_register = 1,
@@ -112,6 +130,7 @@ static const struct is31fl32xx_chipdef is31fl3218_cdef = {
.pwm_update_reg = 0x16,
.global_control_reg = IS31FL32XX_REG_NONE,
.reset_reg = 0x17,
+ .output_frequency_setting_reg = IS31FL32XX_REG_NONE,
.pwm_register_base = 0x01,
.led_control_register_base = 0x13,
.enable_bits_per_led_control_register = 6,
@@ -126,6 +145,7 @@ static const struct is31fl32xx_chipdef is31fl3216_cdef = {
.pwm_update_reg = 0xB0,
.global_control_reg = IS31FL32XX_REG_NONE,
.reset_reg = IS31FL32XX_REG_NONE,
+ .output_frequency_setting_reg = IS31FL32XX_REG_NONE,
.pwm_register_base = 0x10,
.pwm_registers_reversed = true,
.led_control_register_base = 0x01,
@@ -363,8 +383,21 @@ static struct is31fl32xx_led_data *is31fl32xx_find_led_data(
static int is31fl32xx_parse_dt(struct device *dev,
struct is31fl32xx_priv *priv)
{
+ const struct is31fl32xx_chipdef *cdef = priv->cdef;
int ret = 0;
+ if ((cdef->output_frequency_setting_reg != IS31FL32XX_REG_NONE) &&
+ of_property_read_bool(dev_of_node(dev), "issi,22kHz-pwm")) {
+
+ ret = is31fl32xx_write(priv, cdef->output_frequency_setting_reg,
+ IS31FL32XX_PWM_FREQUENCY_22kHz);
+
+ if (ret) {
+ dev_err(dev, "Failed to write output PWM frequency register\n");
+ return ret;
+ }
+ }
+
for_each_available_child_of_node_scoped(dev_of_node(dev), child) {
struct led_init_data init_data = {};
struct is31fl32xx_led_data *led_data =
@@ -404,12 +437,13 @@ static int is31fl32xx_parse_dt(struct device *dev,
}
static const struct of_device_id of_is31fl32xx_match[] = {
- { .compatible = "issi,is31fl3236", .data = &is31fl3236_cdef, },
- { .compatible = "issi,is31fl3235", .data = &is31fl3235_cdef, },
- { .compatible = "issi,is31fl3218", .data = &is31fl3218_cdef, },
- { .compatible = "si-en,sn3218", .data = &is31fl3218_cdef, },
- { .compatible = "issi,is31fl3216", .data = &is31fl3216_cdef, },
- { .compatible = "si-en,sn3216", .data = &is31fl3216_cdef, },
+ { .compatible = "issi,is31fl3236", .data = &is31fl3236_cdef, },
+ { .compatible = "issi,is31fl3236a", .data = &is31fl3236a_cdef, },
+ { .compatible = "issi,is31fl3235", .data = &is31fl3235_cdef, },
+ { .compatible = "issi,is31fl3218", .data = &is31fl3218_cdef, },
+ { .compatible = "si-en,sn3218", .data = &is31fl3218_cdef, },
+ { .compatible = "issi,is31fl3216", .data = &is31fl3216_cdef, },
+ { .compatible = "si-en,sn3216", .data = &is31fl3216_cdef, },
{},
};
@@ -466,6 +500,7 @@ static void is31fl32xx_remove(struct i2c_client *client)
*/
static const struct i2c_device_id is31fl32xx_id[] = {
{ "is31fl3236" },
+ { "is31fl3236a" },
{ "is31fl3235" },
{ "is31fl3218" },
{ "sn3218" },
--
2.48.1
^ permalink raw reply related [flat|nested] 9+ messages in thread