Lines Matching refs:brightness

247 …nt clamp_brightness(sd_device *device, bool saved, unsigned max_brightness, unsigned *brightness) {  in clamp_brightness()  argument
253 assert(brightness); in clamp_brightness()
269 new_brightness = CLAMP(*brightness, min_brightness, max_brightness); in clamp_brightness()
270 if (new_brightness != *brightness) in clamp_brightness()
273 *brightness, in clamp_brightness()
274 new_brightness > *brightness ? in clamp_brightness()
278 *brightness = new_brightness; in clamp_brightness()
306 unsigned brightness; in read_brightness() local
326 r = safe_atou(value, &brightness); in read_brightness()
333 if (brightness > max_brightness) { in read_brightness()
335 … "fall back to use 'brightness' attribute", brightness, max_brightness); in read_brightness()
339 log_device_debug(device, "Current actual_brightness is %u", brightness); in read_brightness()
340 *ret_brightness = brightness; in read_brightness()
349 r = safe_atou(value, &brightness); in read_brightness()
353 if (brightness > max_brightness) in read_brightness()
356 brightness, max_brightness); in read_brightness()
358 log_device_debug(device, "Current brightness is %u", brightness); in read_brightness()
359 *ret_brightness = brightness; in read_brightness()
367 unsigned max_brightness, brightness; in run() local
461 r = safe_atou(value, &brightness); in run()
467 log_debug("Using saved brightness %u.", brightness); in run()
469 … (void) clamp_brightness(device, true, max_brightness, &brightness); in run()
481 r = read_brightness(device, max_brightness, &brightness); in run()
485 (void) clamp_brightness(device, false, max_brightness, &brightness); in run()
488 r = sd_device_set_sysattr_valuef(device, "brightness", "%u", brightness); in run()
498 r = read_brightness(device, max_brightness, &brightness); in run()
502 r = write_string_filef(saved, WRITE_STRING_FILE_CREATE, "%u", brightness); in run()