Lines Matching full:connector
62 static u32 clamp_user_to_hw(struct intel_connector *connector, in clamp_user_to_hw() argument
65 struct intel_panel *panel = &connector->panel; in clamp_user_to_hw()
75 static u32 scale_hw_to_user(struct intel_connector *connector, in scale_hw_to_user() argument
78 struct intel_panel *panel = &connector->panel; in scale_hw_to_user()
84 u32 intel_backlight_invert_pwm_level(struct intel_connector *connector, u32 val) in intel_backlight_invert_pwm_level() argument
86 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_invert_pwm_level()
87 struct intel_panel *panel = &connector->panel; in intel_backlight_invert_pwm_level()
104 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_backlight_set_pwm_level() local
105 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_set_pwm_level()
106 struct intel_panel *panel = &connector->panel; in intel_backlight_set_pwm_level()
108 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] set backlight PWM = %d\n", in intel_backlight_set_pwm_level()
109 connector->base.base.id, connector->base.name, val); in intel_backlight_set_pwm_level()
113 u32 intel_backlight_level_to_pwm(struct intel_connector *connector, u32 val) in intel_backlight_level_to_pwm() argument
115 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_level_to_pwm()
116 struct intel_panel *panel = &connector->panel; in intel_backlight_level_to_pwm()
124 return intel_backlight_invert_pwm_level(connector, val); in intel_backlight_level_to_pwm()
127 u32 intel_backlight_level_from_pwm(struct intel_connector *connector, u32 val) in intel_backlight_level_from_pwm() argument
129 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_level_from_pwm()
130 struct intel_panel *panel = &connector->panel; in intel_backlight_level_from_pwm()
143 static u32 lpt_get_backlight(struct intel_connector *connector, enum pipe unused) in lpt_get_backlight() argument
145 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_get_backlight()
150 static u32 pch_get_backlight(struct intel_connector *connector, enum pipe unused) in pch_get_backlight() argument
152 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_get_backlight()
157 static u32 i9xx_get_backlight(struct intel_connector *connector, enum pipe unused) in i9xx_get_backlight() argument
159 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_get_backlight()
160 struct intel_panel *panel = &connector->panel; in i9xx_get_backlight()
177 static u32 vlv_get_backlight(struct intel_connector *connector, enum pipe pipe) in vlv_get_backlight() argument
179 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_get_backlight()
187 static u32 bxt_get_backlight(struct intel_connector *connector, enum pipe unused) in bxt_get_backlight() argument
189 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_get_backlight()
190 struct intel_panel *panel = &connector->panel; in bxt_get_backlight()
195 static u32 ext_pwm_get_backlight(struct intel_connector *connector, enum pipe unused) in ext_pwm_get_backlight() argument
197 struct intel_panel *panel = &connector->panel; in ext_pwm_get_backlight()
206 struct intel_connector *connector = to_intel_connector(conn_state->connector); in lpt_set_backlight() local
207 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_set_backlight()
216 struct intel_connector *connector = to_intel_connector(conn_state->connector); in pch_set_backlight() local
217 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_set_backlight()
226 struct intel_connector *connector = to_intel_connector(conn_state->connector); in i9xx_set_backlight() local
227 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_set_backlight()
228 struct intel_panel *panel = &connector->panel; in i9xx_set_backlight()
254 struct intel_connector *connector = to_intel_connector(conn_state->connector); in vlv_set_backlight() local
255 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_set_backlight()
265 struct intel_connector *connector = to_intel_connector(conn_state->connector); in bxt_set_backlight() local
266 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_set_backlight()
267 struct intel_panel *panel = &connector->panel; in bxt_set_backlight()
274 struct intel_panel *panel = &to_intel_connector(conn_state->connector)->panel; in ext_pwm_set_backlight()
283 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_panel_actually_set_backlight() local
284 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_panel_actually_set_backlight()
285 struct intel_panel *panel = &connector->panel; in intel_panel_actually_set_backlight()
287 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] set backlight level = %d\n", in intel_panel_actually_set_backlight()
288 connector->base.base.id, connector->base.name, level); in intel_panel_actually_set_backlight()
299 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_backlight_set_acpi() local
300 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_set_acpi()
301 struct intel_panel *panel = &connector->panel; in intel_backlight_set_acpi()
317 hw_level = clamp_user_to_hw(connector, user_level, user_max); in intel_backlight_set_acpi()
322 scale_hw_to_user(connector, in intel_backlight_set_acpi()
334 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in lpt_disable_backlight() local
335 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_disable_backlight()
350 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] CPU backlight was enabled, disabling\n", in lpt_disable_backlight()
351 connector->base.base.id, connector->base.name); in lpt_disable_backlight()
360 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in pch_disable_backlight() local
361 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_disable_backlight()
377 struct drm_i915_private *i915 = to_i915(old_conn_state->connector->dev); in i965_disable_backlight()
386 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in vlv_disable_backlight() local
387 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_disable_backlight()
397 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in bxt_disable_backlight() local
398 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_disable_backlight()
399 struct intel_panel *panel = &connector->panel; in bxt_disable_backlight()
412 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in cnp_disable_backlight() local
413 struct drm_i915_private *i915 = to_i915(connector->base.dev); in cnp_disable_backlight()
414 struct intel_panel *panel = &connector->panel; in cnp_disable_backlight()
424 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in ext_pwm_disable_backlight() local
425 struct intel_panel *panel = &connector->panel; in ext_pwm_disable_backlight()
435 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in intel_backlight_disable() local
436 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_disable()
437 struct intel_panel *panel = &connector->panel; in intel_backlight_disable()
449 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Skipping backlight disable on vga switch\n", in intel_backlight_disable()
450 connector->base.base.id, connector->base.name); in intel_backlight_disable()
467 struct intel_connector *connector = to_intel_connector(conn_state->connector); in lpt_enable_backlight() local
468 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_enable_backlight()
469 struct intel_panel *panel = &connector->panel; in lpt_enable_backlight()
474 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] PCH backlight already enabled\n", in lpt_enable_backlight()
475 connector->base.base.id, connector->base.name); in lpt_enable_backlight()
511 struct intel_connector *connector = to_intel_connector(conn_state->connector); in pch_enable_backlight() local
512 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_enable_backlight()
513 struct intel_panel *panel = &connector->panel; in pch_enable_backlight()
519 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] CPU backlight already enabled\n", in pch_enable_backlight()
520 connector->base.base.id, connector->base.name); in pch_enable_backlight()
527 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] PCH backlight already enabled\n", in pch_enable_backlight()
528 connector->base.base.id, connector->base.name); in pch_enable_backlight()
559 struct intel_connector *connector = to_intel_connector(conn_state->connector); in i9xx_enable_backlight() local
560 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_enable_backlight()
561 struct intel_panel *panel = &connector->panel; in i9xx_enable_backlight()
566 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] backlight already enabled\n", in i9xx_enable_backlight()
567 connector->base.base.id, connector->base.name); in i9xx_enable_backlight()
599 struct intel_connector *connector = to_intel_connector(conn_state->connector); in i965_enable_backlight() local
600 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i965_enable_backlight()
601 struct intel_panel *panel = &connector->panel; in i965_enable_backlight()
607 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] backlight already enabled\n", in i965_enable_backlight()
608 connector->base.base.id, connector->base.name); in i965_enable_backlight()
635 struct intel_connector *connector = to_intel_connector(conn_state->connector); in vlv_enable_backlight() local
636 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_enable_backlight()
637 struct intel_panel *panel = &connector->panel; in vlv_enable_backlight()
643 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] backlight already enabled\n", in vlv_enable_backlight()
644 connector->base.base.id, connector->base.name); in vlv_enable_backlight()
666 struct intel_connector *connector = to_intel_connector(conn_state->connector); in bxt_enable_backlight() local
667 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_enable_backlight()
668 struct intel_panel *panel = &connector->panel; in bxt_enable_backlight()
676 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] utility pin already enabled\n", in bxt_enable_backlight()
677 connector->base.base.id, connector->base.name); in bxt_enable_backlight()
691 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] backlight already enabled\n", in bxt_enable_backlight()
692 connector->base.base.id, connector->base.name); in bxt_enable_backlight()
716 struct intel_connector *connector = to_intel_connector(conn_state->connector); in cnp_enable_backlight() local
717 struct drm_i915_private *i915 = to_i915(connector->base.dev); in cnp_enable_backlight()
718 struct intel_panel *panel = &connector->panel; in cnp_enable_backlight()
747 struct intel_connector *connector = to_intel_connector(conn_state->connector); in ext_pwm_enable_backlight() local
748 struct intel_panel *panel = &connector->panel; in ext_pwm_enable_backlight()
758 struct intel_connector *connector = to_intel_connector(conn_state->connector); in __intel_backlight_enable() local
759 struct intel_panel *panel = &connector->panel; in __intel_backlight_enable()
767 scale_hw_to_user(connector, in __intel_backlight_enable()
781 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_backlight_enable() local
782 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_enable()
783 struct intel_panel *panel = &connector->panel; in intel_backlight_enable()
799 static u32 intel_panel_get_backlight(struct intel_connector *connector) in intel_panel_get_backlight() argument
801 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_panel_get_backlight()
802 struct intel_panel *panel = &connector->panel; in intel_panel_get_backlight()
808 val = panel->backlight.funcs->get(connector, intel_connector_get_pipe(connector)); in intel_panel_get_backlight()
817 static u32 scale_user_to_hw(struct intel_connector *connector, in scale_user_to_hw() argument
820 struct intel_panel *panel = &connector->panel; in scale_user_to_hw()
830 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_panel_set_backlight() local
831 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_panel_set_backlight()
832 struct intel_panel *panel = &connector->panel; in intel_panel_set_backlight()
842 hw_level = scale_user_to_hw(connector, user_level, user_max); in intel_panel_set_backlight()
853 struct intel_connector *connector = bl_get_data(bd); in intel_backlight_device_update_status() local
854 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_device_update_status()
855 struct intel_panel *panel = &connector->panel; in intel_backlight_device_update_status()
861 intel_panel_set_backlight(connector->base.state, bd->props.brightness, in intel_backlight_device_update_status()
874 panel->backlight.power(connector, enable); in intel_backlight_device_update_status()
887 struct intel_connector *connector = bl_get_data(bd); in intel_backlight_device_get_brightness() local
888 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_device_get_brightness()
897 hw_level = intel_panel_get_backlight(connector); in intel_backlight_device_get_brightness()
898 ret = scale_hw_to_user(connector, in intel_backlight_device_get_brightness()
912 int intel_backlight_device_register(struct intel_connector *connector) in intel_backlight_device_register() argument
914 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_device_register()
915 struct intel_panel *panel = &connector->panel; in intel_backlight_device_register()
942 props.brightness = scale_hw_to_user(connector, in intel_backlight_device_register()
959 * Using the same name independent of the drm device or connector in intel_backlight_device_register()
967 i915->drm.primary->index, connector->base.name); in intel_backlight_device_register()
971 bd = backlight_device_register(name, connector->base.kdev, connector, in intel_backlight_device_register()
976 "[CONNECTOR:%d:%s] backlight device %s register failed: %ld\n", in intel_backlight_device_register()
977 connector->base.base.id, connector->base.name, name, PTR_ERR(bd)); in intel_backlight_device_register()
985 "[CONNECTOR:%d:%s] backlight device %s registered\n", in intel_backlight_device_register()
986 connector->base.base.id, connector->base.name, name); in intel_backlight_device_register()
994 void intel_backlight_device_unregister(struct intel_connector *connector) in intel_backlight_device_unregister() argument
996 struct intel_panel *panel = &connector->panel; in intel_backlight_device_unregister()
1009 static u32 cnp_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in cnp_hz_to_pwm() argument
1011 struct drm_i915_private *i915 = to_i915(connector->base.dev); in cnp_hz_to_pwm()
1020 static u32 bxt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in bxt_hz_to_pwm() argument
1030 static u32 spt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in spt_hz_to_pwm() argument
1032 struct intel_panel *panel = &connector->panel; in spt_hz_to_pwm()
1048 static u32 lpt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in lpt_hz_to_pwm() argument
1050 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_hz_to_pwm()
1051 struct intel_panel *panel = &connector->panel; in lpt_hz_to_pwm()
1071 static u32 pch_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in pch_hz_to_pwm() argument
1073 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_hz_to_pwm()
1087 static u32 i9xx_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in i9xx_hz_to_pwm() argument
1089 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_hz_to_pwm()
1105 static u32 i965_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in i965_hz_to_pwm() argument
1107 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i965_hz_to_pwm()
1123 static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in vlv_hz_to_pwm() argument
1125 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_hz_to_pwm()
1142 static u16 get_vbt_pwm_freq(struct intel_connector *connector) in get_vbt_pwm_freq() argument
1144 struct drm_i915_private *i915 = to_i915(connector->base.dev); in get_vbt_pwm_freq()
1145 u16 pwm_freq_hz = connector->panel.vbt.backlight.pwm_freq_hz; in get_vbt_pwm_freq()
1161 static u32 get_backlight_max_vbt(struct intel_connector *connector) in get_backlight_max_vbt() argument
1163 struct drm_i915_private *i915 = to_i915(connector->base.dev); in get_backlight_max_vbt()
1164 struct intel_panel *panel = &connector->panel; in get_backlight_max_vbt()
1165 u16 pwm_freq_hz = get_vbt_pwm_freq(connector); in get_backlight_max_vbt()
1174 pwm = panel->backlight.pwm_funcs->hz_to_pwm(connector, pwm_freq_hz); in get_backlight_max_vbt()
1187 static u32 get_backlight_min_vbt(struct intel_connector *connector) in get_backlight_min_vbt() argument
1189 struct drm_i915_private *i915 = to_i915(connector->base.dev); in get_backlight_min_vbt()
1190 struct intel_panel *panel = &connector->panel; in get_backlight_min_vbt()
1202 min = clamp_t(int, connector->panel.vbt.backlight.min_brightness, 0, 64); in get_backlight_min_vbt()
1203 if (min != connector->panel.vbt.backlight.min_brightness) { in get_backlight_min_vbt()
1206 connector->panel.vbt.backlight.min_brightness, min); in get_backlight_min_vbt()
1213 static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unused) in lpt_setup_backlight() argument
1215 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_setup_backlight()
1216 struct intel_panel *panel = &connector->panel; in lpt_setup_backlight()
1235 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in lpt_setup_backlight()
1240 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in lpt_setup_backlight()
1249 val = pch_get_backlight(connector, unused); in lpt_setup_backlight()
1255 lpt_set_backlight(connector->base.state, val); in lpt_setup_backlight()
1264 "[CONNECTOR:%d:%s] Using native PCH PWM for backlight control\n", in lpt_setup_backlight()
1265 connector->base.base.id, connector->base.name); in lpt_setup_backlight()
1270 static int pch_setup_backlight(struct intel_connector *connector, enum pipe unused) in pch_setup_backlight() argument
1272 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_setup_backlight()
1273 struct intel_panel *panel = &connector->panel; in pch_setup_backlight()
1283 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in pch_setup_backlight()
1288 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in pch_setup_backlight()
1295 "[CONNECTOR:%d:%s] Using native PCH PWM for backlight control\n", in pch_setup_backlight()
1296 connector->base.base.id, connector->base.name); in pch_setup_backlight()
1301 static int i9xx_setup_backlight(struct intel_connector *connector, enum pipe unused) in i9xx_setup_backlight() argument
1303 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_setup_backlight()
1304 struct intel_panel *panel = &connector->panel; in i9xx_setup_backlight()
1318 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in i9xx_setup_backlight()
1328 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in i9xx_setup_backlight()
1330 val = i9xx_get_backlight(connector, unused); in i9xx_setup_backlight()
1331 val = intel_backlight_invert_pwm_level(connector, val); in i9xx_setup_backlight()
1337 "[CONNECTOR:%d:%s] Using native PWM for backlight control\n", in i9xx_setup_backlight()
1338 connector->base.base.id, connector->base.name); in i9xx_setup_backlight()
1343 static int i965_setup_backlight(struct intel_connector *connector, enum pipe unused) in i965_setup_backlight() argument
1345 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i965_setup_backlight()
1346 struct intel_panel *panel = &connector->panel; in i965_setup_backlight()
1357 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in i965_setup_backlight()
1365 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in i965_setup_backlight()
1370 "[CONNECTOR:%d:%s] Using native PWM for backlight control\n", in i965_setup_backlight()
1371 connector->base.base.id, connector->base.name); in i965_setup_backlight()
1376 static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe) in vlv_setup_backlight() argument
1378 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_setup_backlight()
1379 struct intel_panel *panel = &connector->panel; in vlv_setup_backlight()
1392 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in vlv_setup_backlight()
1397 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in vlv_setup_backlight()
1402 "[CONNECTOR:%d:%s] Using native PWM for backlight control (on pipe %c)\n", in vlv_setup_backlight()
1403 connector->base.base.id, connector->base.name, pipe_name(pipe)); in vlv_setup_backlight()
1409 bxt_setup_backlight(struct intel_connector *connector, enum pipe unused) in bxt_setup_backlight() argument
1411 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_setup_backlight()
1412 struct intel_panel *panel = &connector->panel; in bxt_setup_backlight()
1415 panel->backlight.controller = connector->panel.vbt.backlight.controller; in bxt_setup_backlight()
1432 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in bxt_setup_backlight()
1437 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in bxt_setup_backlight()
1442 "[CONNECTOR:%d:%s] Using native PWM for backlight control (controller=%d)\n", in bxt_setup_backlight()
1443 connector->base.base.id, connector->base.name, in bxt_setup_backlight()
1474 cnp_setup_backlight(struct intel_connector *connector, enum pipe unused) in cnp_setup_backlight() argument
1476 struct drm_i915_private *i915 = to_i915(connector->base.dev); in cnp_setup_backlight()
1477 struct intel_panel *panel = &connector->panel; in cnp_setup_backlight()
1484 panel->backlight.controller = connector->panel.vbt.backlight.controller; in cnp_setup_backlight()
1486 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Invalid backlight controller %d, assuming 0\n", in cnp_setup_backlight()
1487 connector->base.base.id, connector->base.name, in cnp_setup_backlight()
1500 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in cnp_setup_backlight()
1505 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in cnp_setup_backlight()
1510 "[CONNECTOR:%d:%s] Using native PCH PWM for backlight control (controller=%d)\n", in cnp_setup_backlight()
1511 connector->base.base.id, connector->base.name, in cnp_setup_backlight()
1517 static int ext_pwm_setup_backlight(struct intel_connector *connector, in ext_pwm_setup_backlight() argument
1520 struct drm_i915_private *i915 = to_i915(connector->base.dev); in ext_pwm_setup_backlight()
1521 struct intel_panel *panel = &connector->panel; in ext_pwm_setup_backlight()
1526 if (connector->panel.vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) { in ext_pwm_setup_backlight()
1535 drm_err(&i915->drm, "[CONNECTOR:%d:%s] Failed to get the %s PWM chip\n", in ext_pwm_setup_backlight()
1536 connector->base.base.id, connector->base.name, desc); in ext_pwm_setup_backlight()
1542 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in ext_pwm_setup_backlight()
1550 level = intel_backlight_invert_pwm_level(connector, level); in ext_pwm_setup_backlight()
1553 …drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] PWM already enabled at freq %ld, VBT freq %d, level %d\… in ext_pwm_setup_backlight()
1554 connector->base.base.id, connector->base.name, in ext_pwm_setup_backlight()
1556 get_vbt_pwm_freq(connector), level); in ext_pwm_setup_backlight()
1560 NSEC_PER_SEC / get_vbt_pwm_freq(connector); in ext_pwm_setup_backlight()
1564 "[CONNECTOR:%d:%s] Using %s PWM for backlight control\n", in ext_pwm_setup_backlight()
1565 connector->base.base.id, connector->base.name, desc); in ext_pwm_setup_backlight()
1572 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_pwm_set_backlight() local
1573 struct intel_panel *panel = &connector->panel; in intel_pwm_set_backlight()
1576 intel_backlight_invert_pwm_level(connector, level)); in intel_pwm_set_backlight()
1579 static u32 intel_pwm_get_backlight(struct intel_connector *connector, enum pipe pipe) in intel_pwm_get_backlight() argument
1581 struct intel_panel *panel = &connector->panel; in intel_pwm_get_backlight()
1583 return intel_backlight_invert_pwm_level(connector, in intel_pwm_get_backlight()
1584 panel->backlight.pwm_funcs->get(connector, pipe)); in intel_pwm_get_backlight()
1590 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_pwm_enable_backlight() local
1591 struct intel_panel *panel = &connector->panel; in intel_pwm_enable_backlight()
1594 intel_backlight_invert_pwm_level(connector, level)); in intel_pwm_enable_backlight()
1599 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_pwm_disable_backlight() local
1600 struct intel_panel *panel = &connector->panel; in intel_pwm_disable_backlight()
1603 intel_backlight_invert_pwm_level(connector, level)); in intel_pwm_disable_backlight()
1606 static int intel_pwm_setup_backlight(struct intel_connector *connector, enum pipe pipe) in intel_pwm_setup_backlight() argument
1608 struct intel_panel *panel = &connector->panel; in intel_pwm_setup_backlight()
1611 ret = panel->backlight.pwm_funcs->setup(connector, pipe); in intel_pwm_setup_backlight()
1617 panel->backlight.level = intel_pwm_get_backlight(connector, pipe); in intel_pwm_setup_backlight()
1628 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_backlight_update() local
1629 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_update()
1630 struct intel_panel *panel = &connector->panel; in intel_backlight_update()
1642 int intel_backlight_setup(struct intel_connector *connector, enum pipe pipe) in intel_backlight_setup() argument
1644 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_setup()
1645 struct intel_panel *panel = &connector->panel; in intel_backlight_setup()
1648 if (!connector->panel.vbt.backlight.present) { in intel_backlight_setup()
1651 "[CONNECTOR:%d:%s] no backlight present per VBT, but present per quirk\n", in intel_backlight_setup()
1652 connector->base.base.id, connector->base.name); in intel_backlight_setup()
1655 "[CONNECTOR:%d:%s] no backlight present per VBT\n", in intel_backlight_setup()
1656 connector->base.base.id, connector->base.name); in intel_backlight_setup()
1667 ret = panel->backlight.funcs->setup(connector, pipe); in intel_backlight_setup()
1672 "[CONNECTOR:%d:%s] failed to setup backlight\n", in intel_backlight_setup()
1673 connector->base.base.id, connector->base.name); in intel_backlight_setup()
1680 "[CONNECTOR:%d:%s] backlight initialized, %s, brightness %u/%u\n", in intel_backlight_setup()
1681 connector->base.base.id, connector->base.name, in intel_backlight_setup()
1788 struct intel_connector *connector = in intel_backlight_init_funcs() local
1790 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_init_funcs()
1792 if (connector->base.connector_type == DRM_MODE_CONNECTOR_DSI && in intel_backlight_init_funcs()
1793 intel_dsi_dcs_init_backlight_funcs(connector) == 0) in intel_backlight_init_funcs()
1808 if (connector->base.connector_type == DRM_MODE_CONNECTOR_DSI) { in intel_backlight_init_funcs()
1819 if (connector->base.connector_type == DRM_MODE_CONNECTOR_eDP) { in intel_backlight_init_funcs()
1820 if (intel_dp_aux_init_backlight_funcs(connector) == 0) in intel_backlight_init_funcs()
1824 connector->panel.backlight.power = intel_pps_backlight_power; in intel_backlight_init_funcs()