summaryrefslogtreecommitdiff
path: root/src/backlight
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2015-02-17 11:22:16 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2015-02-17 11:22:16 +0100
commite735f4d4eafc8c8c296cefc8228cf91c3fcfe822 (patch)
tree6626785ac2b212cc52282387a0a0d8a20fee8db2 /src/backlight
parentf47781d88ca6bf69d6b1dd0703b2b283482e5c09 (diff)
downloadsystemd-e735f4d4eafc8c8c296cefc8228cf91c3fcfe822.tar.gz
Imported Upstream version 219
Diffstat (limited to 'src/backlight')
-rw-r--r--src/backlight/backlight.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backlight/backlight.c b/src/backlight/backlight.c
index 1271a66983..c79ad6520c 100644
--- a/src/backlight/backlight.c
+++ b/src/backlight/backlight.c
@@ -373,6 +373,7 @@ int main(int argc, char *argv[]) {
if (streq(argv[1], "load")) {
_cleanup_free_ char *value = NULL;
+ const char *clamp;
if (!shall_restore_state())
return EXIT_SUCCESS;
@@ -390,7 +391,9 @@ int main(int argc, char *argv[]) {
return EXIT_FAILURE;
}
- clamp_brightness(device, &value, max_brightness);
+ clamp = udev_device_get_property_value(device, "ID_BACKLIGHT_CLAMP");
+ if (!clamp || parse_boolean(clamp) != 0) /* default to clamping */
+ clamp_brightness(device, &value, max_brightness);
r = udev_device_set_sysattr_value(device, "brightness", value);
if (r < 0) {