dt-bindings: leds: Read max-brightness from devicetree
Subsystems (2)
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v3 1/2 dt-bindings: leds: Read max-brightness from devicetree
Normally, the maximum brightness is determined by the hardware, and this property is not required. This property is used to set a software limit. It could happen that an LED is made so bright that it gets damaged or causes damage due to restrictions in a specific system, such as mounting conditions.
Note that this flag is mainly used for PWM-LEDs, where it is not possible to map brightness to current. Drivers for other controllers should use led-max-microamp.
--- Documentation/devicetree/bindings/leds/common.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Documentation/devicetree/bindings/leds/common.yaml +12 -0
@@ -160,6 +160,18 @@ properties: For flash LED controllers with configurable current this property is mandatory for the LEDs in the non-flash modes (e.g. torch or indicator). + max-brightness: + description: + Normally, the maximum brightness is determined by the hardware, and this + property is not required. This property is used to set a software limit. + It could happen that an LED is made so bright that it gets damaged or + causes damage due to restrictions in a specific system, such as mounting + conditions. + Note that this flag is mainly used for PWM-LEDs, where it is not possible + to map brightness to current. Drivers for other controllers should use + led-max-microamp. + $ref: /schemas/types.yaml#definitions/uint32 + panic-indicator: description: This property specifies that the LED should be used, if at all possible,
Signature · 1 line
2.30.2
Quoted 10 lines · Astrid Rost
Normally, the maximum brightness is determined by the hardware, and this property is not required. This property is used to set a software limit. It could happen that an LED is made so bright that it gets damaged or causes damage due to restrictions in a specific system, such as mounting conditions.
Note that this flag is mainly used for PWM-LEDs, where it is not possible to map brightness to current. Drivers for other controllers should use led-max-microamp.Signed-off-by Astrid Rost <[email protected]>
Best regards,
Krzysztof
Quoted 9 lines · Astrid Rost
Normally, the maximum brightness is determined by the hardware, and this property is not required. This property is used to set a software limit. It could happen that an LED is made so bright that it gets damaged or causes damage due to restrictions in a specific system, such as mounting conditions.
Note that this flag is mainly used for PWM-LEDs, where it is not possible to map brightness to current. Drivers for other controllers should use led-max-microamp.
Quoted 5 lines
Signed-off-by Astrid Rost <[email protected]>--- Documentation/devicetree/bindings/leds/common.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Quoted 9 lines · Astrid Rost
Normally, the maximum brightness is determined by the hardware, and this property is not required. This property is used to set a software limit. It could happen that an LED is made so bright that it gets damaged or causes damage due to restrictions in a specific system, such as mounting conditions.
Note that this flag is mainly used for PWM-LEDs, where it is not possible to map brightness to current. Drivers for other controllers should use led-max-microamp.
Quoted 4 lines
Signed-off-by Astrid Rost <[email protected]>--- Documentation/devicetree/bindings/leds/common.yaml | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Applied, thanks
Signature · 1 line
Lee Jones [李琼斯]
PATCH v3 2/2 led: led-class: Read max-brightness from devicetree
In reply to a message not in the archiveNormally, the maximum brightness is determined by the hardware, and this property is not required. This property is used to set a software limit. It could happen that an LED is made so bright that it gets damaged or causes damage due to restrictions in a specific system, such as mounting conditions.
Note that this flag is mainly used for PWM-LEDs, where it is not possible to map brightness to current. Drivers for other controllers should use led-max-microamp.
--- drivers/leds/led-class.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/leds/led-class.c +4 -0
@@ -457,6 +457,10 @@ int led_classdev_register_ext(struct device *parent,if (fwnode_property_present (init_data->fwnode,"retain-state-shutdown" )) led_cdev->flags |=LED_RETAIN_AT_SHUTDOWN ; + +fwnode_property_read_u32 (init_data->fwnode, +"max-brightness" , + &led_cdev->max_brightness); } }else { proposed_name = led_cdev->name;
Signature · 1 line
2.30.2
Re: [PATCH v3 2/2] led: led-class: Read max-brightness from devicetree
Hi Astrid,
Thanks for the update.
Quoted 20 lines · Astrid Rost
Normally, the maximum brightness is determined by the hardware, and this property is not required. This property is used to set a software limit. It could happen that an LED is made so bright that it gets damaged or causes damage due to restrictions in a specific system, such as mounting conditions.
Note that this flag is mainly used for PWM-LEDs, where it is not possible to map brightness to current. Drivers for other controllers should use led-max-microamp.Reviewed-by Andy Shevchenko <[email protected]>Signed-off-by Astrid Rost <[email protected]>--- drivers/leds/led-class.c | 4 ++++ 1 file changed, 4 insertions(+)drivers/leds/led-class.c +0
-0
drivers/leds/led-class.c int led_classdev_register_ext(struct device *parent, · line 466
Quoted 10 lines
drivers/leds/led-class.c +4
-0@@ -457,6 +457,10 @@ int led_classdev_register_ext(struct device *parent,if (fwnode_property_present (init_data->fwnode,"retain-state-shutdown" )) led_cdev->flags |=LED_RETAIN_AT_SHUTDOWN ; + +fwnode_property_read_u32 (init_data->fwnode, +"max-brightness" , + &led_cdev->max_brightness); } }else { proposed_name = led_cdev->name;
For the whole set:
Signature · 2 lines
Best regards, Jacek Anaszewski
Re: [PATCH v3 2/2] led: led-class: Read max-brightness from devicetree
In reply to Astrid RostQuoted 9 lines · Astrid Rost
Normally, the maximum brightness is determined by the hardware, and this property is not required. This property is used to set a software limit. It could happen that an LED is made so bright that it gets damaged or causes damage due to restrictions in a specific system, such as mounting conditions.
Note that this flag is mainly used for PWM-LEDs, where it is not possible to map brightness to current. Drivers for other controllers should use led-max-microamp.
Quoted 5 lines
Reviewed-by Andy Shevchenko <[email protected]>Signed-off-by Astrid Rost <[email protected]>--- drivers/leds/led-class.c | 4 ++++ 1 file changed, 4 insertions(+)
Applied, thanks
Signature · 1 line
Lee Jones [李琼斯]