Lines Matching full:backlight

6 #include <linux/backlight.h>
67 hw_level = scale(user_level, 0, user_max, 0, panel->backlight.max); in clamp_user_to_hw()
68 hw_level = clamp(hw_level, panel->backlight.min, panel->backlight.max); in clamp_user_to_hw()
79 return scale(hw_level, panel->backlight.min, panel->backlight.max, in scale_hw_to_user()
88 drm_WARN_ON(&dev_priv->drm, panel->backlight.pwm_level_max == 0); in intel_backlight_invert_pwm_level()
95 return panel->backlight.pwm_level_max - val + panel->backlight.pwm_level_min; in intel_backlight_invert_pwm_level()
107 drm_dbg_kms(&i915->drm, "set backlight PWM = %d\n", val); in intel_backlight_set_pwm_level()
108 panel->backlight.pwm_funcs->set(conn_state, val); in intel_backlight_set_pwm_level()
117 panel->backlight.max == 0 || panel->backlight.pwm_level_max == 0); in intel_backlight_level_to_pwm()
119 val = scale(val, panel->backlight.min, panel->backlight.max, in intel_backlight_level_to_pwm()
120 panel->backlight.pwm_level_min, panel->backlight.pwm_level_max); in intel_backlight_level_to_pwm()
131 panel->backlight.max == 0 || panel->backlight.pwm_level_max == 0); in intel_backlight_level_from_pwm()
135 val = panel->backlight.pwm_level_max - (val - panel->backlight.pwm_level_min); in intel_backlight_level_from_pwm()
137 return scale(val, panel->backlight.pwm_level_min, panel->backlight.pwm_level_max, in intel_backlight_level_from_pwm()
138 panel->backlight.min, panel->backlight.max); in intel_backlight_level_from_pwm()
165 if (panel->backlight.combination_mode) { in i9xx_get_backlight()
191 BXT_BLC_PWM_DUTY(panel->backlight.controller)); in bxt_get_backlight()
199 pwm_get_state(panel->backlight.pwm, &state); in ext_pwm_get_backlight()
229 drm_WARN_ON(&dev_priv->drm, panel->backlight.pwm_level_max == 0); in i9xx_set_backlight()
231 if (panel->backlight.combination_mode) { in i9xx_set_backlight()
234 lbpc = level * 0xfe / panel->backlight.pwm_level_max + 1; in i9xx_set_backlight()
268 BXT_BLC_PWM_DUTY(panel->backlight.controller), level); in bxt_set_backlight()
275 pwm_set_relative_duty_cycle(&panel->backlight.pwm_state, level, 100); in ext_pwm_set_backlight()
276 pwm_apply_state(panel->backlight.pwm, &panel->backlight.pwm_state); in ext_pwm_set_backlight()
286 drm_dbg_kms(&i915->drm, "set backlight level = %d\n", level); in intel_panel_actually_set_backlight()
288 panel->backlight.funcs->set(conn_state, level); in intel_panel_actually_set_backlight()
291 /* set backlight brightness to level in range [0..max], assuming hw min is
304 * connection_mutex isn't held across the entire backlight in intel_backlight_set_acpi()
308 if (!panel->backlight.present || !conn_state->crtc) in intel_backlight_set_acpi()
311 mutex_lock(&dev_priv->display.backlight.lock); in intel_backlight_set_acpi()
313 drm_WARN_ON(&dev_priv->drm, panel->backlight.max == 0); in intel_backlight_set_acpi()
316 panel->backlight.level = hw_level; in intel_backlight_set_acpi()
318 if (panel->backlight.device) in intel_backlight_set_acpi()
319 panel->backlight.device->props.brightness = in intel_backlight_set_acpi()
321 panel->backlight.level, in intel_backlight_set_acpi()
322 panel->backlight.device->props.max_brightness); in intel_backlight_set_acpi()
324 if (panel->backlight.enabled) in intel_backlight_set_acpi()
327 mutex_unlock(&dev_priv->display.backlight.lock); in intel_backlight_set_acpi()
349 "cpu backlight was enabled, disabling\n"); in lpt_disable_backlight()
413 BXT_BLC_PWM_CTL(panel->backlight.controller)); in bxt_disable_backlight()
414 intel_de_write(dev_priv, BXT_BLC_PWM_CTL(panel->backlight.controller), in bxt_disable_backlight()
417 if (panel->backlight.controller == 1) { in bxt_disable_backlight()
434 BXT_BLC_PWM_CTL(panel->backlight.controller)); in cnp_disable_backlight()
435 intel_de_write(dev_priv, BXT_BLC_PWM_CTL(panel->backlight.controller), in cnp_disable_backlight()
446 panel->backlight.pwm_state.enabled = false; in ext_pwm_disable_backlight()
447 pwm_apply_state(panel->backlight.pwm, &panel->backlight.pwm_state); in ext_pwm_disable_backlight()
456 if (!panel->backlight.present) in intel_backlight_disable()
460 * Do not disable backlight on the vga_switcheroo path. When switching in intel_backlight_disable()
462 * backlight. This will leave the backlight on unnecessarily when in intel_backlight_disable()
467 "Skipping backlight disable on vga switch\n"); in intel_backlight_disable()
471 mutex_lock(&dev_priv->display.backlight.lock); in intel_backlight_disable()
473 if (panel->backlight.device) in intel_backlight_disable()
474 panel->backlight.device->props.power = FB_BLANK_POWERDOWN; in intel_backlight_disable()
475 panel->backlight.enabled = false; in intel_backlight_disable()
476 panel->backlight.funcs->disable(old_conn_state, 0); in intel_backlight_disable()
478 mutex_unlock(&dev_priv->display.backlight.lock); in intel_backlight_disable()
491 drm_dbg_kms(&dev_priv->drm, "pch backlight already enabled\n"); in lpt_enable_backlight()
498 if (panel->backlight.alternate_pwm_increment) in lpt_enable_backlight()
505 if (panel->backlight.alternate_pwm_increment) in lpt_enable_backlight()
512 pch_ctl2 = panel->backlight.pwm_level_max << 16; in lpt_enable_backlight()
516 if (panel->backlight.active_low_pwm) in lpt_enable_backlight()
543 drm_dbg_kms(&dev_priv->drm, "cpu backlight already enabled\n"); in pch_enable_backlight()
550 drm_dbg_kms(&dev_priv->drm, "pch backlight already enabled\n"); in pch_enable_backlight()
566 pch_ctl2 = panel->backlight.pwm_level_max << 16; in pch_enable_backlight()
570 if (panel->backlight.active_low_pwm) in pch_enable_backlight()
589 drm_dbg_kms(&dev_priv->drm, "backlight already enabled\n"); in i9xx_enable_backlight()
593 freq = panel->backlight.pwm_level_max; in i9xx_enable_backlight()
594 if (panel->backlight.combination_mode) in i9xx_enable_backlight()
598 if (panel->backlight.combination_mode) in i9xx_enable_backlight()
600 if (IS_PINEVIEW(dev_priv) && panel->backlight.active_low_pwm) in i9xx_enable_backlight()
610 * Needed to enable backlight on some 855gm models. BLC_HIST_CTL is in i9xx_enable_backlight()
612 * that has backlight. in i9xx_enable_backlight()
629 drm_dbg_kms(&dev_priv->drm, "backlight already enabled\n"); in i965_enable_backlight()
634 freq = panel->backlight.pwm_level_max; in i965_enable_backlight()
635 if (panel->backlight.combination_mode) in i965_enable_backlight()
642 if (panel->backlight.combination_mode) in i965_enable_backlight()
644 if (panel->backlight.active_low_pwm) in i965_enable_backlight()
664 drm_dbg_kms(&dev_priv->drm, "backlight already enabled\n"); in vlv_enable_backlight()
669 ctl = panel->backlight.pwm_level_max << 16; in vlv_enable_backlight()
676 if (panel->backlight.active_low_pwm) in vlv_enable_backlight()
694 if (panel->backlight.controller == 1) { in bxt_enable_backlight()
704 if (panel->backlight.util_pin_active_low) in bxt_enable_backlight()
711 BXT_BLC_PWM_CTL(panel->backlight.controller)); in bxt_enable_backlight()
713 drm_dbg_kms(&dev_priv->drm, "backlight already enabled\n"); in bxt_enable_backlight()
716 BXT_BLC_PWM_CTL(panel->backlight.controller), in bxt_enable_backlight()
721 BXT_BLC_PWM_FREQ(panel->backlight.controller), in bxt_enable_backlight()
722 panel->backlight.pwm_level_max); in bxt_enable_backlight()
727 if (panel->backlight.active_low_pwm) in bxt_enable_backlight()
730 intel_de_write(dev_priv, BXT_BLC_PWM_CTL(panel->backlight.controller), in bxt_enable_backlight()
733 BXT_BLC_PWM_CTL(panel->backlight.controller)); in bxt_enable_backlight()
734 intel_de_write(dev_priv, BXT_BLC_PWM_CTL(panel->backlight.controller), in bxt_enable_backlight()
747 BXT_BLC_PWM_CTL(panel->backlight.controller)); in cnp_enable_backlight()
749 drm_dbg_kms(&dev_priv->drm, "backlight already enabled\n"); in cnp_enable_backlight()
752 BXT_BLC_PWM_CTL(panel->backlight.controller), in cnp_enable_backlight()
757 BXT_BLC_PWM_FREQ(panel->backlight.controller), in cnp_enable_backlight()
758 panel->backlight.pwm_level_max); in cnp_enable_backlight()
763 if (panel->backlight.active_low_pwm) in cnp_enable_backlight()
766 intel_de_write(dev_priv, BXT_BLC_PWM_CTL(panel->backlight.controller), in cnp_enable_backlight()
769 BXT_BLC_PWM_CTL(panel->backlight.controller)); in cnp_enable_backlight()
770 intel_de_write(dev_priv, BXT_BLC_PWM_CTL(panel->backlight.controller), in cnp_enable_backlight()
780 pwm_set_relative_duty_cycle(&panel->backlight.pwm_state, level, 100); in ext_pwm_enable_backlight()
781 panel->backlight.pwm_state.enabled = true; in ext_pwm_enable_backlight()
782 pwm_apply_state(panel->backlight.pwm, &panel->backlight.pwm_state); in ext_pwm_enable_backlight()
791 WARN_ON(panel->backlight.max == 0); in __intel_backlight_enable()
793 if (panel->backlight.level <= panel->backlight.min) { in __intel_backlight_enable()
794 panel->backlight.level = panel->backlight.max; in __intel_backlight_enable()
795 if (panel->backlight.device) in __intel_backlight_enable()
796 panel->backlight.device->props.brightness = in __intel_backlight_enable()
798 panel->backlight.level, in __intel_backlight_enable()
799 panel->backlight.device->props.max_brightness); in __intel_backlight_enable()
802 panel->backlight.funcs->enable(crtc_state, conn_state, panel->backlight.level); in __intel_backlight_enable()
803 panel->backlight.enabled = true; in __intel_backlight_enable()
804 if (panel->backlight.device) in __intel_backlight_enable()
805 panel->backlight.device->props.power = FB_BLANK_UNBLANK; in __intel_backlight_enable()
816 if (!panel->backlight.present) in intel_backlight_enable()
821 mutex_lock(&dev_priv->display.backlight.lock); in intel_backlight_enable()
825 mutex_unlock(&dev_priv->display.backlight.lock); in intel_backlight_enable()
835 mutex_lock(&dev_priv->display.backlight.lock); in intel_panel_get_backlight()
837 if (panel->backlight.enabled) in intel_panel_get_backlight()
838 val = panel->backlight.funcs->get(connector, intel_connector_get_pipe(connector)); in intel_panel_get_backlight()
840 mutex_unlock(&dev_priv->display.backlight.lock); in intel_panel_get_backlight()
842 drm_dbg_kms(&dev_priv->drm, "get backlight PWM = %d\n", val); in intel_panel_get_backlight()
853 panel->backlight.min, panel->backlight.max); in scale_user_to_hw()
856 /* set backlight brightness to level in range [0..max], scaling wrt hw min */
865 if (!panel->backlight.present) in intel_panel_set_backlight()
868 mutex_lock(&dev_priv->display.backlight.lock); in intel_panel_set_backlight()
870 drm_WARN_ON(&dev_priv->drm, panel->backlight.max == 0); in intel_panel_set_backlight()
873 panel->backlight.level = hw_level; in intel_panel_set_backlight()
875 if (panel->backlight.enabled) in intel_panel_set_backlight()
878 mutex_unlock(&dev_priv->display.backlight.lock); in intel_panel_set_backlight()
895 * backlight class device does not make it easy to differentiate in intel_backlight_device_update_status()
899 if (panel->backlight.enabled) { in intel_backlight_device_update_status()
900 if (panel->backlight.power) { in intel_backlight_device_update_status()
903 panel->backlight.power(connector, enable); in intel_backlight_device_update_status()
950 if (WARN_ON(panel->backlight.device)) in intel_backlight_device_register()
953 if (!panel->backlight.present) in intel_backlight_device_register()
956 WARN_ON(panel->backlight.max == 0); in intel_backlight_device_register()
967 * Note: Everything should work even if the backlight device max in intel_backlight_device_register()
970 props.max_brightness = panel->backlight.max; in intel_backlight_device_register()
972 panel->backlight.level, in intel_backlight_device_register()
975 if (panel->backlight.enabled) in intel_backlight_device_register()
989 * prevents registration of multiple backlight devices in the in intel_backlight_device_register()
991 * compatibility. Use unique names for subsequent backlight devices as a in intel_backlight_device_register()
995 name = kasprintf(GFP_KERNEL, "card%d-%s-backlight", in intel_backlight_device_register()
1005 "[CONNECTOR:%d:%s] backlight device %s register failed: %ld\n", in intel_backlight_device_register()
1011 panel->backlight.device = bd; in intel_backlight_device_register()
1014 "[CONNECTOR:%d:%s] backlight device %s registered\n", in intel_backlight_device_register()
1027 if (panel->backlight.device) { in intel_backlight_device_unregister()
1028 backlight_device_unregister(panel->backlight.device); in intel_backlight_device_unregister()
1029 panel->backlight.device = NULL; in intel_backlight_device_unregister()
1064 if (panel->backlight.alternate_pwm_increment) in spt_hz_to_pwm()
1083 if (panel->backlight.alternate_pwm_increment) in lpt_hz_to_pwm()
1110 * clock frequency/32) in total for a complete cycle of modulated backlight
1174 u16 pwm_freq_hz = connector->panel.vbt.backlight.pwm_freq_hz; in get_vbt_pwm_freq()
1178 "VBT defined backlight frequency %u Hz\n", in get_vbt_pwm_freq()
1183 "default backlight frequency %u Hz\n", in get_vbt_pwm_freq()
1197 if (!panel->backlight.pwm_funcs->hz_to_pwm) { in get_backlight_max_vbt()
1199 "backlight frequency conversion not supported\n"); in get_backlight_max_vbt()
1203 pwm = panel->backlight.pwm_funcs->hz_to_pwm(connector, pwm_freq_hz); in get_backlight_max_vbt()
1206 "backlight frequency conversion failed\n"); in get_backlight_max_vbt()
1222 drm_WARN_ON(&dev_priv->drm, panel->backlight.pwm_level_max == 0); in get_backlight_min_vbt()
1231 min = clamp_t(int, connector->panel.vbt.backlight.min_brightness, 0, 64); in get_backlight_min_vbt()
1232 if (min != connector->panel.vbt.backlight.min_brightness) { in get_backlight_min_vbt()
1234 "clamping VBT min backlight %d/255 to %d/255\n", in get_backlight_min_vbt()
1235 connector->panel.vbt.backlight.min_brightness, min); in get_backlight_min_vbt()
1239 return scale(min, 0, 255, 0, panel->backlight.pwm_level_max); in get_backlight_min_vbt()
1253 panel->backlight.alternate_pwm_increment = alt; in lpt_setup_backlight()
1256 panel->backlight.active_low_pwm = pch_ctl1 & BLM_PCH_POLARITY; in lpt_setup_backlight()
1259 panel->backlight.pwm_level_max = pch_ctl2 >> 16; in lpt_setup_backlight()
1263 if (!panel->backlight.pwm_level_max) in lpt_setup_backlight()
1264 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in lpt_setup_backlight()
1266 if (!panel->backlight.pwm_level_max) in lpt_setup_backlight()
1269 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in lpt_setup_backlight()
1271 panel->backlight.pwm_enabled = pch_ctl1 & BLM_PCH_PWM_ENABLE; in lpt_setup_backlight()
1273 cpu_mode = panel->backlight.pwm_enabled && HAS_PCH_LPT(dev_priv) && in lpt_setup_backlight()
1281 "CPU backlight register was enabled, switching to PCH override\n"); in lpt_setup_backlight()
1302 panel->backlight.active_low_pwm = pch_ctl1 & BLM_PCH_POLARITY; in pch_setup_backlight()
1305 panel->backlight.pwm_level_max = pch_ctl2 >> 16; in pch_setup_backlight()
1307 if (!panel->backlight.pwm_level_max) in pch_setup_backlight()
1308 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in pch_setup_backlight()
1310 if (!panel->backlight.pwm_level_max) in pch_setup_backlight()
1313 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in pch_setup_backlight()
1316 panel->backlight.pwm_enabled = (cpu_ctl2 & BLM_PWM_ENABLE) && in pch_setup_backlight()
1331 panel->backlight.combination_mode = ctl & BLM_LEGACY_MODE; in i9xx_setup_backlight()
1334 panel->backlight.active_low_pwm = ctl & BLM_POLARITY_PNV; in i9xx_setup_backlight()
1336 panel->backlight.pwm_level_max = ctl >> 17; in i9xx_setup_backlight()
1338 if (!panel->backlight.pwm_level_max) { in i9xx_setup_backlight()
1339 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in i9xx_setup_backlight()
1340 panel->backlight.pwm_level_max >>= 1; in i9xx_setup_backlight()
1343 if (!panel->backlight.pwm_level_max) in i9xx_setup_backlight()
1346 if (panel->backlight.combination_mode) in i9xx_setup_backlight()
1347 panel->backlight.pwm_level_max *= 0xff; in i9xx_setup_backlight()
1349 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in i9xx_setup_backlight()
1353 val = clamp(val, panel->backlight.pwm_level_min, panel->backlight.pwm_level_max); in i9xx_setup_backlight()
1355 panel->backlight.pwm_enabled = val != 0; in i9xx_setup_backlight()
1367 panel->backlight.combination_mode = ctl2 & BLM_COMBINATION_MODE; in i965_setup_backlight()
1368 panel->backlight.active_low_pwm = ctl2 & BLM_POLARITY_I965; in i965_setup_backlight()
1371 panel->backlight.pwm_level_max = ctl >> 16; in i965_setup_backlight()
1373 if (!panel->backlight.pwm_level_max) in i965_setup_backlight()
1374 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in i965_setup_backlight()
1376 if (!panel->backlight.pwm_level_max) in i965_setup_backlight()
1379 if (panel->backlight.combination_mode) in i965_setup_backlight()
1380 panel->backlight.pwm_level_max *= 0xff; in i965_setup_backlight()
1382 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in i965_setup_backlight()
1384 panel->backlight.pwm_enabled = ctl2 & BLM_PWM_ENABLE; in i965_setup_backlight()
1399 panel->backlight.active_low_pwm = ctl2 & BLM_POLARITY_I965; in vlv_setup_backlight()
1402 panel->backlight.pwm_level_max = ctl >> 16; in vlv_setup_backlight()
1404 if (!panel->backlight.pwm_level_max) in vlv_setup_backlight()
1405 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in vlv_setup_backlight()
1407 if (!panel->backlight.pwm_level_max) in vlv_setup_backlight()
1410 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in vlv_setup_backlight()
1412 panel->backlight.pwm_enabled = ctl2 & BLM_PWM_ENABLE; in vlv_setup_backlight()
1424 panel->backlight.controller = connector->panel.vbt.backlight.controller; in bxt_setup_backlight()
1427 BXT_BLC_PWM_CTL(panel->backlight.controller)); in bxt_setup_backlight()
1430 if (panel->backlight.controller == 1) { in bxt_setup_backlight()
1432 panel->backlight.util_pin_active_low = in bxt_setup_backlight()
1436 panel->backlight.active_low_pwm = pwm_ctl & BXT_BLC_PWM_POLARITY; in bxt_setup_backlight()
1437 panel->backlight.pwm_level_max = in bxt_setup_backlight()
1438 intel_de_read(dev_priv, BXT_BLC_PWM_FREQ(panel->backlight.controller)); in bxt_setup_backlight()
1440 if (!panel->backlight.pwm_level_max) in bxt_setup_backlight()
1441 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in bxt_setup_backlight()
1443 if (!panel->backlight.pwm_level_max) in bxt_setup_backlight()
1446 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in bxt_setup_backlight()
1448 panel->backlight.pwm_enabled = pwm_ctl & BXT_BLC_PWM_ENABLE; in bxt_setup_backlight()
1461 * CNP has the BXT implementation of backlight, but with only one in cnp_setup_backlight()
1465 panel->backlight.controller = 0; in cnp_setup_backlight()
1468 BXT_BLC_PWM_CTL(panel->backlight.controller)); in cnp_setup_backlight()
1470 panel->backlight.active_low_pwm = pwm_ctl & BXT_BLC_PWM_POLARITY; in cnp_setup_backlight()
1471 panel->backlight.pwm_level_max = in cnp_setup_backlight()
1472 intel_de_read(dev_priv, BXT_BLC_PWM_FREQ(panel->backlight.controller)); in cnp_setup_backlight()
1474 if (!panel->backlight.pwm_level_max) in cnp_setup_backlight()
1475 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in cnp_setup_backlight()
1477 if (!panel->backlight.pwm_level_max) in cnp_setup_backlight()
1480 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in cnp_setup_backlight()
1482 panel->backlight.pwm_enabled = pwm_ctl & BXT_BLC_PWM_ENABLE; in cnp_setup_backlight()
1496 /* Get the right PWM chip for DSI backlight according to VBT */ in ext_pwm_setup_backlight()
1498 panel->backlight.pwm = pwm_get(dev->dev, "pwm_pmic_backlight"); in ext_pwm_setup_backlight()
1501 panel->backlight.pwm = pwm_get(dev->dev, "pwm_soc_backlight"); in ext_pwm_setup_backlight()
1505 if (IS_ERR(panel->backlight.pwm)) { in ext_pwm_setup_backlight()
1508 panel->backlight.pwm = NULL; in ext_pwm_setup_backlight()
1512 panel->backlight.pwm_level_max = 100; /* 100% */ in ext_pwm_setup_backlight()
1513 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in ext_pwm_setup_backlight()
1515 if (pwm_is_enabled(panel->backlight.pwm)) { in ext_pwm_setup_backlight()
1517 pwm_get_state(panel->backlight.pwm, &panel->backlight.pwm_state); in ext_pwm_setup_backlight()
1519 level = pwm_get_relative_duty_cycle(&panel->backlight.pwm_state, in ext_pwm_setup_backlight()
1522 panel->backlight.pwm_enabled = true; in ext_pwm_setup_backlight()
1525 NSEC_PER_SEC / (unsigned long)panel->backlight.pwm_state.period, in ext_pwm_setup_backlight()
1529 panel->backlight.pwm_state.period = in ext_pwm_setup_backlight()
1533 drm_info(&dev_priv->drm, "Using %s PWM for LCD backlight control\n", in ext_pwm_setup_backlight()
1543 panel->backlight.pwm_funcs->set(conn_state, in intel_pwm_set_backlight()
1552 panel->backlight.pwm_funcs->get(connector, pipe)); in intel_pwm_get_backlight()
1561 panel->backlight.pwm_funcs->enable(crtc_state, conn_state, in intel_pwm_enable_backlight()
1570 panel->backlight.pwm_funcs->disable(conn_state, in intel_pwm_disable_backlight()
1577 int ret = panel->backlight.pwm_funcs->setup(connector, pipe); in intel_pwm_setup_backlight()
1582 panel->backlight.min = panel->backlight.pwm_level_min; in intel_pwm_setup_backlight()
1583 panel->backlight.max = panel->backlight.pwm_level_max; in intel_pwm_setup_backlight()
1584 panel->backlight.level = intel_pwm_get_backlight(connector, pipe); in intel_pwm_setup_backlight()
1585 panel->backlight.enabled = panel->backlight.pwm_enabled; in intel_pwm_setup_backlight()
1599 if (!panel->backlight.present) in intel_backlight_update()
1602 mutex_lock(&dev_priv->display.backlight.lock); in intel_backlight_update()
1603 if (!panel->backlight.enabled) in intel_backlight_update()
1606 mutex_unlock(&dev_priv->display.backlight.lock); in intel_backlight_update()
1615 if (!connector->panel.vbt.backlight.present) { in intel_backlight_setup()
1618 "no backlight present per VBT, but present per quirk\n"); in intel_backlight_setup()
1621 "no backlight present per VBT\n"); in intel_backlight_setup()
1627 if (drm_WARN_ON(&dev_priv->drm, !panel->backlight.funcs)) in intel_backlight_setup()
1631 mutex_lock(&dev_priv->display.backlight.lock); in intel_backlight_setup()
1632 ret = panel->backlight.funcs->setup(connector, pipe); in intel_backlight_setup()
1633 mutex_unlock(&dev_priv->display.backlight.lock); in intel_backlight_setup()
1637 "failed to setup backlight for connector %s\n", in intel_backlight_setup()
1642 panel->backlight.present = true; in intel_backlight_setup()
1645 "Connector %s backlight initialized, %s, brightness %u/%u\n", in intel_backlight_setup()
1647 str_enabled_disabled(panel->backlight.enabled), in intel_backlight_setup()
1648 panel->backlight.level, panel->backlight.max); in intel_backlight_setup()
1656 if (panel->backlight.pwm) in intel_backlight_destroy()
1657 pwm_put(panel->backlight.pwm); in intel_backlight_destroy()
1659 panel->backlight.present = false; in intel_backlight_destroy()
1750 /* Set up chip specific backlight functions */
1762 panel->backlight.pwm_funcs = &bxt_pwm_funcs; in intel_backlight_init_funcs()
1764 panel->backlight.pwm_funcs = &cnp_pwm_funcs; in intel_backlight_init_funcs()
1767 panel->backlight.pwm_funcs = &lpt_pwm_funcs; in intel_backlight_init_funcs()
1769 panel->backlight.pwm_funcs = &spt_pwm_funcs; in intel_backlight_init_funcs()
1771 panel->backlight.pwm_funcs = &pch_pwm_funcs; in intel_backlight_init_funcs()
1774 panel->backlight.pwm_funcs = &ext_pwm_funcs; in intel_backlight_init_funcs()
1776 panel->backlight.pwm_funcs = &vlv_pwm_funcs; in intel_backlight_init_funcs()
1779 panel->backlight.pwm_funcs = &i965_pwm_funcs; in intel_backlight_init_funcs()
1781 panel->backlight.pwm_funcs = &i9xx_pwm_funcs; in intel_backlight_init_funcs()
1789 connector->panel.backlight.power = intel_pps_backlight_power; in intel_backlight_init_funcs()
1792 /* We're using a standard PWM backlight interface */ in intel_backlight_init_funcs()
1793 panel->backlight.funcs = &pwm_bl_funcs; in intel_backlight_init_funcs()