Lines Matching defs:connector
62 static u32 clamp_user_to_hw(struct intel_connector *connector,
65 struct intel_panel *panel = &connector->panel;
75 static u32 scale_hw_to_user(struct intel_connector *connector,
78 struct intel_panel *panel = &connector->panel;
84 u32 intel_backlight_invert_pwm_level(struct intel_connector *connector, u32 val)
86 struct drm_i915_private *i915 = to_i915(connector->base.dev);
87 struct intel_panel *panel = &connector->panel;
104 struct intel_connector *connector = to_intel_connector(conn_state->connector);
105 struct drm_i915_private *i915 = to_i915(connector->base.dev);
106 struct intel_panel *panel = &connector->panel;
109 connector->base.base.id, connector->base.name, val);
113 u32 intel_backlight_level_to_pwm(struct intel_connector *connector, u32 val)
115 struct drm_i915_private *i915 = to_i915(connector->base.dev);
116 struct intel_panel *panel = &connector->panel;
124 return intel_backlight_invert_pwm_level(connector, val);
127 u32 intel_backlight_level_from_pwm(struct intel_connector *connector, u32 val)
129 struct drm_i915_private *i915 = to_i915(connector->base.dev);
130 struct intel_panel *panel = &connector->panel;
143 static u32 lpt_get_backlight(struct intel_connector *connector, enum pipe unused)
145 struct drm_i915_private *i915 = to_i915(connector->base.dev);
150 static u32 pch_get_backlight(struct intel_connector *connector, enum pipe unused)
152 struct drm_i915_private *i915 = to_i915(connector->base.dev);
157 static u32 i9xx_get_backlight(struct intel_connector *connector, enum pipe unused)
159 struct drm_i915_private *i915 = to_i915(connector->base.dev);
160 struct intel_panel *panel = &connector->panel;
177 static u32 vlv_get_backlight(struct intel_connector *connector, enum pipe pipe)
179 struct drm_i915_private *i915 = to_i915(connector->base.dev);
187 static u32 bxt_get_backlight(struct intel_connector *connector, enum pipe unused)
189 struct drm_i915_private *i915 = to_i915(connector->base.dev);
190 struct intel_panel *panel = &connector->panel;
195 static u32 ext_pwm_get_backlight(struct intel_connector *connector, enum pipe unused)
200 struct intel_panel *panel = &connector->panel;
210 struct intel_connector *connector = to_intel_connector(conn_state->connector);
211 struct drm_i915_private *i915 = to_i915(connector->base.dev);
220 struct intel_connector *connector = to_intel_connector(conn_state->connector);
221 struct drm_i915_private *i915 = to_i915(connector->base.dev);
230 struct intel_connector *connector = to_intel_connector(conn_state->connector);
231 struct drm_i915_private *i915 = to_i915(connector->base.dev);
232 struct intel_panel *panel = &connector->panel;
258 struct intel_connector *connector = to_intel_connector(conn_state->connector);
259 struct drm_i915_private *i915 = to_i915(connector->base.dev);
269 struct intel_connector *connector = to_intel_connector(conn_state->connector);
270 struct drm_i915_private *i915 = to_i915(connector->base.dev);
271 struct intel_panel *panel = &connector->panel;
280 struct intel_panel *panel = &to_intel_connector(conn_state->connector)->panel;
290 struct intel_connector *connector = to_intel_connector(conn_state->connector);
291 struct drm_i915_private *i915 = to_i915(connector->base.dev);
292 struct intel_panel *panel = &connector->panel;
295 connector->base.base.id, connector->base.name, level);
306 struct intel_connector *connector = to_intel_connector(conn_state->connector);
307 struct drm_i915_private *i915 = to_i915(connector->base.dev);
308 struct intel_panel *panel = &connector->panel;
324 hw_level = clamp_user_to_hw(connector, user_level, user_max);
329 scale_hw_to_user(connector,
341 struct intel_connector *connector = to_intel_connector(old_conn_state->connector);
342 struct drm_i915_private *i915 = to_i915(connector->base.dev);
358 connector->base.base.id, connector->base.name);
367 struct intel_connector *connector = to_intel_connector(old_conn_state->connector);
368 struct drm_i915_private *i915 = to_i915(connector->base.dev);
384 struct drm_i915_private *i915 = to_i915(old_conn_state->connector->dev);
393 struct intel_connector *connector = to_intel_connector(old_conn_state->connector);
394 struct drm_i915_private *i915 = to_i915(connector->base.dev);
404 struct intel_connector *connector = to_intel_connector(old_conn_state->connector);
405 struct drm_i915_private *i915 = to_i915(connector->base.dev);
406 struct intel_panel *panel = &connector->panel;
419 struct intel_connector *connector = to_intel_connector(old_conn_state->connector);
420 struct drm_i915_private *i915 = to_i915(connector->base.dev);
421 struct intel_panel *panel = &connector->panel;
433 struct intel_connector *connector = to_intel_connector(old_conn_state->connector);
434 struct intel_panel *panel = &connector->panel;
445 struct intel_connector *connector = to_intel_connector(old_conn_state->connector);
446 struct drm_i915_private *i915 = to_i915(connector->base.dev);
447 struct intel_panel *panel = &connector->panel;
460 connector->base.base.id, connector->base.name);
477 struct intel_connector *connector = to_intel_connector(conn_state->connector);
478 struct drm_i915_private *i915 = to_i915(connector->base.dev);
479 struct intel_panel *panel = &connector->panel;
485 connector->base.base.id, connector->base.name);
521 struct intel_connector *connector = to_intel_connector(conn_state->connector);
522 struct drm_i915_private *i915 = to_i915(connector->base.dev);
523 struct intel_panel *panel = &connector->panel;
530 connector->base.base.id, connector->base.name);
538 connector->base.base.id, connector->base.name);
569 struct intel_connector *connector = to_intel_connector(conn_state->connector);
570 struct drm_i915_private *i915 = to_i915(connector->base.dev);
571 struct intel_panel *panel = &connector->panel;
577 connector->base.base.id, connector->base.name);
609 struct intel_connector *connector = to_intel_connector(conn_state->connector);
610 struct drm_i915_private *i915 = to_i915(connector->base.dev);
611 struct intel_panel *panel = &connector->panel;
618 connector->base.base.id, connector->base.name);
645 struct intel_connector *connector = to_intel_connector(conn_state->connector);
646 struct drm_i915_private *i915 = to_i915(connector->base.dev);
647 struct intel_panel *panel = &connector->panel;
654 connector->base.base.id, connector->base.name);
676 struct intel_connector *connector = to_intel_connector(conn_state->connector);
677 struct drm_i915_private *i915 = to_i915(connector->base.dev);
678 struct intel_panel *panel = &connector->panel;
687 connector->base.base.id, connector->base.name);
702 connector->base.base.id, connector->base.name);
726 struct intel_connector *connector = to_intel_connector(conn_state->connector);
727 struct drm_i915_private *i915 = to_i915(connector->base.dev);
728 struct intel_panel *panel = &connector->panel;
759 struct intel_connector *connector = to_intel_connector(conn_state->connector);
760 struct intel_panel *panel = &connector->panel;
771 struct intel_connector *connector = to_intel_connector(conn_state->connector);
772 struct intel_panel *panel = &connector->panel;
780 scale_hw_to_user(connector,
794 struct intel_connector *connector = to_intel_connector(conn_state->connector);
795 struct drm_i915_private *i915 = to_i915(connector->base.dev);
796 struct intel_panel *panel = &connector->panel;
812 static u32 intel_panel_get_backlight(struct intel_connector *connector)
814 struct drm_i915_private *i915 = to_i915(connector->base.dev);
815 struct intel_panel *panel = &connector->panel;
821 val = panel->backlight.funcs->get(connector, intel_connector_get_pipe(connector));
830 static u32 scale_user_to_hw(struct intel_connector *connector,
833 struct intel_panel *panel = &connector->panel;
843 struct intel_connector *connector = to_intel_connector(conn_state->connector);
844 struct drm_i915_private *i915 = to_i915(connector->base.dev);
845 struct intel_panel *panel = &connector->panel;
855 hw_level = scale_user_to_hw(connector, user_level, user_max);
866 struct intel_connector *connector = bl_get_data(bd);
867 struct drm_i915_private *i915 = to_i915(connector->base.dev);
868 struct intel_panel *panel = &connector->panel;
874 intel_panel_set_backlight(connector->base.state, bd->props.brightness,
887 panel->backlight.power(connector, enable);
900 struct intel_connector *connector = bl_get_data(bd);
901 struct drm_i915_private *i915 = to_i915(connector->base.dev);
910 hw_level = intel_panel_get_backlight(connector);
911 ret = scale_hw_to_user(connector,
925 int intel_backlight_device_register(struct intel_connector *connector)
927 struct drm_i915_private *i915 = to_i915(connector->base.dev);
928 struct intel_panel *panel = &connector->panel;
955 props.brightness = scale_hw_to_user(connector,
974 * Using the same name independent of the drm device or connector
982 i915->drm.primary->index, connector->base.name);
986 bd = backlight_device_register(name, connector->base.kdev, connector,
992 connector->base.base.id, connector->base.name, name, PTR_ERR(bd));
1001 connector->base.base.id, connector->base.name, name);
1009 void intel_backlight_device_unregister(struct intel_connector *connector)
1011 struct intel_panel *panel = &connector->panel;
1024 static u32 cnp_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
1026 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1035 static u32 bxt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
1045 static u32 spt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
1047 struct intel_panel *panel = &connector->panel;
1063 static u32 lpt_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
1065 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1066 struct intel_panel *panel = &connector->panel;
1086 static u32 pch_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
1088 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1102 static u32 i9xx_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
1104 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1120 static u32 i965_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
1122 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1138 static u32 vlv_hz_to_pwm(struct intel_connector *connector, u32 pwm_freq_hz)
1140 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1157 static u16 get_vbt_pwm_freq(struct intel_connector *connector)
1159 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1160 u16 pwm_freq_hz = connector->panel.vbt.backlight.pwm_freq_hz;
1176 static u32 get_backlight_max_vbt(struct intel_connector *connector)
1178 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1179 struct intel_panel *panel = &connector->panel;
1180 u16 pwm_freq_hz = get_vbt_pwm_freq(connector);
1189 pwm = panel->backlight.pwm_funcs->hz_to_pwm(connector, pwm_freq_hz);
1202 static u32 get_backlight_min_vbt(struct intel_connector *connector)
1204 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1205 struct intel_panel *panel = &connector->panel;
1217 min = clamp_t(int, connector->panel.vbt.backlight.min_brightness, 0, 64);
1218 if (min != connector->panel.vbt.backlight.min_brightness) {
1221 connector->panel.vbt.backlight.min_brightness, min);
1228 static int lpt_setup_backlight(struct intel_connector *connector, enum pipe unused)
1230 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1231 struct intel_panel *panel = &connector->panel;
1250 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector);
1255 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector);
1264 val = pch_get_backlight(connector, unused);
1270 lpt_set_backlight(connector->base.state, val);
1280 connector->base.base.id, connector->base.name);
1285 static int pch_setup_backlight(struct intel_connector *connector, enum pipe unused)
1287 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1288 struct intel_panel *panel = &connector->panel;
1298 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector);
1303 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector);
1311 connector->base.base.id, connector->base.name);
1316 static int i9xx_setup_backlight(struct intel_connector *connector, enum pipe unused)
1318 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1319 struct intel_panel *panel = &connector->panel;
1333 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector);
1343 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector);
1345 val = i9xx_get_backlight(connector, unused);
1346 val = intel_backlight_invert_pwm_level(connector, val);
1353 connector->base.base.id, connector->base.name);
1358 static int i965_setup_backlight(struct intel_connector *connector, enum pipe unused)
1360 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1361 struct intel_panel *panel = &connector->panel;
1372 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector);
1380 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector);
1386 connector->base.base.id, connector->base.name);
1391 static int vlv_setup_backlight(struct intel_connector *connector, enum pipe pipe)
1393 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1394 struct intel_panel *panel = &connector->panel;
1407 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector);
1412 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector);
1418 connector->base.base.id, connector->base.name, pipe_name(pipe));
1424 bxt_setup_backlight(struct intel_connector *connector, enum pipe unused)
1426 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1427 struct intel_panel *panel = &connector->panel;
1430 panel->backlight.controller = connector->panel.vbt.backlight.controller;
1447 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector);
1452 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector);
1458 connector->base.base.id, connector->base.name,
1489 cnp_setup_backlight(struct intel_connector *connector, enum pipe unused)
1491 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1492 struct intel_panel *panel = &connector->panel;
1499 panel->backlight.controller = connector->panel.vbt.backlight.controller;
1502 connector->base.base.id, connector->base.name,
1515 panel->backlight.pwm_level_max = get_backlight_max_vbt(connector);
1520 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector);
1526 connector->base.base.id, connector->base.name,
1532 static int ext_pwm_setup_backlight(struct intel_connector *connector,
1535 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1536 struct intel_panel *panel = &connector->panel;
1541 if (connector->panel.vbt.dsi.config->pwm_blc == PPS_BLC_PMIC) {
1551 connector->base.base.id, connector->base.name, desc);
1557 panel->backlight.pwm_level_min = get_backlight_min_vbt(connector);
1566 level = intel_backlight_invert_pwm_level(connector, level);
1570 connector->base.base.id, connector->base.name,
1572 get_vbt_pwm_freq(connector), level);
1576 NSEC_PER_SEC / get_vbt_pwm_freq(connector);
1584 connector->base.base.id, connector->base.name, desc);
1591 struct intel_connector *connector = to_intel_connector(conn_state->connector);
1592 struct intel_panel *panel = &connector->panel;
1595 intel_backlight_invert_pwm_level(connector, level));
1598 static u32 intel_pwm_get_backlight(struct intel_connector *connector, enum pipe pipe)
1600 struct intel_panel *panel = &connector->panel;
1602 return intel_backlight_invert_pwm_level(connector,
1603 panel->backlight.pwm_funcs->get(connector, pipe));
1609 struct intel_connector *connector = to_intel_connector(conn_state->connector);
1610 struct intel_panel *panel = &connector->panel;
1613 intel_backlight_invert_pwm_level(connector, level));
1618 struct intel_connector *connector = to_intel_connector(conn_state->connector);
1619 struct intel_panel *panel = &connector->panel;
1622 intel_backlight_invert_pwm_level(connector, level));
1625 static int intel_pwm_setup_backlight(struct intel_connector *connector, enum pipe pipe)
1627 struct intel_panel *panel = &connector->panel;
1630 ret = panel->backlight.pwm_funcs->setup(connector, pipe);
1636 panel->backlight.level = intel_pwm_get_backlight(connector, pipe);
1647 struct intel_connector *connector = to_intel_connector(conn_state->connector);
1648 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1649 struct intel_panel *panel = &connector->panel;
1661 int intel_backlight_setup(struct intel_connector *connector, enum pipe pipe)
1663 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1664 struct intel_panel *panel = &connector->panel;
1667 if (!connector->panel.vbt.backlight.present) {
1671 connector->base.base.id, connector->base.name);
1675 connector->base.base.id, connector->base.name);
1686 ret = panel->backlight.funcs->setup(connector, pipe);
1692 connector->base.base.id, connector->base.name);
1700 connector->base.base.id, connector->base.name,
1807 struct intel_connector *connector =
1809 struct drm_i915_private *i915 = to_i915(connector->base.dev);
1811 if (connector->base.connector_type == DRM_MODE_CONNECTOR_DSI &&
1812 intel_dsi_dcs_init_backlight_funcs(connector) == 0)
1827 if (connector->base.connector_type == DRM_MODE_CONNECTOR_DSI) {
1838 if (connector->base.connector_type == DRM_MODE_CONNECTOR_eDP) {
1839 if (intel_dp_aux_init_backlight_funcs(connector) == 0)
1843 connector->panel.backlight.power = intel_pps_backlight_power;