File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -372,6 +372,9 @@ static int clamp_brightness(
372372 return 0 ;
373373}
374374
375+ /* used as the default for devices in the backlight subsystem, or when ID_BACKLIGHT_CLAMP/ID_LEDS_CLAMP=yes. */
376+ #define DEFAULT_CLAMP_PERCENT 1u
377+
375378static int shall_clamp (sd_device * device , unsigned * ret ) {
376379 const char * property , * s ;
377380 unsigned default_percent ;
@@ -385,10 +388,10 @@ static int shall_clamp(sd_device *device, unsigned *ret) {
385388 return r ;
386389 if (r > 0 ) {
387390 property = "ID_BACKLIGHT_CLAMP" ;
388- default_percent = 1 ;
391+ default_percent = DEFAULT_CLAMP_PERCENT ;
389392 } else {
390393 property = "ID_LEDS_CLAMP" ;
391- default_percent = 0 ;
394+ default_percent = 0 ; /* The clamping is disabled by default. */
392395 }
393396
394397 r = sd_device_get_property_value (device , property , & s );
@@ -401,7 +404,7 @@ static int shall_clamp(sd_device *device, unsigned *ret) {
401404
402405 r = parse_boolean (s );
403406 if (r >= 0 ) {
404- * ret = r ? 5 : 0 ;
407+ * ret = r ? DEFAULT_CLAMP_PERCENT : 0 ;
405408 return r ;
406409 }
407410
You can’t perform that action at this time.
0 commit comments