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 intel_display *display = to_intel_display(connector); 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 intel_display *display = to_intel_display(connector); in intel_backlight_level_from_pwm()
130 struct intel_panel *panel = &connector->panel; in intel_backlight_level_from_pwm()
144 static u32 lpt_get_backlight(struct intel_connector *connector, enum pipe unused) in lpt_get_backlight() argument
146 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_get_backlight()
151 static u32 pch_get_backlight(struct intel_connector *connector, enum pipe unused) in pch_get_backlight() argument
153 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_get_backlight()
158 static u32 i9xx_get_backlight(struct intel_connector *connector, enum pipe unused) in i9xx_get_backlight() argument
160 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_get_backlight()
161 struct intel_panel *panel = &connector->panel; in i9xx_get_backlight()
178 static u32 vlv_get_backlight(struct intel_connector *connector, enum pipe pipe) in vlv_get_backlight() argument
180 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_get_backlight()
188 static u32 bxt_get_backlight(struct intel_connector *connector, enum pipe unused) in bxt_get_backlight() argument
190 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_get_backlight()
191 struct intel_panel *panel = &connector->panel; in bxt_get_backlight()
196 static u32 ext_pwm_get_backlight(struct intel_connector *connector, enum pipe unused) in ext_pwm_get_backlight() argument
198 struct intel_panel *panel = &connector->panel; in ext_pwm_get_backlight()
207 struct intel_connector *connector = to_intel_connector(conn_state->connector); in lpt_set_backlight() local
208 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_set_backlight()
217 struct intel_connector *connector = to_intel_connector(conn_state->connector); in pch_set_backlight() local
218 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_set_backlight()
227 struct intel_connector *connector = to_intel_connector(conn_state->connector); in i9xx_set_backlight() local
228 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_set_backlight()
229 struct intel_panel *panel = &connector->panel; in i9xx_set_backlight()
255 struct intel_connector *connector = to_intel_connector(conn_state->connector); in vlv_set_backlight() local
256 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_set_backlight()
266 struct intel_connector *connector = to_intel_connector(conn_state->connector); in bxt_set_backlight() local
267 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_set_backlight()
268 struct intel_panel *panel = &connector->panel; in bxt_set_backlight()
275 struct intel_panel *panel = &to_intel_connector(conn_state->connector)->panel; in ext_pwm_set_backlight()
284 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_panel_actually_set_backlight() local
285 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_panel_actually_set_backlight()
286 struct intel_panel *panel = &connector->panel; in intel_panel_actually_set_backlight()
288 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] set backlight level = %d\n", in intel_panel_actually_set_backlight()
289 connector->base.base.id, connector->base.name, level); in intel_panel_actually_set_backlight()
300 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_backlight_set_acpi() local
301 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_set_acpi()
302 struct intel_panel *panel = &connector->panel; in intel_backlight_set_acpi()
318 hw_level = clamp_user_to_hw(connector, user_level, user_max); in intel_backlight_set_acpi()
323 scale_hw_to_user(connector, in intel_backlight_set_acpi()
335 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in lpt_disable_backlight() local
336 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_disable_backlight()
351 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] CPU backlight was enabled, disabling\n", in lpt_disable_backlight()
352 connector->base.base.id, connector->base.name); in lpt_disable_backlight()
361 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in pch_disable_backlight() local
362 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_disable_backlight()
378 struct drm_i915_private *i915 = to_i915(old_conn_state->connector->dev); in i965_disable_backlight()
387 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in vlv_disable_backlight() local
388 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_disable_backlight()
398 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in bxt_disable_backlight() local
399 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_disable_backlight()
400 struct intel_panel *panel = &connector->panel; in bxt_disable_backlight()
413 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in cnp_disable_backlight() local
414 struct drm_i915_private *i915 = to_i915(connector->base.dev); in cnp_disable_backlight()
415 struct intel_panel *panel = &connector->panel; in cnp_disable_backlight()
425 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in ext_pwm_disable_backlight() local
426 struct intel_panel *panel = &connector->panel; in ext_pwm_disable_backlight()
436 struct intel_connector *connector = to_intel_connector(old_conn_state->connector); in intel_backlight_disable() local
437 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_disable()
438 struct intel_panel *panel = &connector->panel; in intel_backlight_disable()
450 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Skipping backlight disable on vga switch\n", in intel_backlight_disable()
451 connector->base.base.id, connector->base.name); in intel_backlight_disable()
468 struct intel_connector *connector = to_intel_connector(conn_state->connector); in lpt_enable_backlight() local
469 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_enable_backlight()
470 struct intel_panel *panel = &connector->panel; in lpt_enable_backlight()
475 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] PCH backlight already enabled\n", in lpt_enable_backlight()
476 connector->base.base.id, connector->base.name); in lpt_enable_backlight()
512 struct intel_connector *connector = to_intel_connector(conn_state->connector); in pch_enable_backlight() local
513 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_enable_backlight()
514 struct intel_panel *panel = &connector->panel; in pch_enable_backlight()
520 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] CPU backlight already enabled\n", in pch_enable_backlight()
521 connector->base.base.id, connector->base.name); in pch_enable_backlight()
528 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] PCH backlight already enabled\n", in pch_enable_backlight()
529 connector->base.base.id, connector->base.name); in pch_enable_backlight()
560 struct intel_connector *connector = to_intel_connector(conn_state->connector); in i9xx_enable_backlight() local
561 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_enable_backlight()
562 struct intel_panel *panel = &connector->panel; in i9xx_enable_backlight()
567 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] backlight already enabled\n", in i9xx_enable_backlight()
568 connector->base.base.id, connector->base.name); in i9xx_enable_backlight()
600 struct intel_connector *connector = to_intel_connector(conn_state->connector); in i965_enable_backlight() local
601 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i965_enable_backlight()
602 struct intel_panel *panel = &connector->panel; in i965_enable_backlight()
608 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] backlight already enabled\n", in i965_enable_backlight()
609 connector->base.base.id, connector->base.name); in i965_enable_backlight()
636 struct intel_connector *connector = to_intel_connector(conn_state->connector); in vlv_enable_backlight() local
637 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_enable_backlight()
638 struct intel_panel *panel = &connector->panel; in vlv_enable_backlight()
644 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] backlight already enabled\n", in vlv_enable_backlight()
645 connector->base.base.id, connector->base.name); in vlv_enable_backlight()
667 struct intel_connector *connector = to_intel_connector(conn_state->connector); in bxt_enable_backlight() local
668 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_enable_backlight()
669 struct intel_panel *panel = &connector->panel; in bxt_enable_backlight()
677 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] utility pin already enabled\n", in bxt_enable_backlight()
678 connector->base.base.id, connector->base.name); in bxt_enable_backlight()
692 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] backlight already enabled\n", in bxt_enable_backlight()
693 connector->base.base.id, connector->base.name); in bxt_enable_backlight()
717 struct intel_connector *connector = to_intel_connector(conn_state->connector); in cnp_enable_backlight() local
718 struct drm_i915_private *i915 = to_i915(connector->base.dev); in cnp_enable_backlight()
719 struct intel_panel *panel = &connector->panel; in cnp_enable_backlight()
748 struct intel_connector *connector = to_intel_connector(conn_state->connector); in ext_pwm_enable_backlight() local
749 struct intel_panel *panel = &connector->panel; in ext_pwm_enable_backlight()
759 struct intel_connector *connector = to_intel_connector(conn_state->connector); in __intel_backlight_enable() local
760 struct intel_panel *panel = &connector->panel; in __intel_backlight_enable()
768 scale_hw_to_user(connector, in __intel_backlight_enable()
782 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_backlight_enable() local
783 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_enable()
784 struct intel_panel *panel = &connector->panel; in intel_backlight_enable()
800 static u32 intel_panel_get_backlight(struct intel_connector *connector) in intel_panel_get_backlight() argument
802 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_panel_get_backlight()
803 struct intel_panel *panel = &connector->panel; in intel_panel_get_backlight()
809 val = panel->backlight.funcs->get(connector, intel_connector_get_pipe(connector)); in intel_panel_get_backlight()
818 static u32 scale_user_to_hw(struct intel_connector *connector, in scale_user_to_hw() argument
821 struct intel_panel *panel = &connector->panel; in scale_user_to_hw()
831 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_panel_set_backlight() local
832 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_panel_set_backlight()
833 struct intel_panel *panel = &connector->panel; in intel_panel_set_backlight()
843 hw_level = scale_user_to_hw(connector, user_level, user_max); in intel_panel_set_backlight()
854 struct intel_connector *connector = bl_get_data(bd); in intel_backlight_device_update_status() local
855 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_device_update_status()
856 struct intel_panel *panel = &connector->panel; in intel_backlight_device_update_status()
862 intel_panel_set_backlight(connector->base.state, bd->props.brightness, in intel_backlight_device_update_status()
875 panel->backlight.power(connector, enable); in intel_backlight_device_update_status()
888 struct intel_connector *connector = bl_get_data(bd); in intel_backlight_device_get_brightness() local
889 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_device_get_brightness()
898 hw_level = intel_panel_get_backlight(connector); in intel_backlight_device_get_brightness()
899 ret = scale_hw_to_user(connector, in intel_backlight_device_get_brightness()
913 int intel_backlight_device_register(struct intel_connector *connector) in intel_backlight_device_register() argument
915 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_device_register()
916 struct intel_panel *panel = &connector->panel; in intel_backlight_device_register()
943 props.brightness = scale_hw_to_user(connector, in intel_backlight_device_register()
960 * Using the same name independent of the drm device or connector in intel_backlight_device_register()
968 i915->drm.primary->index, connector->base.name); in intel_backlight_device_register()
972 bd = backlight_device_register(name, connector->base.kdev, connector, in intel_backlight_device_register()
977 "[CONNECTOR:%d:%s] backlight device %s register failed: %ld\n", in intel_backlight_device_register()
978 connector->base.base.id, connector->base.name, name, PTR_ERR(bd)); in intel_backlight_device_register()
986 "[CONNECTOR:%d:%s] backlight device %s registered\n", in intel_backlight_device_register()
987 connector->base.base.id, connector->base.name, name); in intel_backlight_device_register()
995 void intel_backlight_device_unregister(struct intel_connector *connector) in intel_backlight_device_unregister() argument
997 struct intel_panel *panel = &connector->panel; in intel_backlight_device_unregister()
1010 static u32 cnp_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in cnp_hz_to_pwm() argument
1012 struct drm_i915_private *i915 = to_i915(connector->base.dev); in cnp_hz_to_pwm()
1021 static u32 bxt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in bxt_hz_to_pwm() argument
1031 static u32 spt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in spt_hz_to_pwm() argument
1033 struct intel_panel *panel = &connector->panel; in spt_hz_to_pwm()
1049 static u32 lpt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in lpt_hz_to_pwm() argument
1051 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_hz_to_pwm()
1052 struct intel_panel *panel = &connector->panel; in lpt_hz_to_pwm()
1072 static u32 pch_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in pch_hz_to_pwm() argument
1074 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_hz_to_pwm()
1088 static u32 i9xx_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in i9xx_hz_to_pwm() argument
1090 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_hz_to_pwm()
1106 static u32 i965_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in i965_hz_to_pwm() argument
1108 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i965_hz_to_pwm()
1124 static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz) in vlv_hz_to_pwm() argument
1126 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_hz_to_pwm()
1143 static u16 get_vbt_pwm_freq(struct intel_connector *connector) in get_vbt_pwm_freq() argument
1145 struct drm_i915_private *i915 = to_i915(connector->base.dev); in get_vbt_pwm_freq()
1146 u16 pwm_freq_hz = connector->panel.vbt.backlight.pwm_freq_hz; in get_vbt_pwm_freq()
1162 static u32 get_backlight_max_vbt(struct intel_connector *connector) in get_backlight_max_vbt() argument
1164 struct drm_i915_private *i915 = to_i915(connector->base.dev); in get_backlight_max_vbt()
1165 struct intel_panel *panel = &connector->panel; in get_backlight_max_vbt()
1166 u16 pwm_freq_hz = get_vbt_pwm_freq(connector); in get_backlight_max_vbt()
1175 pwm = panel->backlight.pwm_funcs->hz_to_pwm(connector, pwm_freq_hz); in get_backlight_max_vbt()
1188 static u32 get_backlight_min_vbt(struct intel_connector *connector) in get_backlight_min_vbt() argument
1190 struct drm_i915_private *i915 = to_i915(connector->base.dev); in get_backlight_min_vbt()
1191 struct intel_panel *panel = &connector->panel; in get_backlight_min_vbt()
1203 min = clamp_t(int, connector->panel.vbt.backlight.min_brightness, 0, 64); in get_backlight_min_vbt()
1204 if (min != connector->panel.vbt.backlight.min_brightness) { in get_backlight_min_vbt()
1207 connector->panel.vbt.backlight.min_brightness, min); in get_backlight_min_vbt()
1214 static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unused) in lpt_setup_backlight() argument
1216 struct drm_i915_private *i915 = to_i915(connector->base.dev); in lpt_setup_backlight()
1217 struct intel_panel *panel = &connector->panel; in lpt_setup_backlight()
1236 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in lpt_setup_backlight()
1241 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in lpt_setup_backlight()
1250 val = pch_get_backlight(connector, unused); in lpt_setup_backlight()
1256 lpt_set_backlight(connector->base.state, val); in lpt_setup_backlight()
1265 "[CONNECTOR:%d:%s] Using native PCH PWM for backlight control\n", in lpt_setup_backlight()
1266 connector->base.base.id, connector->base.name); in lpt_setup_backlight()
1271 static int pch_setup_backlight(struct intel_connector *connector, enum pipe unused) in pch_setup_backlight() argument
1273 struct drm_i915_private *i915 = to_i915(connector->base.dev); in pch_setup_backlight()
1274 struct intel_panel *panel = &connector->panel; in pch_setup_backlight()
1284 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in pch_setup_backlight()
1289 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in pch_setup_backlight()
1296 "[CONNECTOR:%d:%s] Using native PCH PWM for backlight control\n", in pch_setup_backlight()
1297 connector->base.base.id, connector->base.name); in pch_setup_backlight()
1302 static int i9xx_setup_backlight(struct intel_connector *connector, enum pipe unused) in i9xx_setup_backlight() argument
1304 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i9xx_setup_backlight()
1305 struct intel_panel *panel = &connector->panel; in i9xx_setup_backlight()
1319 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in i9xx_setup_backlight()
1329 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in i9xx_setup_backlight()
1331 val = i9xx_get_backlight(connector, unused); in i9xx_setup_backlight()
1332 val = intel_backlight_invert_pwm_level(connector, val); in i9xx_setup_backlight()
1338 "[CONNECTOR:%d:%s] Using native PWM for backlight control\n", in i9xx_setup_backlight()
1339 connector->base.base.id, connector->base.name); in i9xx_setup_backlight()
1344 static int i965_setup_backlight(struct intel_connector *connector, enum pipe unused) in i965_setup_backlight() argument
1346 struct drm_i915_private *i915 = to_i915(connector->base.dev); in i965_setup_backlight()
1347 struct intel_panel *panel = &connector->panel; in i965_setup_backlight()
1358 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in i965_setup_backlight()
1366 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in i965_setup_backlight()
1371 "[CONNECTOR:%d:%s] Using native PWM for backlight control\n", in i965_setup_backlight()
1372 connector->base.base.id, connector->base.name); in i965_setup_backlight()
1377 static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe) in vlv_setup_backlight() argument
1379 struct drm_i915_private *i915 = to_i915(connector->base.dev); in vlv_setup_backlight()
1380 struct intel_panel *panel = &connector->panel; in vlv_setup_backlight()
1393 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in vlv_setup_backlight()
1398 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in vlv_setup_backlight()
1403 "[CONNECTOR:%d:%s] Using native PWM for backlight control (on pipe %c)\n", in vlv_setup_backlight()
1404 connector->base.base.id, connector->base.name, pipe_name(pipe)); in vlv_setup_backlight()
1410 bxt_setup_backlight(struct intel_connector *connector, enum pipe unused) in bxt_setup_backlight() argument
1412 struct drm_i915_private *i915 = to_i915(connector->base.dev); in bxt_setup_backlight()
1413 struct intel_panel *panel = &connector->panel; in bxt_setup_backlight()
1416 panel->backlight.controller = connector->panel.vbt.backlight.controller; in bxt_setup_backlight()
1433 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in bxt_setup_backlight()
1438 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in bxt_setup_backlight()
1443 "[CONNECTOR:%d:%s] Using native PWM for backlight control (controller=%d)\n", in bxt_setup_backlight()
1444 connector->base.base.id, connector->base.name, in bxt_setup_backlight()
1478 cnp_setup_backlight(struct intel_connector *connector, enum pipe unused) in cnp_setup_backlight() argument
1480 struct drm_i915_private *i915 = to_i915(connector->base.dev); in cnp_setup_backlight()
1481 struct intel_panel *panel = &connector->panel; in cnp_setup_backlight()
1488 panel->backlight.controller = connector->panel.vbt.backlight.controller; in cnp_setup_backlight()
1490 drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Invalid backlight controller %d, assuming 0\n", in cnp_setup_backlight()
1491 connector->base.base.id, connector->base.name, in cnp_setup_backlight()
1504 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector); in cnp_setup_backlight()
1509 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in cnp_setup_backlight()
1514 "[CONNECTOR:%d:%s] Using native PCH PWM for backlight control (controller=%d)\n", in cnp_setup_backlight()
1515 connector->base.base.id, connector->base.name, in cnp_setup_backlight()
1521 static int ext_pwm_setup_backlight(struct intel_connector *connector, in ext_pwm_setup_backlight() argument
1524 struct drm_i915_private *i915 = to_i915(connector->base.dev); in ext_pwm_setup_backlight()
1525 struct intel_panel *panel = &connector->panel; in ext_pwm_setup_backlight()
1530 if (connector->panel.vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) { in ext_pwm_setup_backlight()
1539 drm_err(&i915->drm, "[CONNECTOR:%d:%s] Failed to get the %s PWM chip\n", in ext_pwm_setup_backlight()
1540 connector->base.base.id, connector->base.name, desc); in ext_pwm_setup_backlight()
1546 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector); in ext_pwm_setup_backlight()
1554 level = intel_backlight_invert_pwm_level(connector, level); in ext_pwm_setup_backlight()
1557 …drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] PWM already enabled at freq %ld, VBT freq %d, level %d\… in ext_pwm_setup_backlight()
1558 connector->base.base.id, connector->base.name, in ext_pwm_setup_backlight()
1560 get_vbt_pwm_freq(connector), level); in ext_pwm_setup_backlight()
1564 NSEC_PER_SEC / get_vbt_pwm_freq(connector); in ext_pwm_setup_backlight()
1568 "[CONNECTOR:%d:%s] Using %s PWM for backlight control\n", in ext_pwm_setup_backlight()
1569 connector->base.base.id, connector->base.name, desc); in ext_pwm_setup_backlight()
1576 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_pwm_set_backlight() local
1577 struct intel_panel *panel = &connector->panel; in intel_pwm_set_backlight()
1580 intel_backlight_invert_pwm_level(connector, level)); in intel_pwm_set_backlight()
1583 static u32 intel_pwm_get_backlight(struct intel_connector *connector, enum pipe pipe) in intel_pwm_get_backlight() argument
1585 struct intel_panel *panel = &connector->panel; in intel_pwm_get_backlight()
1587 return intel_backlight_invert_pwm_level(connector, in intel_pwm_get_backlight()
1588 panel->backlight.pwm_funcs->get(connector, pipe)); in intel_pwm_get_backlight()
1594 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_pwm_enable_backlight() local
1595 struct intel_panel *panel = &connector->panel; in intel_pwm_enable_backlight()
1598 intel_backlight_invert_pwm_level(connector, level)); in intel_pwm_enable_backlight()
1603 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_pwm_disable_backlight() local
1604 struct intel_panel *panel = &connector->panel; in intel_pwm_disable_backlight()
1607 intel_backlight_invert_pwm_level(connector, level)); in intel_pwm_disable_backlight()
1610 static int intel_pwm_setup_backlight(struct intel_connector *connector, enum pipe pipe) in intel_pwm_setup_backlight() argument
1612 struct intel_panel *panel = &connector->panel; in intel_pwm_setup_backlight()
1615 ret = panel->backlight.pwm_funcs->setup(connector, pipe); in intel_pwm_setup_backlight()
1621 panel->backlight.level = intel_pwm_get_backlight(connector, pipe); in intel_pwm_setup_backlight()
1632 struct intel_connector *connector = to_intel_connector(conn_state->connector); in intel_backlight_update() local
1633 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_update()
1634 struct intel_panel *panel = &connector->panel; in intel_backlight_update()
1646 int intel_backlight_setup(struct intel_connector *connector, enum pipe pipe) in intel_backlight_setup() argument
1648 struct intel_display *display = to_intel_display(connector); in intel_backlight_setup()
1649 struct intel_panel *panel = &connector->panel; in intel_backlight_setup()
1652 if (!connector->panel.vbt.backlight.present) { in intel_backlight_setup()
1655 "[CONNECTOR:%d:%s] no backlight present per VBT, but present per quirk\n", in intel_backlight_setup()
1656 connector->base.base.id, connector->base.name); in intel_backlight_setup()
1659 "[CONNECTOR:%d:%s] no backlight present per VBT\n", in intel_backlight_setup()
1660 connector->base.base.id, connector->base.name); in intel_backlight_setup()
1671 ret = panel->backlight.funcs->setup(connector, pipe); in intel_backlight_setup()
1676 "[CONNECTOR:%d:%s] failed to setup backlight\n", in intel_backlight_setup()
1677 connector->base.base.id, connector->base.name); in intel_backlight_setup()
1684 "[CONNECTOR:%d:%s] backlight initialized, %s, brightness %u/%u\n", in intel_backlight_setup()
1685 connector->base.base.id, connector->base.name, in intel_backlight_setup()
1792 struct intel_connector *connector = in intel_backlight_init_funcs() local
1794 struct drm_i915_private *i915 = to_i915(connector->base.dev); in intel_backlight_init_funcs()
1796 if (connector->base.connector_type == DRM_MODE_CONNECTOR_DSI && in intel_backlight_init_funcs()
1797 intel_dsi_dcs_init_backlight_funcs(connector) == 0) in intel_backlight_init_funcs()
1812 if (connector->base.connector_type == DRM_MODE_CONNECTOR_DSI) { in intel_backlight_init_funcs()
1823 if (connector->base.connector_type == DRM_MODE_CONNECTOR_eDP) { in intel_backlight_init_funcs()
1824 if (intel_dp_aux_init_backlight_funcs(connector) == 0) in intel_backlight_init_funcs()
1828 connector->panel.backlight.power = intel_pps_backlight_power; in intel_backlight_init_funcs()