Lines Matching full:levels
26 unsigned int *levels; member
97 if (pb->levels) in compute_duty_cycle()
98 duty_cycle = pb->levels[brightness]; in compute_duty_cycle()
201 * Once we have 4096 levels there's little point going much higher... in pwm_backlight_brightness_default()
208 data->levels = devm_kcalloc(dev, data->max_brightness, in pwm_backlight_brightness_default()
209 sizeof(*data->levels), GFP_KERNEL); in pwm_backlight_brightness_default()
210 if (!data->levels) in pwm_backlight_brightness_default()
220 data->levels[i] = (unsigned int)retval; in pwm_backlight_brightness_default()
255 * Determine the number of brightness levels, if this property is not in pwm_backlight_parse_dt()
256 * set a default table of brightness levels will be used. in pwm_backlight_parse_dt()
258 prop = of_find_property(node, "brightness-levels", &length); in pwm_backlight_parse_dt()
264 /* read brightness levels from DT property */ in pwm_backlight_parse_dt()
266 data->levels = devm_kcalloc(dev, num_levels, in pwm_backlight_parse_dt()
267 sizeof(*data->levels), GFP_KERNEL); in pwm_backlight_parse_dt()
268 if (!data->levels) in pwm_backlight_parse_dt()
271 ret = of_property_read_u32_array(node, "brightness-levels", in pwm_backlight_parse_dt()
272 data->levels, in pwm_backlight_parse_dt()
286 * interpolation between each of the values of brightness levels in pwm_backlight_parse_dt()
294 * brightness-levels table, otherwise we can't interpolate in pwm_backlight_parse_dt()
310 * Recalculate the number of brightness levels, now in pwm_backlight_parse_dt()
312 * steps between two levels. in pwm_backlight_parse_dt()
315 dev_dbg(dev, "new number of brightness levels: %d\n", in pwm_backlight_parse_dt()
319 * Create a new table of brightness levels with all the in pwm_backlight_parse_dt()
334 y1 = data->levels[i]; in pwm_backlight_parse_dt()
335 y2 = data->levels[i + 1]; in pwm_backlight_parse_dt()
348 * brightness levels table and replace for the in pwm_backlight_parse_dt()
351 devm_kfree(dev, data->levels); in pwm_backlight_parse_dt()
352 data->levels = table; in pwm_backlight_parse_dt()
386 unsigned int min_val = data->levels[0]; in pwm_backlight_is_linear()
387 unsigned int max_val = data->levels[nlevels - 1]; in pwm_backlight_is_linear()
399 unsigned int delta = abs(linear_value - data->levels[i]); in pwm_backlight_is_linear()
545 if (data->levels) { in pwm_backlight_probe()
546 pb->levels = data->levels; in pwm_backlight_probe()
549 * For the DT case, only when brightness levels is defined in pwm_backlight_probe()
550 * data->levels is filled. For the non-DT case, data->levels in pwm_backlight_probe()
554 if (data->levels[i] > pb->scale) in pwm_backlight_probe()
555 pb->scale = data->levels[i]; in pwm_backlight_probe()
563 * If no brightness levels are provided and max_brightness is in pwm_backlight_probe()
565 * max_brightness is set to 0 when brightness levels is not in pwm_backlight_probe()
582 if (data->levels[i] > pb->scale) in pwm_backlight_probe()
583 pb->scale = data->levels[i]; in pwm_backlight_probe()
585 pb->levels = data->levels; in pwm_backlight_probe()