dt-bindings: leds: add "usbport" trigger
Subsystems (2)
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
@@ -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
Quoted 6 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.
Signed-off-by Rafał Miłecki <[email protected]>
BR,
Pavel
Signature · 1 line
People of Russia, stop Putin before his war on Ukraine escalates.
Rob Herring
maintainerQuoted 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.
Signed-off-by Rafał Miłecki <[email protected]>--- Documentation/devicetree/bindings/leds/common.yaml | 1 + 1 file changed, 1 insertion(+)Documentation/devicetree/bindings/leds/common.yaml +0
-0
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 activitySignature · 1 line
2.34.1
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.
Signed-off-by Rafał Miłecki <[email protected]>--- 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@@ -99,6 +99,7 @@ properties: - pattern - usb-gadget - usb-host + - usbportCan 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 activitySignature · 1 line
2.34.1
Rob Herring
maintainerQuoted 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.
Signed-off-by Rafał Miłecki <[email protected]>--- 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@@ -99,6 +99,7 @@ properties: - pattern - usb-gadget - usb-host + - usbportCan 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
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.
Signed-off-by Rafał Miłecki <[email protected]>--- 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@@ -99,6 +99,7 @@ properties: - pattern - usb-gadget - usb-host + - usbportCan 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?
Rob Herring
maintainerQuoted 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.
Signed-off-by Rafał Miłecki <[email protected]>--- 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@@ -99,6 +99,7 @@ properties: - pattern - usb-gadget - usb-host + - usbportCan 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