Skip to contentSkip to conversation

misc: ti_fpc202: Add LED support

PATCH RESEND Superseded Romain Gantois 3 participants 6 messages Mar 25

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Romain Gantois

author maintainer
#0 lore raw

v2 cover misc: ti_fpc202: Add LED support

Hi everyone,

This series depends on "misc: ti_fpc202: two small fixes" by Felix Gu:

https://lore.kernel.org/all/[email protected]/

The FPC202 dual port controller features eight special-purpose ports which are meant to drive LEDs. These support PWM and blink offloading.

This is version two of my series which adds support for these special-purpose LED ports.

Best Regards,

Romain

---
Changes in v2:
- Avoided selecting foreign subsystems in Kconfig
- Rebased on conflicting bugfix series
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Romain Gantois (3):
misc: ti_fpc202: Depend on GPIOLIB instead of selecting it
dt-bindings: misc: Describe FPC202 LED features
misc: ti_fpc202: Support special-purpose GPIO lines with LED features

 .../devicetree/bindings/misc/ti,fpc202.yaml        |  22 ++
 drivers/misc/Kconfig                               |   3 +-
 drivers/misc/ti_fpc202.c                           | 339 ++++++++++++++++++++-
 3 files changed, 350 insertions(+), 14 deletions(-)

---
base-commit: 486b22d5a7306613f12e308208cd54352099d444
change-id: 20260126-fpc202-leds-53def6ce751e

Best regards,

Signature · 1 line
Romain Gantois <[email protected]>
author maintainer
#1 lore raw

PATCH RESEND v2 1/3 misc: ti_fpc202: Depend on GPIOLIB instead of selecting it

Selecting a foreign subsystem such as GPIOLIB may lead to dependency loops. Use a "depends on" instead.

---
 drivers/misc/Kconfig | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/Kconfig +1 -1
index 5cc79d1517af5..dcb36e39d7079 100644
@@ -116,7 +116,7 @@ config RPMB
 config TI_FPC202
 	tristate "TI FPC202 Dual Port Controller"
 	depends on I2C
-	select GPIOLIB
+	depends on GPIOLIB
 	select I2C_ATR
 	help
 	  If you say yes here you get support for the Texas Instruments FPC202
Signature · 1 line
2.53.0
author maintainer
#2 lore raw

PATCH RESEND v2 2/3 dt-bindings: misc: Describe FPC202 LED features

In reply to Romain Gantois

The FPC202 dual port controller has 20 regular GPIO lines and 8 special GPIO lines with LED features. Each one of these "LED GPIOs" can output PWM and blink signals.

Describe these special-purpose GPIO lines.

---
 .../devicetree/bindings/misc/ti,fpc202.yaml        | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Documentation/devicetree/bindings/misc/ti,fpc202.yaml +22 -0
index a8cb10f2d0df3..32913966a22a5 100644
@@ -53,6 +53,23 @@ patternProperties:
 
     unevaluatedProperties: false
 
+  "^led@2[0-7]$":
+    $ref: /schemas/leds/common.yaml#
+    description: Output GPIO line with advanced LED features enabled.
+
+    properties:
+      reg:
+        minimum: 20
+        maximum: 27
+        description:
+          GPIO line ID
+
+    required:
+      - reg
+      - label
+
+    unevaluatedProperties: false
+
 required:
   - compatible
   - reg
@@ -89,6 +106,11 @@ examples:
                 #size-cells = <0>;
                 reg = <1>;
             };
+
+            led@20 {
+                reg = <20>;
+                label = "phy0:green:indicator";
+            };
         };
     };
 ...
Signature · 1 line
2.53.0
maintainer
#3 lore raw

Re: [PATCH RESEND v2 2/3] dt-bindings: misc: Describe FPC202 LED features

Quoted 17 lines · Romain Gantois

The FPC202 dual port controller has 20 regular GPIO lines and 8 special GPIO lines with LED features. Each one of these "LED GPIOs" can output PWM and blink signals.

Describe these special-purpose GPIO lines.

---
 .../devicetree/bindings/misc/ti,fpc202.yaml        | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)
Documentation/devicetree/bindings/misc/ti,fpc202.yaml +0 -0
index a8cb10f2d0df3..32913966a22a5 100644

Documentation/devicetree/bindings/misc/ti,fpc202.yaml patternProperties: · line 56

Quoted 4 lines
Documentation/devicetree/bindings/misc/ti,fpc202.yaml +1 -0
@@ -53,6 +53,23 @@ patternProperties:
 
     unevaluatedProperties: false
 
+  "^led@2[0-7]$":

Unit-addresses are hex. Looks like you made it decimal based on the 'reg' values.

Documentation/devicetree/bindings/misc/ti,fpc202.yaml patternProperties: · line 69

Quoted 13 lines
Documentation/devicetree/bindings/misc/ti,fpc202.yaml +13 -0
+    $ref: /schemas/leds/common.yaml#
+    description: Output GPIO line with advanced LED features enabled.
+
+    properties:
+      reg:
+        minimum: 20
+        maximum: 27
+        description:
+          GPIO line ID
+
+    required:
+      - reg
+      - label

label should never be required. It's extra info for human consumption.

Quoted 22 lines
Documentation/devicetree/bindings/misc/ti,fpc202.yaml +8 -0
+
+    unevaluatedProperties: false
+
 required:
   - compatible
   - reg
@@ -89,6 +106,11 @@ examples:
                 #size-cells = <0>;
                 reg = <1>;
             };
+
+            led@20 {
+                reg = <20>;
+                label = "phy0:green:indicator";
+            };
         };
     };
...
Signature · 2 lines
-- 
2.53.0
author maintainer
#4 lore raw

PATCH RESEND v2 3/3 misc: ti_fpc202: Support special-purpose GPIO lines with LED features

In reply to Romain Gantois

The FPC202 dual port controller has 20 regular GPIO lines and 8 special GPIO lines with LED features. Each one of these "LED GPIOs" can output PWM and blink signals.

Add support for the eight special-purpose GPIO lines to the existing FPC202 driver's GPIO support. Add support for registering led-class devices on these GPIO lines.

---
 drivers/misc/Kconfig     |   1 +
 drivers/misc/ti_fpc202.c | 339 +++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 327 insertions(+), 13 deletions(-)
drivers/misc/Kconfig +1 -0
index dcb36e39d7079..00683bf06258f 100644
@@ -117,6 +117,7 @@ config TI_FPC202
 	tristate "TI FPC202 Dual Port Controller"
 	depends on I2C
 	depends on GPIOLIB
+	depends on LEDS_CLASS
 	select I2C_ATR
 	help
 	  If you say yes here you get support for the Texas Instruments FPC202
drivers/misc/ti_fpc202.c +326 -13

477 lines not on this page · raw message

Signature · 1 line
2.53.0