Lines Matching +full:single +full:- +full:lane
45 * struct i2c_algo_dp_aux_data - driver interface structure for i2c over dp
50 * @aux_ch: driver callback to transfer a single byte of the i2c payload
60 /* Run a single AUX_CH I2C transaction, writing/reading data as necessary */
65 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data; in i2c_algo_dp_aux_transaction()
68 ret = (*algo_data->aux_ch)(adapter, mode, in i2c_algo_dp_aux_transaction()
85 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data; in i2c_algo_dp_aux_address()
92 algo_data->address = address; in i2c_algo_dp_aux_address()
93 algo_data->running = true; in i2c_algo_dp_aux_address()
104 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data; in i2c_algo_dp_aux_stop()
111 if (algo_data->running) { in i2c_algo_dp_aux_stop()
113 algo_data->running = false; in i2c_algo_dp_aux_stop()
118 * Write a single byte to the current I2C address, the
119 * I2C link must be running or this returns -EIO
124 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data; in i2c_algo_dp_aux_put_byte()
126 if (!algo_data->running) in i2c_algo_dp_aux_put_byte()
127 return -EIO; in i2c_algo_dp_aux_put_byte()
133 * Read a single byte from the current I2C address, the
134 * I2C link must be running or this returns -EIO
139 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data; in i2c_algo_dp_aux_get_byte()
141 if (!algo_data->running) in i2c_algo_dp_aux_get_byte()
142 return -EIO; in i2c_algo_dp_aux_get_byte()
211 adapter->algo = &i2c_dp_aux_algo; in i2c_dp_aux_prepare_bus()
212 adapter->retries = 3; in i2c_dp_aux_prepare_bus()
238 ret__ = -ETIMEDOUT; \
304 * is_edp - is the given port attached to an eDP panel (either CPU or PCH)
312 return encoder->type == INTEL_OUTPUT_EDP; in is_edp()
323 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_max_lane_count()
326 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11) { in cdv_intel_dp_max_lane_count()
327 max_lane_count = intel_dp->dpcd[DP_MAX_LANE_COUNT] & 0x1f; in cdv_intel_dp_max_lane_count()
341 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_max_link_bw()
342 int max_link_bw = intel_dp->dpcd[DP_MAX_LINK_RATE]; in cdv_intel_dp_max_link_bw()
378 struct drm_device *dev = intel_encoder->base.dev; in cdv_intel_edp_panel_vdd_on()
379 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; in cdv_intel_edp_panel_vdd_on()
382 if (intel_dp->panel_on) { in cdv_intel_edp_panel_vdd_on()
393 msleep(intel_dp->panel_power_up_delay); in cdv_intel_edp_panel_vdd_on()
398 struct drm_device *dev = intel_encoder->base.dev; in cdv_intel_edp_panel_vdd_off()
413 struct drm_device *dev = intel_encoder->base.dev; in cdv_intel_edp_panel_on()
414 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; in cdv_intel_edp_panel_on()
417 if (intel_dp->panel_on) in cdv_intel_edp_panel_on()
430 intel_dp->panel_on = false; in cdv_intel_edp_panel_on()
432 intel_dp->panel_on = true; in cdv_intel_edp_panel_on()
433 msleep(intel_dp->panel_power_up_delay); in cdv_intel_edp_panel_on()
440 struct drm_device *dev = intel_encoder->base.dev; in cdv_intel_edp_panel_off()
442 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; in cdv_intel_edp_panel_off()
451 intel_dp->panel_on = false; in cdv_intel_edp_panel_off()
466 msleep(intel_dp->panel_power_cycle_delay); in cdv_intel_edp_panel_off()
472 struct drm_device *dev = intel_encoder->base.dev; in cdv_intel_edp_backlight_on()
492 struct drm_device *dev = intel_encoder->base.dev; in cdv_intel_edp_backlight_off()
493 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; in cdv_intel_edp_backlight_off()
503 msleep(intel_dp->backlight_off_delay); in cdv_intel_edp_backlight_off()
511 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_mode_valid()
514 struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); in cdv_intel_dp_mode_valid()
516 if (is_edp(encoder) && intel_dp->panel_fixed_mode) { in cdv_intel_dp_mode_valid()
517 if (mode->hdisplay > intel_dp->panel_fixed_mode->hdisplay) in cdv_intel_dp_mode_valid()
519 if (mode->vdisplay > intel_dp->panel_fixed_mode->vdisplay) in cdv_intel_dp_mode_valid()
526 (cdv_intel_dp_link_required(mode->clock, dev_priv->edp.bpp) in cdv_intel_dp_mode_valid()
531 if (cdv_intel_dp_link_required(mode->clock, 24) in cdv_intel_dp_mode_valid()
536 if (mode->clock < 10000) in cdv_intel_dp_mode_valid()
551 v |= ((uint32_t) src[i]) << ((3-i) * 8); in pack_aux()
562 dst[i] = src >> ((3-i) * 8); in unpack_aux()
570 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_aux_ch()
571 uint32_t output_reg = intel_dp->output_reg; in cdv_intel_dp_aux_ch()
572 struct drm_device *dev = encoder->base.dev; in cdv_intel_dp_aux_ch()
596 return -EBUSY; in cdv_intel_dp_aux_ch()
604 pack_aux(send + i, send_bytes - i)); in cdv_intel_dp_aux_ch()
635 return -EBUSY; in cdv_intel_dp_aux_ch()
643 return -EIO; in cdv_intel_dp_aux_ch()
647 * "normal" -- don't fill the kernel log with these */ in cdv_intel_dp_aux_ch()
650 return -ETIMEDOUT; in cdv_intel_dp_aux_ch()
661 recv + i, recv_bytes - i); in cdv_intel_dp_aux_ch()
677 return -1; in cdv_intel_dp_aux_native_write()
681 msg[3] = send_bytes - 1; in cdv_intel_dp_aux_native_write()
694 return -EIO; in cdv_intel_dp_aux_native_write()
699 /* Write a single byte to the aux channel in native mode */
722 msg[3] = recv_bytes - 1; in cdv_intel_dp_aux_native_read()
731 return -EPROTO; in cdv_intel_dp_aux_native_read()
736 memcpy(recv, reply + 1, ret - 1); in cdv_intel_dp_aux_native_read()
737 return ret - 1; in cdv_intel_dp_aux_native_read()
742 return -EIO; in cdv_intel_dp_aux_native_read()
750 struct i2c_algo_dp_aux_data *algo_data = adapter->algo_data; in cdv_intel_dp_i2c_aux_ch()
754 struct gma_encoder *encoder = intel_dp->encoder; in cdv_intel_dp_i2c_aux_ch()
755 uint16_t address = algo_data->address; in cdv_intel_dp_i2c_aux_ch()
804 /* I2C-over-AUX Reply field is only valid in cdv_intel_dp_i2c_aux_ch()
810 return -EREMOTEIO; in cdv_intel_dp_i2c_aux_ch()
817 return -EREMOTEIO; in cdv_intel_dp_i2c_aux_ch()
825 return reply_bytes - 1; in cdv_intel_dp_i2c_aux_ch()
828 return -EREMOTEIO; in cdv_intel_dp_i2c_aux_ch()
835 return -EREMOTEIO; in cdv_intel_dp_i2c_aux_ch()
840 return -EREMOTEIO; in cdv_intel_dp_i2c_aux_ch()
847 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_i2c_init()
852 intel_dp->algo.running = false; in cdv_intel_dp_i2c_init()
853 intel_dp->algo.address = 0; in cdv_intel_dp_i2c_init()
854 intel_dp->algo.aux_ch = cdv_intel_dp_i2c_aux_ch; in cdv_intel_dp_i2c_init()
856 memset(&intel_dp->adapter, '\0', sizeof (intel_dp->adapter)); in cdv_intel_dp_i2c_init()
857 intel_dp->adapter.owner = THIS_MODULE; in cdv_intel_dp_i2c_init()
858 strncpy (intel_dp->adapter.name, name, sizeof(intel_dp->adapter.name) - 1); in cdv_intel_dp_i2c_init()
859 intel_dp->adapter.name[sizeof(intel_dp->adapter.name) - 1] = '\0'; in cdv_intel_dp_i2c_init()
860 intel_dp->adapter.algo_data = &intel_dp->algo; in cdv_intel_dp_i2c_init()
861 intel_dp->adapter.dev.parent = connector->base.kdev; in cdv_intel_dp_i2c_init()
865 ret = i2c_dp_aux_add_bus(&intel_dp->adapter); in cdv_intel_dp_i2c_init()
875 adjusted_mode->hdisplay = fixed_mode->hdisplay; in cdv_intel_fixed_panel_mode()
876 adjusted_mode->hsync_start = fixed_mode->hsync_start; in cdv_intel_fixed_panel_mode()
877 adjusted_mode->hsync_end = fixed_mode->hsync_end; in cdv_intel_fixed_panel_mode()
878 adjusted_mode->htotal = fixed_mode->htotal; in cdv_intel_fixed_panel_mode()
880 adjusted_mode->vdisplay = fixed_mode->vdisplay; in cdv_intel_fixed_panel_mode()
881 adjusted_mode->vsync_start = fixed_mode->vsync_start; in cdv_intel_fixed_panel_mode()
882 adjusted_mode->vsync_end = fixed_mode->vsync_end; in cdv_intel_fixed_panel_mode()
883 adjusted_mode->vtotal = fixed_mode->vtotal; in cdv_intel_fixed_panel_mode()
885 adjusted_mode->clock = fixed_mode->clock; in cdv_intel_fixed_panel_mode()
894 struct drm_psb_private *dev_priv = to_drm_psb_private(encoder->dev); in cdv_intel_dp_mode_fixup()
896 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; in cdv_intel_dp_mode_fixup()
901 int refclock = mode->clock; in cdv_intel_dp_mode_fixup()
904 if (is_edp(intel_encoder) && intel_dp->panel_fixed_mode) { in cdv_intel_dp_mode_fixup()
905 cdv_intel_fixed_panel_mode(intel_dp->panel_fixed_mode, adjusted_mode); in cdv_intel_dp_mode_fixup()
906 refclock = intel_dp->panel_fixed_mode->clock; in cdv_intel_dp_mode_fixup()
907 bpp = dev_priv->edp.bpp; in cdv_intel_dp_mode_fixup()
911 for (clock = max_clock; clock >= 0; clock--) { in cdv_intel_dp_mode_fixup()
915 intel_dp->link_bw = bws[clock]; in cdv_intel_dp_mode_fixup()
916 intel_dp->lane_count = lane_count; in cdv_intel_dp_mode_fixup()
917 adjusted_mode->clock = cdv_intel_dp_link_clock(intel_dp->link_bw); in cdv_intel_dp_mode_fixup()
918 DRM_DEBUG_KMS("Display port link bw %02x lane " in cdv_intel_dp_mode_fixup()
920 intel_dp->link_bw, intel_dp->lane_count, in cdv_intel_dp_mode_fixup()
921 adjusted_mode->clock); in cdv_intel_dp_mode_fixup()
928 intel_dp->lane_count = max_lane_count; in cdv_intel_dp_mode_fixup()
929 intel_dp->link_bw = bws[max_clock]; in cdv_intel_dp_mode_fixup()
930 adjusted_mode->clock = cdv_intel_dp_link_clock(intel_dp->link_bw); in cdv_intel_dp_mode_fixup()
931 DRM_DEBUG_KMS("Force picking display port link bw %02x lane " in cdv_intel_dp_mode_fixup()
933 intel_dp->link_bw, intel_dp->lane_count, in cdv_intel_dp_mode_fixup()
934 adjusted_mode->clock); in cdv_intel_dp_mode_fixup()
972 m_n->tu = 64; in cdv_intel_dp_compute_m_n()
973 m_n->gmch_m = (pixel_clock * bpp + 7) >> 3; in cdv_intel_dp_compute_m_n()
974 m_n->gmch_n = link_clock * nlanes; in cdv_intel_dp_compute_m_n()
975 cdv_intel_reduce_ratio(&m_n->gmch_m, &m_n->gmch_n); in cdv_intel_dp_compute_m_n()
976 m_n->link_m = pixel_clock; in cdv_intel_dp_compute_m_n()
977 m_n->link_n = link_clock; in cdv_intel_dp_compute_m_n()
978 cdv_intel_reduce_ratio(&m_n->link_m, &m_n->link_n); in cdv_intel_dp_compute_m_n()
985 struct drm_device *dev = crtc->dev; in cdv_intel_dp_set_m_n()
987 struct drm_mode_config *mode_config = &dev->mode_config; in cdv_intel_dp_set_m_n()
992 int pipe = gma_crtc->pipe; in cdv_intel_dp_set_m_n()
995 * Find the lane count in the intel_encoder private in cdv_intel_dp_set_m_n()
997 list_for_each_entry(encoder, &mode_config->encoder_list, head) { in cdv_intel_dp_set_m_n()
1001 if (encoder->crtc != crtc) in cdv_intel_dp_set_m_n()
1005 intel_dp = intel_encoder->dev_priv; in cdv_intel_dp_set_m_n()
1006 if (intel_encoder->type == INTEL_OUTPUT_DISPLAYPORT) { in cdv_intel_dp_set_m_n()
1007 lane_count = intel_dp->lane_count; in cdv_intel_dp_set_m_n()
1010 lane_count = intel_dp->lane_count; in cdv_intel_dp_set_m_n()
1011 bpp = dev_priv->edp.bpp; in cdv_intel_dp_set_m_n()
1018 * the number of bytes_per_pixel post-LUT, which we always in cdv_intel_dp_set_m_n()
1019 * set up for 8-bits of R/G/B, or 3 bytes total. in cdv_intel_dp_set_m_n()
1022 mode->clock, adjusted_mode->clock, &m_n); in cdv_intel_dp_set_m_n()
1026 ((m_n.tu - 1) << PIPE_GMCH_DATA_M_TU_SIZE_SHIFT) | in cdv_intel_dp_set_m_n()
1039 struct drm_crtc *crtc = encoder->crtc; in cdv_intel_dp_mode_set()
1041 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; in cdv_intel_dp_mode_set()
1042 struct drm_device *dev = encoder->dev; in cdv_intel_dp_mode_set()
1044 intel_dp->DP = DP_VOLTAGE_0_4 | DP_PRE_EMPHASIS_0; in cdv_intel_dp_mode_set()
1045 intel_dp->DP |= intel_dp->color_range; in cdv_intel_dp_mode_set()
1047 if (adjusted_mode->flags & DRM_MODE_FLAG_PHSYNC) in cdv_intel_dp_mode_set()
1048 intel_dp->DP |= DP_SYNC_HS_HIGH; in cdv_intel_dp_mode_set()
1049 if (adjusted_mode->flags & DRM_MODE_FLAG_PVSYNC) in cdv_intel_dp_mode_set()
1050 intel_dp->DP |= DP_SYNC_VS_HIGH; in cdv_intel_dp_mode_set()
1052 intel_dp->DP |= DP_LINK_TRAIN_OFF; in cdv_intel_dp_mode_set()
1054 switch (intel_dp->lane_count) { in cdv_intel_dp_mode_set()
1056 intel_dp->DP |= DP_PORT_WIDTH_1; in cdv_intel_dp_mode_set()
1059 intel_dp->DP |= DP_PORT_WIDTH_2; in cdv_intel_dp_mode_set()
1062 intel_dp->DP |= DP_PORT_WIDTH_4; in cdv_intel_dp_mode_set()
1065 if (intel_dp->has_audio) in cdv_intel_dp_mode_set()
1066 intel_dp->DP |= DP_AUDIO_OUTPUT_ENABLE; in cdv_intel_dp_mode_set()
1068 memset(intel_dp->link_configuration, 0, DP_LINK_CONFIGURATION_SIZE); in cdv_intel_dp_mode_set()
1069 intel_dp->link_configuration[0] = intel_dp->link_bw; in cdv_intel_dp_mode_set()
1070 intel_dp->link_configuration[1] = intel_dp->lane_count; in cdv_intel_dp_mode_set()
1075 if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 && in cdv_intel_dp_mode_set()
1076 (intel_dp->dpcd[DP_MAX_LANE_COUNT] & DP_ENHANCED_FRAME_CAP)) { in cdv_intel_dp_mode_set()
1077 intel_dp->link_configuration[1] |= DP_LANE_COUNT_ENHANCED_FRAME_EN; in cdv_intel_dp_mode_set()
1078 intel_dp->DP |= DP_ENHANCED_FRAMING; in cdv_intel_dp_mode_set()
1082 if (gma_crtc->pipe == 1) in cdv_intel_dp_mode_set()
1083 intel_dp->DP |= DP_PIPEB_SELECT; in cdv_intel_dp_mode_set()
1085 REG_WRITE(intel_dp->output_reg, (intel_dp->DP | DP_PORT_EN)); in cdv_intel_dp_mode_set()
1086 DRM_DEBUG_KMS("DP expected reg is %x\n", intel_dp->DP); in cdv_intel_dp_mode_set()
1091 if (mode->hdisplay != adjusted_mode->hdisplay || in cdv_intel_dp_mode_set()
1092 mode->vdisplay != adjusted_mode->vdisplay) in cdv_intel_dp_mode_set()
1097 pfit_control |= gma_crtc->pipe << PFIT_PIPE_SHIFT; in cdv_intel_dp_mode_set()
1107 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_sink_dpms()
1111 if (intel_dp->dpcd[DP_DPCD_REV] < 0x11) in cdv_intel_dp_sink_dpms()
1169 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; in cdv_intel_dp_dpms()
1170 struct drm_device *dev = encoder->dev; in cdv_intel_dp_dpms()
1171 uint32_t dp_reg = REG_READ(intel_dp->output_reg); in cdv_intel_dp_dpms()
1224 * Fetch AUX CH registers 0x202 - 0x207 which contain
1230 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_get_link_status()
1233 intel_dp->link_status, in cdv_intel_dp_get_link_status()
1241 return link_status[r - DP_LANE0_1_STATUS]; in cdv_intel_dp_link_status()
1246 int lane) in cdv_intel_get_adjust_request_voltage() argument
1248 int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1); in cdv_intel_get_adjust_request_voltage()
1249 int s = ((lane & 1) ? in cdv_intel_get_adjust_request_voltage()
1259 int lane) in cdv_intel_get_adjust_request_pre_emphasis() argument
1261 int i = DP_ADJUST_REQUEST_LANE0_1 + (lane >> 1); in cdv_intel_get_adjust_request_pre_emphasis()
1262 int s = ((lane & 1) ? in cdv_intel_get_adjust_request_pre_emphasis()
1275 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_get_adjust_train()
1278 int lane; in cdv_intel_get_adjust_train() local
1280 for (lane = 0; lane < intel_dp->lane_count; lane++) { in cdv_intel_get_adjust_train()
1281 uint8_t this_v = cdv_intel_get_adjust_request_voltage(intel_dp->link_status, lane); in cdv_intel_get_adjust_train()
1282 uint8_t this_p = cdv_intel_get_adjust_request_pre_emphasis(intel_dp->link_status, lane); in cdv_intel_get_adjust_train()
1296 for (lane = 0; lane < 4; lane++) in cdv_intel_get_adjust_train()
1297 intel_dp->train_set[lane] = v | p; in cdv_intel_get_adjust_train()
1303 int lane) in cdv_intel_get_lane_status() argument
1305 int i = DP_LANE0_1_STATUS + (lane >> 1); in cdv_intel_get_lane_status()
1306 int s = (lane & 1) * 4; in cdv_intel_get_lane_status()
1316 int lane; in cdv_intel_clock_recovery_ok() local
1319 for (lane = 0; lane < lane_count; lane++) { in cdv_intel_clock_recovery_ok()
1320 lane_status = cdv_intel_get_lane_status(link_status, lane); in cdv_intel_clock_recovery_ok()
1334 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_channel_eq_ok()
1337 int lane; in cdv_intel_channel_eq_ok() local
1339 lane_align = cdv_intel_dp_link_status(intel_dp->link_status, in cdv_intel_channel_eq_ok()
1343 for (lane = 0; lane < intel_dp->lane_count; lane++) { in cdv_intel_channel_eq_ok()
1344 lane_status = cdv_intel_get_lane_status(intel_dp->link_status, lane); in cdv_intel_channel_eq_ok()
1356 struct drm_device *dev = encoder->base.dev; in cdv_intel_dp_set_link_train()
1358 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_set_link_train()
1360 REG_WRITE(intel_dp->output_reg, dp_reg_value); in cdv_intel_dp_set_link_train()
1361 REG_READ(intel_dp->output_reg); in cdv_intel_dp_set_link_train()
1382 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dplink_set_level()
1386 intel_dp->train_set, in cdv_intel_dplink_set_level()
1387 intel_dp->lane_count); in cdv_intel_dplink_set_level()
1389 if (ret != intel_dp->lane_count) { in cdv_intel_dplink_set_level()
1391 intel_dp->train_set[0], intel_dp->lane_count); in cdv_intel_dplink_set_level()
1400 struct drm_device *dev = encoder->base.dev; in cdv_intel_dp_set_vswing_premph()
1401 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_set_vswing_premph()
1405 if (intel_dp->output_reg == DP_B) in cdv_intel_dp_set_vswing_premph()
1424 cdv_sb_write(dev, ddi_reg->VSwing5, 0x0505313A); in cdv_intel_dp_set_vswing_premph()
1427 cdv_sb_write(dev, ddi_reg->VSwing1, 0x43406055); in cdv_intel_dp_set_vswing_premph()
1434 cdv_sb_write(dev, ddi_reg->VSwing2, 0x055738954); in cdv_intel_dp_set_vswing_premph()
1436 cdv_sb_write(dev, ddi_reg->VSwing2, dp_vswing_premph_table[index]); in cdv_intel_dp_set_vswing_premph()
1440 cdv_sb_write(dev, ddi_reg->VSwing3, 0x70802040); in cdv_intel_dp_set_vswing_premph()
1442 cdv_sb_write(dev, ddi_reg->VSwing3, 0x40802040); in cdv_intel_dp_set_vswing_premph()
1445 /* cdv_sb_write(dev, ddi_reg->VSwing4, 0x2b405555); */ in cdv_intel_dp_set_vswing_premph()
1448 cdv_sb_write(dev, ddi_reg->VSwing1, 0xc3406055); in cdv_intel_dp_set_vswing_premph()
1453 cdv_sb_write(dev, ddi_reg->PreEmph1, 0x1f030040); in cdv_intel_dp_set_vswing_premph()
1457 cdv_sb_write(dev, ddi_reg->PreEmph2, dp_vswing_premph_table[index]); in cdv_intel_dp_set_vswing_premph()
1466 struct drm_device *dev = encoder->base.dev; in cdv_intel_dp_start_link_train()
1467 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_start_link_train()
1473 uint32_t DP = intel_dp->DP; in cdv_intel_dp_start_link_train()
1481 REG_WRITE(intel_dp->output_reg, reg); in cdv_intel_dp_start_link_train()
1482 REG_READ(intel_dp->output_reg); in cdv_intel_dp_start_link_train()
1488 intel_dp->link_configuration, in cdv_intel_dp_start_link_train()
1491 memset(intel_dp->train_set, 0, 4); in cdv_intel_dp_start_link_train()
1500 /* Use intel_dp->train_set[0] to set the voltage and pre emphasis values */ in cdv_intel_dp_start_link_train()
1502 intel_dp->train_set[0], in cdv_intel_dp_start_link_train()
1503 intel_dp->link_configuration[0], in cdv_intel_dp_start_link_train()
1504 intel_dp->link_configuration[1]); in cdv_intel_dp_start_link_train()
1507 DRM_DEBUG_KMS("Failure in aux-transfer setting pattern 1\n"); in cdv_intel_dp_start_link_train()
1509 cdv_intel_dp_set_vswing_premph(encoder, intel_dp->train_set[0]); in cdv_intel_dp_start_link_train()
1519 intel_dp->link_status[0], intel_dp->link_status[1], intel_dp->link_status[2], in cdv_intel_dp_start_link_train()
1520 intel_dp->link_status[3], intel_dp->link_status[4], intel_dp->link_status[5]); in cdv_intel_dp_start_link_train()
1522 if (cdv_intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { in cdv_intel_dp_start_link_train()
1529 for (i = 0; i < intel_dp->lane_count; i++) in cdv_intel_dp_start_link_train()
1530 if ((intel_dp->train_set[i] & DP_TRAIN_MAX_SWING_REACHED) == 0) in cdv_intel_dp_start_link_train()
1532 if (i == intel_dp->lane_count) in cdv_intel_dp_start_link_train()
1536 if ((intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK) == voltage) { in cdv_intel_dp_start_link_train()
1542 voltage = intel_dp->train_set[0] & DP_TRAIN_VOLTAGE_SWING_MASK; in cdv_intel_dp_start_link_train()
1544 /* Compute new intel_dp->train_set as requested by target */ in cdv_intel_dp_start_link_train()
1550 DRM_DEBUG_KMS("failure in DP pattern 1 training, train set %x\n", intel_dp->train_set[0]); in cdv_intel_dp_start_link_train()
1553 intel_dp->DP = DP; in cdv_intel_dp_start_link_train()
1559 struct drm_device *dev = encoder->base.dev; in cdv_intel_dp_complete_link_train()
1560 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_complete_link_train()
1563 uint32_t DP = intel_dp->DP; in cdv_intel_dp_complete_link_train()
1575 intel_dp->train_set[0], in cdv_intel_dp_complete_link_train()
1576 intel_dp->link_configuration[0], in cdv_intel_dp_complete_link_train()
1577 intel_dp->link_configuration[1]); in cdv_intel_dp_complete_link_train()
1582 DRM_DEBUG_KMS("Failure in aux-transfer setting pattern 2\n"); in cdv_intel_dp_complete_link_train()
1584 /* Use intel_dp->train_set[0] to set the voltage and pre emphasis values */ in cdv_intel_dp_complete_link_train()
1592 cdv_intel_dp_set_vswing_premph(encoder, intel_dp->train_set[0]); in cdv_intel_dp_complete_link_train()
1601 intel_dp->link_status[0], intel_dp->link_status[1], intel_dp->link_status[2], in cdv_intel_dp_complete_link_train()
1602 intel_dp->link_status[3], intel_dp->link_status[4], intel_dp->link_status[5]); in cdv_intel_dp_complete_link_train()
1605 if (!cdv_intel_clock_recovery_ok(intel_dp->link_status, intel_dp->lane_count)) { in cdv_intel_dp_complete_link_train()
1625 /* Compute new intel_dp->train_set as requested by target */ in cdv_intel_dp_complete_link_train()
1633 REG_WRITE(intel_dp->output_reg, reg); in cdv_intel_dp_complete_link_train()
1634 REG_READ(intel_dp->output_reg); in cdv_intel_dp_complete_link_train()
1642 struct drm_device *dev = encoder->base.dev; in cdv_intel_dp_link_down()
1643 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_link_down()
1644 uint32_t DP = intel_dp->DP; in cdv_intel_dp_link_down()
1646 if ((REG_READ(intel_dp->output_reg) & DP_PORT_EN) == 0) in cdv_intel_dp_link_down()
1654 REG_WRITE(intel_dp->output_reg, DP | DP_LINK_TRAIN_PAT_IDLE); in cdv_intel_dp_link_down()
1656 REG_READ(intel_dp->output_reg); in cdv_intel_dp_link_down()
1660 REG_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN); in cdv_intel_dp_link_down()
1661 REG_READ(intel_dp->output_reg); in cdv_intel_dp_link_down()
1666 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_dp_detect()
1670 if (cdv_intel_dp_aux_native_read(encoder, 0x000, intel_dp->dpcd, in cdv_dp_detect()
1671 sizeof (intel_dp->dpcd)) == sizeof (intel_dp->dpcd)) in cdv_dp_detect()
1673 if (intel_dp->dpcd[DP_DPCD_REV] != 0) in cdv_dp_detect()
1678 intel_dp->dpcd[0], intel_dp->dpcd[1], in cdv_dp_detect()
1679 intel_dp->dpcd[2], intel_dp->dpcd[3]); in cdv_dp_detect()
1693 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_detect()
1698 intel_dp->has_audio = false; in cdv_intel_dp_detect()
1709 if (intel_dp->force_audio) { in cdv_intel_dp_detect()
1710 intel_dp->has_audio = intel_dp->force_audio > 0; in cdv_intel_dp_detect()
1712 edid = drm_get_edid(connector, &intel_dp->adapter); in cdv_intel_dp_detect()
1714 intel_dp->has_audio = drm_detect_monitor_audio(edid); in cdv_intel_dp_detect()
1727 struct cdv_intel_dp *intel_dp = intel_encoder->dev_priv; in cdv_intel_dp_get_modes()
1733 edid = drm_get_edid(connector, &intel_dp->adapter); in cdv_intel_dp_get_modes()
1741 struct drm_device *dev = connector->dev; in cdv_intel_dp_get_modes()
1746 if (edp && !intel_dp->panel_fixed_mode) { in cdv_intel_dp_get_modes()
1748 list_for_each_entry(newmode, &connector->probed_modes, in cdv_intel_dp_get_modes()
1750 if (newmode->type & DRM_MODE_TYPE_PREFERRED) { in cdv_intel_dp_get_modes()
1751 intel_dp->panel_fixed_mode = in cdv_intel_dp_get_modes()
1760 if (!intel_dp->panel_fixed_mode && dev_priv->lfp_lvds_vbt_mode) { in cdv_intel_dp_get_modes()
1761 intel_dp->panel_fixed_mode = in cdv_intel_dp_get_modes()
1762 drm_mode_duplicate(dev, dev_priv->lfp_lvds_vbt_mode); in cdv_intel_dp_get_modes()
1763 if (intel_dp->panel_fixed_mode) { in cdv_intel_dp_get_modes()
1764 intel_dp->panel_fixed_mode->type |= in cdv_intel_dp_get_modes()
1768 if (intel_dp->panel_fixed_mode != NULL) { in cdv_intel_dp_get_modes()
1770 mode = drm_mode_duplicate(dev, intel_dp->panel_fixed_mode); in cdv_intel_dp_get_modes()
1783 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_detect_audio()
1791 edid = drm_get_edid(connector, &intel_dp->adapter); in cdv_intel_dp_detect_audio()
1807 struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); in cdv_intel_dp_set_property()
1809 struct cdv_intel_dp *intel_dp = encoder->dev_priv; in cdv_intel_dp_set_property()
1812 ret = drm_object_property_set_value(&connector->base, property, val); in cdv_intel_dp_set_property()
1816 if (property == dev_priv->force_audio_property) { in cdv_intel_dp_set_property()
1820 if (i == intel_dp->force_audio) in cdv_intel_dp_set_property()
1823 intel_dp->force_audio = i; in cdv_intel_dp_set_property()
1830 if (has_audio == intel_dp->has_audio) in cdv_intel_dp_set_property()
1833 intel_dp->has_audio = has_audio; in cdv_intel_dp_set_property()
1837 if (property == dev_priv->broadcast_rgb_property) { in cdv_intel_dp_set_property()
1838 if (val == !!intel_dp->color_range) in cdv_intel_dp_set_property()
1841 intel_dp->color_range = val ? DP_COLOR_RANGE_16_235 : 0; in cdv_intel_dp_set_property()
1845 return -EINVAL; in cdv_intel_dp_set_property()
1848 if (encoder->base.crtc) { in cdv_intel_dp_set_property()
1849 struct drm_crtc *crtc = encoder->base.crtc; in cdv_intel_dp_set_property()
1850 drm_crtc_helper_set_mode(crtc, &crtc->mode, in cdv_intel_dp_set_property()
1851 crtc->x, crtc->y, in cdv_intel_dp_set_property()
1852 crtc->primary->fb); in cdv_intel_dp_set_property()
1863 struct cdv_intel_dp *intel_dp = gma_encoder->dev_priv; in cdv_intel_dp_destroy()
1866 /* cdv_intel_panel_destroy_backlight(connector->dev); */ in cdv_intel_dp_destroy()
1867 kfree(intel_dp->panel_fixed_mode); in cdv_intel_dp_destroy()
1868 intel_dp->panel_fixed_mode = NULL; in cdv_intel_dp_destroy()
1870 i2c_del_adapter(&intel_dp->adapter); in cdv_intel_dp_destroy()
1903 /* check the VBT to see whether the eDP is on DP-D port */
1910 if (!dev_priv->child_dev_num) in cdv_intel_dpc_is_edp()
1913 for (i = 0; i < dev_priv->child_dev_num; i++) { in cdv_intel_dpc_is_edp()
1914 p_child = dev_priv->child_dev + i; in cdv_intel_dpc_is_edp()
1916 if (p_child->dvo_port == PORT_IDPC && in cdv_intel_dpc_is_edp()
1917 p_child->device_type == DEVICE_TYPE_eDP) in cdv_intel_dpc_is_edp()
1926 DP/eDP. TODO - investigate if we can turn it back to normality
1969 connector = &gma_connector->base; in cdv_intel_dp_init()
1970 encoder = &gma_encoder->base; in cdv_intel_dp_init()
1978 gma_encoder->type = INTEL_OUTPUT_DISPLAYPORT; in cdv_intel_dp_init()
1980 gma_encoder->type = INTEL_OUTPUT_EDP; in cdv_intel_dp_init()
1983 gma_encoder->dev_priv=intel_dp; in cdv_intel_dp_init()
1984 intel_dp->encoder = gma_encoder; in cdv_intel_dp_init()
1985 intel_dp->output_reg = output_reg; in cdv_intel_dp_init()
1990 connector->polled = DRM_CONNECTOR_POLL_HPD; in cdv_intel_dp_init()
1991 connector->interlace_allowed = false; in cdv_intel_dp_init()
1992 connector->doublescan_allowed = false; in cdv_intel_dp_init()
1997 name = "DPDDC-B"; in cdv_intel_dp_init()
1998 gma_encoder->ddi_select = (DP_MASK | DDI0_SELECT); in cdv_intel_dp_init()
2001 name = "DPDDC-C"; in cdv_intel_dp_init()
2002 gma_encoder->ddi_select = (DP_MASK | DDI1_SELECT); in cdv_intel_dp_init()
2052 intel_dp->panel_power_up_delay = cur.t1_t3 / 10; in cdv_intel_dp_init()
2053 intel_dp->backlight_on_delay = cur.t8 / 10; in cdv_intel_dp_init()
2054 intel_dp->backlight_off_delay = cur.t9 / 10; in cdv_intel_dp_init()
2055 intel_dp->panel_power_down_delay = cur.t10 / 10; in cdv_intel_dp_init()
2056 intel_dp->panel_power_cycle_delay = (cur.t11_t12 - 1) * 100; in cdv_intel_dp_init()
2059 intel_dp->panel_power_up_delay, intel_dp->panel_power_down_delay, in cdv_intel_dp_init()
2060 intel_dp->panel_power_cycle_delay); in cdv_intel_dp_init()
2063 intel_dp->backlight_on_delay, intel_dp->backlight_off_delay); in cdv_intel_dp_init()
2068 intel_dp->dpcd, in cdv_intel_dp_init()
2069 sizeof(intel_dp->dpcd)); in cdv_intel_dp_init()
2079 intel_dp->dpcd[0], intel_dp->dpcd[1], in cdv_intel_dp_init()
2080 intel_dp->dpcd[2], intel_dp->dpcd[3]); in cdv_intel_dp_init()