Lines Matching refs:max_brightness
208 unsigned max_brightness;
210 max_brightness_str = udev_device_get_sysattr_value(device, "max_brightness");
212 log_warning("Failed to read 'max_brightness' attribute.");
216 r = safe_atou(max_brightness_str, &max_brightness);
218 log_warning_errno(r, "Failed to parse 'max_brightness' \"%s\": %m", max_brightness_str);
222 if (max_brightness <= 0) {
227 return max_brightness;
232 * max_brightness in case of 'backlight' subsystem. This avoids preserving
235 static void clamp_brightness(struct udev_device *device, char **value, unsigned max_brightness) {
248 min_brightness = MAX(1U, max_brightness/20);
252 new_brightness = CLAMP(brightness, min_brightness, max_brightness);
276 unsigned max_brightness;
332 /* If max_brightness is 0, then there is no actual backlight
336 max_brightness = get_max_brightness(device);
337 if (max_brightness == 0)
400 clamp_brightness(device, &value, max_brightness);