Lines Matching +full:brightness +full:- +full:level
1 // SPDX-License-Identifier: GPL-2.0-only
7 * Copyright (C) 2006 Michael Hanselmann <linux-kernel@hansmi.ch>
35 /* The via-pmu code allows the backlight to be grabbed, in which case the
36 * in-kernel control of the brightness needs to be disabled. This should
64 "backlight-control", NULL); in pmac_has_backlight_type()
77 int level = (FB_BACKLIGHT_LEVELS - 1); in pmac_backlight_curve_lookup() local
79 if (info && info->bl_dev) { in pmac_backlight_curve_lookup()
84 max = max((int)info->bl_curve[i], max); in pmac_backlight_curve_lookup()
88 int diff = abs(info->bl_curve[i] - value); in pmac_backlight_curve_lookup()
91 level = i; in pmac_backlight_curve_lookup()
97 return level; in pmac_backlight_curve_lookup()
108 int brightness; in pmac_backlight_key_worker() local
110 props = &pmac_backlight->props; in pmac_backlight_key_worker()
112 brightness = props->brightness + in pmac_backlight_key_worker()
113 ((pmac_backlight_key_queued?-1:1) * in pmac_backlight_key_worker()
114 (props->max_brightness / 15)); in pmac_backlight_key_worker()
116 if (brightness < 0) in pmac_backlight_key_worker()
117 brightness = 0; in pmac_backlight_key_worker()
118 else if (brightness > props->max_brightness) in pmac_backlight_key_worker()
119 brightness = props->max_brightness; in pmac_backlight_key_worker()
121 props->brightness = brightness; in pmac_backlight_key_worker()
140 static int __pmac_backlight_set_legacy_brightness(int brightness) in __pmac_backlight_set_legacy_brightness() argument
142 int error = -ENXIO; in __pmac_backlight_set_legacy_brightness()
148 props = &pmac_backlight->props; in __pmac_backlight_set_legacy_brightness()
149 props->brightness = brightness * in __pmac_backlight_set_legacy_brightness()
150 (props->max_brightness + 1) / in __pmac_backlight_set_legacy_brightness()
153 if (props->brightness > props->max_brightness) in __pmac_backlight_set_legacy_brightness()
154 props->brightness = props->max_brightness; in __pmac_backlight_set_legacy_brightness()
155 else if (props->brightness < 0) in __pmac_backlight_set_legacy_brightness()
156 props->brightness = 0; in __pmac_backlight_set_legacy_brightness()
176 void pmac_backlight_set_legacy_brightness_pmu(int brightness) { in pmac_backlight_set_legacy_brightness_pmu() argument
180 pmac_backlight_set_legacy_queued = brightness; in pmac_backlight_set_legacy_brightness_pmu()
184 int pmac_backlight_set_legacy_brightness(int brightness) in pmac_backlight_set_legacy_brightness() argument
186 return __pmac_backlight_set_legacy_brightness(brightness); in pmac_backlight_set_legacy_brightness()
191 int result = -ENXIO; in pmac_backlight_get_legacy_brightness()
197 props = &pmac_backlight->props; in pmac_backlight_get_legacy_brightness()
199 result = props->brightness * in pmac_backlight_get_legacy_brightness()
201 (props->max_brightness + 1); in pmac_backlight_get_legacy_brightness()