Skip to contentSkip to conversation

dt-bindings: leds: add "usbport" trigger

PATCH Superseded Rafał Miłecki 3 participants 7 messages Feb 28, 2023 – Mar 8, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dt-bindings: leds: add "usbport" trigger

From: Rafał Miłecki <[email protected]>

It's a trigger used on many home routers that have LEDs to indicate specific USB port state.

---
 Documentation/devicetree/bindings/leds/common.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/leds/common.yaml +1 -0
index 15e3f6645682..95b316ee3146 100644
@@ -99,6 +99,7 @@ properties:
           - pattern
           - usb-gadget
           - usb-host
+          - usbport
       - pattern: "^cpu[0-9]*$"
       - pattern: "^hci[0-9]+-power$"
         # LED is triggered by Bluetooth activity
Signature · 1 line
2.34.1
maintainer
#2 lore raw
In reply to Rafał Miłecki
Quoted 15 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

It's a trigger used on many home routers that have LEDs to indicate specific USB port state.

---
 Documentation/devicetree/bindings/leds/common.yaml | 1 +
 1 file changed, 1 insertion(+)
Documentation/devicetree/bindings/leds/common.yaml +0 -0
index 15e3f6645682..95b316ee3146 100644

Documentation/devicetree/bindings/leds/common.yaml properties: · line 102

Quoted 4 lines
Documentation/devicetree/bindings/leds/common.yaml +1 -0
@@ -99,6 +99,7 @@ properties:
           - pattern
           - usb-gadget
           - usb-host
+          - usbport

Can we stop adding entries which are clearly likely to have multiple instances. We have a better binding to map the trigger source...

Quoted 6 lines
Documentation/devicetree/bindings/leds/common.yaml +0 -0
       - pattern: "^cpu[0-9]*$"
       - pattern: "^hci[0-9]+-power$"
         # LED is triggered by Bluetooth activity
Signature · 1 line
2.34.1
#3 lore raw
Quoted 11 lines · Rob Herring
Quoted 10 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

It's a trigger used on many home routers that have LEDs to indicate specific USB port state.

---
  Documentation/devicetree/bindings/leds/common.yaml | 1 +
  1 file changed, 1 insertion(+)
Quoted 12 lines

Documentation/devicetree/bindings/leds/common.yaml properties: · line 102

Quoted 9 lines
Documentation/devicetree/bindings/leds/common.yaml +1 -0
index 15e3f6645682..95b316ee3146 100644
@@ -99,6 +99,7 @@ properties:
            - pattern
            - usb-gadget
            - usb-host
+          - usbport

Can we stop adding entries which are clearly likely to have multiple instances. We have a better binding to map the trigger source...

I'm sorry, I really don't understand this.
I'm not sure what do you mean by multuple "usbport" instances. Could you point me to that better place, please?

This is probably something obvious but I really can't figure it out since yesterday.

Quoted 6 lines
Quoted 6 lines
Documentation/devicetree/bindings/leds/common.yaml +0 -0
        - pattern: "^cpu[0-9]*$"
        - pattern: "^hci[0-9]+-power$"
          # LED is triggered by Bluetooth activity
Signature · 1 line
2.34.1
maintainer
#4 lore raw
Quoted 26 lines · Rafał Miłecki
Quoted 11 lines · Rob Herring
Quoted 10 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

It's a trigger used on many home routers that have LEDs to indicate specific USB port state.

---
  Documentation/devicetree/bindings/leds/common.yaml | 1 +
  1 file changed, 1 insertion(+)
Quoted 12 lines

Documentation/devicetree/bindings/leds/common.yaml properties: · line 102

Quoted 9 lines
Documentation/devicetree/bindings/leds/common.yaml +1 -0
index 15e3f6645682..95b316ee3146 100644
@@ -99,6 +99,7 @@ properties:
            - pattern
            - usb-gadget
            - usb-host
+          - usbport

Can we stop adding entries which are clearly likely to have multiple instances. We have a better binding to map the trigger source...

Quoted 3 lines

I'm sorry, I really don't understand this.
I'm not sure what do you mean by multuple "usbport" instances. Could you point me to that better place, please?

Suppose I have a device with 4 USB ports and 4 LEDs for each one. How would one define the connection of LEDs to USB ports? Extend this to usbport[0-9]? No.

Quoted 2 lines

This is probably something obvious but I really can't figure it out since yesterday.

"trigger-sources"

Rob

#5 lore raw
Quoted 31 lines · Rob Herring
Quoted 26 lines · Rafał Miłecki
Quoted 11 lines · Rob Herring
Quoted 10 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

It's a trigger used on many home routers that have LEDs to indicate specific USB port state.

---
   Documentation/devicetree/bindings/leds/common.yaml | 1 +
   1 file changed, 1 insertion(+)
Quoted 12 lines

Documentation/devicetree/bindings/leds/common.yaml properties: · line 102

Quoted 9 lines
Documentation/devicetree/bindings/leds/common.yaml +1 -0
index 15e3f6645682..95b316ee3146 100644
@@ -99,6 +99,7 @@ properties:
             - pattern
             - usb-gadget
             - usb-host
+          - usbport

Can we stop adding entries which are clearly likely to have multiple instances. We have a better binding to map the trigger source...

Quoted 3 lines

I'm sorry, I really don't understand this.
I'm not sure what do you mean by multuple "usbport" instances. Could you point me to that better place, please?

Quoted 8 lines

Suppose I have a device with 4 USB ports and 4 LEDs for each one. How would one define the connection of LEDs to USB ports? Extend this to usbport[0-9]? No.

Quoted 2 lines

This is probably something obvious but I really can't figure it out since yesterday.

"trigger-sources"

Ah, I suppose that "usbport" LED trigger in Linux can be confusing.

So: no matter how many USB ports you have, Linux *doesn't* create one trigger per USB port. There is only one trigger. It's called exactly "usbport".

Once you choose "usbport" trigger in Linux, you can choose which ports should it "monitor". That can be done using procfs (ABI). The default set of ports to monitor can be specified using "trigger-sources".

For decision details behind this see 0f247626cbbf ("usb: core: Introduce a USB port LED trigger").

So Linux on home routers needs both:
1. linux,default-trigger (for selecting default trigger)
2. trigger-sources (for providing default set of ports to monitor)

Does it make more sense? Should I improve commit description and resend it? Or should we still rework it somehow?

maintainer
#6 lore raw
Quoted 52 lines · Rafał Miłecki
Quoted 31 lines · Rob Herring
Quoted 26 lines · Rafał Miłecki
Quoted 11 lines · Rob Herring
Quoted 10 lines · Rafał Miłecki

From: Rafał Miłecki <[email protected]>

It's a trigger used on many home routers that have LEDs to indicate specific USB port state.

---
   Documentation/devicetree/bindings/leds/common.yaml | 1 +
   1 file changed, 1 insertion(+)
Quoted 12 lines

Documentation/devicetree/bindings/leds/common.yaml properties: · line 102

Quoted 9 lines
Documentation/devicetree/bindings/leds/common.yaml +1 -0
index 15e3f6645682..95b316ee3146 100644
@@ -99,6 +99,7 @@ properties:
             - pattern
             - usb-gadget
             - usb-host
+          - usbport

Can we stop adding entries which are clearly likely to have multiple instances. We have a better binding to map the trigger source...

Quoted 3 lines

I'm sorry, I really don't understand this.
I'm not sure what do you mean by multuple "usbport" instances. Could you point me to that better place, please?

Quoted 8 lines

Suppose I have a device with 4 USB ports and 4 LEDs for each one. How would one define the connection of LEDs to USB ports? Extend this to usbport[0-9]? No.

Quoted 2 lines

This is probably something obvious but I really can't figure it out since yesterday.

"trigger-sources"

Ah, I suppose that "usbport" LED trigger in Linux can be confusing.

So: no matter how many USB ports you have, Linux *doesn't* create one trigger per USB port. There is only one trigger. It's called exactly "usbport".

Once you choose "usbport" trigger in Linux, you can choose which ports should it "monitor". That can be done using procfs (ABI). The default set of ports to monitor can be specified using "trigger-sources".

Quoted 6 lines

For decision details behind this see 0f247626cbbf ("usb: core: Introduce a USB port LED trigger").

So Linux on home routers needs both:
1. linux,default-trigger (for selecting default trigger)
2. trigger-sources (for providing default set of ports to monitor)

I still don't understand why defining a trigger source doesn't also set the default. It is after all just the default. The DT should have how the LEDs are intended to be used by the design, not what a user wants. A user should change that from userspace.

In any case, just make the commit message clear this is not a new trigger, but one that has been in use for some time.

Rob