Lines Matching defs:intel_sdvo
69 struct intel_sdvo {
207 static struct intel_sdvo *to_intel_sdvo(struct drm_encoder *encoder)
209 return container_of(encoder, struct intel_sdvo, base.base);
212 static struct intel_sdvo *intel_attached_sdvo(struct drm_connector *connector)
215 struct intel_sdvo, base);
224 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags);
226 intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
230 intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
238 static void intel_sdvo_write_sdvox(struct intel_sdvo *intel_sdvo, u32 val)
240 struct drm_device *dev = intel_sdvo->base.base.dev;
245 if (intel_sdvo->sdvo_reg == PCH_SDVOB) {
246 I915_WRITE(intel_sdvo->sdvo_reg, val);
247 I915_READ(intel_sdvo->sdvo_reg);
251 if (intel_sdvo->sdvo_reg == GEN3_SDVOB)
270 static bool intel_sdvo_read_byte(struct intel_sdvo *intel_sdvo, u8 addr, u8 *ch)
274 .addr = intel_sdvo->slave_addr,
280 .addr = intel_sdvo->slave_addr,
288 if ((ret = i2c_transfer(intel_sdvo->i2c, msgs, 2)) == 2)
416 static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd,
422 SDVO_NAME(intel_sdvo), cmd);
448 static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd,
466 intel_sdvo_debug_write(intel_sdvo, cmd, args, args_len);
469 msgs[i].addr = intel_sdvo->slave_addr;
476 msgs[i].addr = intel_sdvo->slave_addr;
485 msgs[i+1].addr = intel_sdvo->slave_addr;
490 msgs[i+2].addr = intel_sdvo->slave_addr;
495 ret = i2c_transfer(intel_sdvo->i2c, msgs, i+3);
513 static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo,
520 DRM_DEBUG_KMS("%s: R: ", SDVO_NAME(intel_sdvo));
539 if (!intel_sdvo_read_byte(intel_sdvo,
550 if (!intel_sdvo_read_byte(intel_sdvo,
566 if (!intel_sdvo_read_byte(intel_sdvo,
590 static bool intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo,
594 return intel_sdvo_write_cmd(intel_sdvo,
599 static bool intel_sdvo_set_value(struct intel_sdvo *intel_sdvo, u8 cmd, const void *data, int len)
601 if (!intel_sdvo_write_cmd(intel_sdvo, cmd, data, len))
604 return intel_sdvo_read_response(intel_sdvo, NULL, 0);
608 intel_sdvo_get_value(struct intel_sdvo *intel_sdvo, u8 cmd, void *value, int len)
610 if (!intel_sdvo_write_cmd(intel_sdvo, cmd, NULL, 0))
613 return intel_sdvo_read_response(intel_sdvo, value, len);
616 static bool intel_sdvo_set_target_input(struct intel_sdvo *intel_sdvo)
619 return intel_sdvo_set_value(intel_sdvo,
630 static bool intel_sdvo_get_trained_inputs(struct intel_sdvo *intel_sdvo, bool *input_1, bool *input_2)
634 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_TRAINED_INPUTS,
643 static bool intel_sdvo_set_active_outputs(struct intel_sdvo *intel_sdvo,
646 return intel_sdvo_set_value(intel_sdvo,
651 static bool intel_sdvo_get_active_outputs(struct intel_sdvo *intel_sdvo,
654 return intel_sdvo_get_value(intel_sdvo,
659 static bool intel_sdvo_set_encoder_power_state(struct intel_sdvo *intel_sdvo,
679 return intel_sdvo_set_value(intel_sdvo,
683 static bool intel_sdvo_get_input_pixel_clock_range(struct intel_sdvo *intel_sdvo,
689 if (!intel_sdvo_get_value(intel_sdvo,
700 static bool intel_sdvo_set_target_output(struct intel_sdvo *intel_sdvo,
703 return intel_sdvo_set_value(intel_sdvo,
708 static bool intel_sdvo_set_timing(struct intel_sdvo *intel_sdvo, u8 cmd,
711 return intel_sdvo_set_value(intel_sdvo, cmd, &dtd->part1, sizeof(dtd->part1)) &&
712 intel_sdvo_set_value(intel_sdvo, cmd + 1, &dtd->part2, sizeof(dtd->part2));
715 static bool intel_sdvo_get_timing(struct intel_sdvo *intel_sdvo, u8 cmd,
718 return intel_sdvo_get_value(intel_sdvo, cmd, &dtd->part1, sizeof(dtd->part1)) &&
719 intel_sdvo_get_value(intel_sdvo, cmd + 1, &dtd->part2, sizeof(dtd->part2));
722 static bool intel_sdvo_set_input_timing(struct intel_sdvo *intel_sdvo,
725 return intel_sdvo_set_timing(intel_sdvo,
729 static bool intel_sdvo_set_output_timing(struct intel_sdvo *intel_sdvo,
732 return intel_sdvo_set_timing(intel_sdvo,
736 static bool intel_sdvo_get_input_timing(struct intel_sdvo *intel_sdvo,
739 return intel_sdvo_get_timing(intel_sdvo,
744 intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo,
757 if (intel_sdvo->is_lvds &&
758 (intel_sdvo->sdvo_lvds_fixed_mode->hdisplay != width ||
759 intel_sdvo->sdvo_lvds_fixed_mode->vdisplay != height))
762 return intel_sdvo_set_value(intel_sdvo,
767 static bool intel_sdvo_get_preferred_input_timing(struct intel_sdvo *intel_sdvo,
770 return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1,
772 intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2,
776 static bool intel_sdvo_set_clock_rate_mult(struct intel_sdvo *intel_sdvo, u8 val)
778 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_CLOCK_RATE_MULT, &val, 1);
871 static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo)
875 return intel_sdvo_get_value(intel_sdvo,
880 static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo,
883 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_ENCODE, &mode, 1);
886 static bool intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo,
889 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_COLORIMETRY, &mode, 1);
893 static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
922 static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
930 if (!intel_sdvo_set_value(intel_sdvo,
935 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HBUF_INFO,
950 if (!intel_sdvo_set_value(intel_sdvo,
956 return intel_sdvo_set_value(intel_sdvo,
961 static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo,
970 struct intel_crtc *intel_crtc = to_intel_crtc(intel_sdvo->base.base.crtc);
972 if (intel_sdvo->rgb_quant_range_selectable) {
989 return intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF,
994 static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo)
999 format_map = 1 << intel_sdvo->tv_format_index;
1003 return intel_sdvo_set_value(intel_sdvo,
1009 intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo,
1014 if (!intel_sdvo_set_target_output(intel_sdvo,
1015 intel_sdvo->attached_output))
1019 if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd))
1028 intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo,
1035 if (!intel_sdvo_set_target_input(intel_sdvo))
1038 if (!intel_sdvo_create_preferred_input_timing(intel_sdvo,
1044 if (!intel_sdvo_get_preferred_input_timing(intel_sdvo,
1049 intel_sdvo->dtd_sdvo_flags = input_dtd.part2.sdvo_flags;
1083 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
1098 if (intel_sdvo->is_tv) {
1099 if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, mode))
1102 (void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
1106 } else if (intel_sdvo->is_lvds) {
1107 if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo,
1108 intel_sdvo->sdvo_lvds_fixed_mode))
1111 (void) intel_sdvo_get_preferred_input_mode(intel_sdvo,
1123 if (intel_sdvo->color_range_auto) {
1127 if (intel_sdvo->has_hdmi_monitor &&
1129 intel_sdvo->color_range = HDMI_COLOR_RANGE_16_235;
1131 intel_sdvo->color_range = 0;
1134 if (intel_sdvo->color_range)
1138 if (intel_sdvo->is_tv)
1153 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&intel_encoder->base);
1168 in_out.in0 = intel_sdvo->attached_output;
1171 intel_sdvo_set_value(intel_sdvo,
1176 if (!intel_sdvo_set_target_output(intel_sdvo,
1177 intel_sdvo->attached_output))
1181 if (intel_sdvo->is_lvds)
1183 intel_sdvo->sdvo_lvds_fixed_mode);
1186 if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd))
1188 SDVO_NAME(intel_sdvo));
1191 if (!intel_sdvo_set_target_input(intel_sdvo))
1194 if (intel_sdvo->has_hdmi_monitor) {
1195 (void) intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_HDMI);
1196 (void) intel_sdvo_set_colorimetry(intel_sdvo,
1198 (void) intel_sdvo_set_avi_infoframe(intel_sdvo, adjusted_mode);
1200 (void) intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_DVI);
1202 if (intel_sdvo->is_tv &&
1203 !intel_sdvo_set_tv_format(intel_sdvo))
1210 if (intel_sdvo->is_tv || intel_sdvo->is_lvds)
1211 input_dtd.part2.sdvo_flags = intel_sdvo->dtd_sdvo_flags;
1212 if (!intel_sdvo_set_input_timing(intel_sdvo, &input_dtd))
1214 SDVO_NAME(intel_sdvo));
1223 if (!intel_sdvo_set_clock_rate_mult(intel_sdvo, rate))
1231 if (!HAS_PCH_SPLIT(dev) && intel_sdvo->is_hdmi)
1232 sdvox |= intel_sdvo->color_range;
1236 sdvox = I915_READ(intel_sdvo->sdvo_reg);
1237 switch (intel_sdvo->sdvo_reg) {
1253 if (intel_sdvo->has_hdmi_audio)
1270 intel_sdvo_write_sdvox(intel_sdvo, sdvox);
1277 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(&connector->base);
1280 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs);
1293 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
1297 tmp = I915_READ(intel_sdvo->sdvo_reg);
1298 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs);
1316 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
1323 ret = intel_sdvo_get_input_timing(intel_sdvo, &dtd);
1351 sdvox = I915_READ(intel_sdvo->sdvo_reg);
1358 intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT, &val, 1);
1382 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
1385 intel_sdvo_set_active_outputs(intel_sdvo, 0);
1387 intel_sdvo_set_encoder_power_state(intel_sdvo,
1390 temp = I915_READ(intel_sdvo->sdvo_reg);
1400 I915_WRITE(intel_sdvo->sdvo_reg, temp);
1401 POSTING_READ(intel_sdvo->sdvo_reg);
1404 I915_WRITE(intel_sdvo->sdvo_reg, temp);
1405 POSTING_READ(intel_sdvo->sdvo_reg);
1416 intel_sdvo_write_sdvox(intel_sdvo, temp & ~SDVO_ENABLE);
1424 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
1431 temp = I915_READ(intel_sdvo->sdvo_reg);
1438 intel_sdvo_write_sdvox(intel_sdvo, temp | SDVO_ENABLE);
1443 status = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2);
1450 "sync\n", SDVO_NAME(intel_sdvo));
1454 (void) intel_sdvo_set_encoder_power_state(intel_sdvo,
1456 (void) intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo->attached_output);
1462 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
1474 crtc = intel_sdvo->base.base.crtc;
1476 intel_sdvo->base.connectors_active = false;
1483 intel_sdvo_set_active_outputs(intel_sdvo, 0);
1485 intel_sdvo_set_encoder_power_state(intel_sdvo, mode);
1487 intel_sdvo->base.connectors_active = false;
1491 intel_sdvo->base.connectors_active = true;
1496 intel_sdvo_set_encoder_power_state(intel_sdvo, mode);
1497 intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo->attached_output);
1506 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
1511 if (intel_sdvo->pixel_clock_min > mode->clock)
1514 if (intel_sdvo->pixel_clock_max < mode->clock)
1517 if (intel_sdvo->is_lvds) {
1518 if (mode->hdisplay > intel_sdvo->sdvo_lvds_fixed_mode->hdisplay)
1521 if (mode->vdisplay > intel_sdvo->sdvo_lvds_fixed_mode->vdisplay)
1528 static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct intel_sdvo_caps *caps)
1530 if (!intel_sdvo_get_value(intel_sdvo,
1564 static uint16_t intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo)
1566 struct drm_device *dev = intel_sdvo->base.base.dev;
1574 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT,
1583 struct intel_sdvo *intel_sdvo = to_intel_sdvo(&encoder->base);
1585 intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG,
1586 &intel_sdvo->hotplug_active, 2);
1590 intel_sdvo_multifunc_encoder(struct intel_sdvo *intel_sdvo)
1593 return hweight16(intel_sdvo->caps.output_flags) > 1;
1599 struct intel_sdvo *sdvo = intel_attached_sdvo(connector);
1617 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
1623 if (edid == NULL && intel_sdvo_multifunc_encoder(intel_sdvo)) {
1624 u8 ddc, saved_ddc = intel_sdvo->ddc_bus;
1630 for (ddc = intel_sdvo->ddc_bus >> 1; ddc > 1; ddc >>= 1) {
1631 intel_sdvo->ddc_bus = ddc;
1641 intel_sdvo->ddc_bus = saved_ddc;
1656 if (intel_sdvo->is_hdmi) {
1657 intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid);
1658 intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid);
1659 intel_sdvo->rgb_quant_range_selectable =
1670 intel_sdvo->has_hdmi_audio = (intel_sdvo_connector->force_audio == HDMI_AUDIO_ON);
1692 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
1696 if (!intel_sdvo_get_value(intel_sdvo,
1708 intel_sdvo->attached_output = response;
1710 intel_sdvo->has_hdmi_monitor = false;
1711 intel_sdvo->has_hdmi_audio = false;
1712 intel_sdvo->rgb_quant_range_selectable = false;
1739 intel_sdvo->is_tv = false;
1740 intel_sdvo->is_lvds = false;
1743 intel_sdvo->is_tv = true;
1745 intel_sdvo->is_lvds = intel_sdvo->sdvo_lvds_fixed_mode != NULL;
1845 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
1853 format_map = 1 << intel_sdvo->tv_format_index;
1857 if (!intel_sdvo_set_target_output(intel_sdvo, intel_sdvo->attached_output))
1860 if (!intel_sdvo_write_cmd(intel_sdvo,
1864 if (!intel_sdvo_read_response(intel_sdvo, &reply, 3))
1879 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
1903 intel_ddc_get_modes(connector, &intel_sdvo->ddc);
1907 intel_sdvo->sdvo_lvds_fixed_mode =
1910 intel_sdvo->is_lvds = true;
1988 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
1992 if (!intel_sdvo->is_hdmi)
2009 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector);
2034 if (has_audio == intel_sdvo->has_hdmi_audio)
2037 intel_sdvo->has_hdmi_audio = has_audio;
2042 bool old_auto = intel_sdvo->color_range_auto;
2043 uint32_t old_range = intel_sdvo->color_range;
2047 intel_sdvo->color_range_auto = true;
2050 intel_sdvo->color_range_auto = false;
2051 intel_sdvo->color_range = 0;
2054 intel_sdvo->color_range_auto = false;
2057 intel_sdvo->color_range = HDMI_COLOR_RANGE_16_235;
2063 if (old_auto == intel_sdvo->color_range_auto &&
2064 old_range == intel_sdvo->color_range)
2083 if (intel_sdvo->tv_format_index ==
2087 intel_sdvo->tv_format_index = intel_sdvo_connector->tv_format_supported[val];
2158 if (!intel_sdvo_set_value(intel_sdvo, cmd, &temp_value, 2))
2163 if (intel_sdvo->base.base.crtc)
2164 intel_crtc_restore_mode(intel_sdvo->base.base.crtc);
2186 struct intel_sdvo *intel_sdvo = to_intel_sdvo(encoder);
2188 if (intel_sdvo->sdvo_lvds_fixed_mode != NULL)
2190 intel_sdvo->sdvo_lvds_fixed_mode);
2192 /* OSOL i2c_del_adapter(&intel_sdvo->ddc); */
2201 intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo)
2245 struct intel_sdvo *sdvo, u32 reg)
2262 struct intel_sdvo *sdvo, u32 reg)
2287 intel_sdvo_unselect_i2c_bus(struct intel_sdvo *sdvo)
2293 intel_sdvo_is_hdmi_connector(struct intel_sdvo *intel_sdvo, int device)
2295 return intel_sdvo_check_supp_encode(intel_sdvo);
2299 intel_sdvo_get_slave_addr(struct drm_device *dev, struct intel_sdvo *sdvo)
2337 struct intel_sdvo *encoder)
2356 intel_sdvo_add_hdmi_properties(struct intel_sdvo *intel_sdvo,
2364 intel_sdvo->color_range_auto = true;
2369 intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
2371 struct drm_encoder *encoder = &intel_sdvo->base.base;
2382 intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0;
2385 intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1;
2391 if (intel_sdvo_get_hotplug_support(intel_sdvo) &
2393 intel_sdvo->hotplug_active |= intel_sdvo_connector->output_flag;
2405 if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) {
2407 intel_sdvo->is_hdmi = true;
2410 intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
2411 if (intel_sdvo->is_hdmi)
2412 intel_sdvo_add_hdmi_properties(intel_sdvo, intel_sdvo_connector);
2418 intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type)
2420 struct drm_encoder *encoder = &intel_sdvo->base.base;
2434 intel_sdvo->controlled_output |= type;
2437 intel_sdvo->is_tv = true;
2439 intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
2441 if (!intel_sdvo_tv_create_property(intel_sdvo, intel_sdvo_connector, type))
2444 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector))
2455 intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device)
2457 struct drm_encoder *encoder = &intel_sdvo->base.base;
2473 intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0;
2476 intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1;
2481 intel_sdvo);
2486 intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device)
2488 struct drm_encoder *encoder = &intel_sdvo->base.base;
2503 intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0;
2506 intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1;
2510 intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo);
2511 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector))
2522 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, uint16_t flags)
2524 intel_sdvo->is_tv = false;
2525 intel_sdvo->is_lvds = false;
2530 if (!intel_sdvo_dvi_init(intel_sdvo, 0))
2534 if (!intel_sdvo_dvi_init(intel_sdvo, 1))
2539 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_SVID0))
2543 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_CVBS0))
2547 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_YPRPB0))
2551 if (!intel_sdvo_analog_init(intel_sdvo, 0))
2555 if (!intel_sdvo_analog_init(intel_sdvo, 1))
2559 if (!intel_sdvo_lvds_init(intel_sdvo, 0))
2563 if (!intel_sdvo_lvds_init(intel_sdvo, 1))
2569 intel_sdvo->controlled_output = 0;
2570 memcpy(bytes, &intel_sdvo->caps.output_flags, 2);
2572 SDVO_NAME(intel_sdvo),
2576 intel_sdvo->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2);
2581 static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo)
2583 struct drm_device *dev = intel_sdvo->base.base.dev;
2588 if (intel_attached_encoder(connector) == &intel_sdvo->base)
2593 static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
2597 struct drm_device *dev = intel_sdvo->base.base.dev;
2601 if (!intel_sdvo_set_target_output(intel_sdvo, type))
2604 if (!intel_sdvo_get_value(intel_sdvo,
2631 intel_sdvo->tv_format_index = intel_sdvo_connector->tv_format_supported[0];
2640 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_MAX_##NAME, &data_value, 4) || \
2641 !intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_##NAME, &response, 2)) \
2657 intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo,
2661 struct drm_device *dev = intel_sdvo->base.base.dev;
2667 if (!intel_sdvo_get_value(intel_sdvo,
2672 if (!intel_sdvo_get_value(intel_sdvo,
2703 if (!intel_sdvo_get_value(intel_sdvo,
2708 if (!intel_sdvo_get_value(intel_sdvo,
2754 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_DOT_CRAWL, &response, 2))
2774 intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo,
2778 struct drm_device *dev = intel_sdvo->base.base.dev;
2788 static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
2797 (void) intel_sdvo_get_value(intel_sdvo,
2806 return intel_sdvo_create_enhance_property_tv(intel_sdvo, intel_sdvo_connector, enhancements.reply);
2808 return intel_sdvo_create_enhance_property_lvds(intel_sdvo, intel_sdvo_connector, enhancements.reply);
2817 struct intel_sdvo *sdvo = adapter->algo_data;
2827 struct intel_sdvo *sdvo = adapter->algo_data;
2837 intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo,
2854 struct intel_sdvo *intel_sdvo;
2856 intel_sdvo = kzalloc(sizeof(struct intel_sdvo), GFP_KERNEL);
2857 if (!intel_sdvo)
2860 intel_sdvo->sdvo_reg = sdvo_reg;
2861 intel_sdvo->is_sdvob = is_sdvob;
2862 intel_sdvo->slave_addr = intel_sdvo_get_slave_addr(dev, intel_sdvo) >> 1;
2863 intel_sdvo_select_i2c_bus(dev_priv, intel_sdvo, sdvo_reg);
2864 if (!intel_sdvo_init_ddc_proxy(intel_sdvo, dev))
2868 intel_encoder = &intel_sdvo->base;
2870 intel_encoder->type_size = sizeof(struct intel_sdvo);
2877 if (!intel_sdvo_read_byte(intel_sdvo, i, &byte)) {
2879 SDVO_NAME(intel_sdvo));
2892 if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps))
2895 if (intel_sdvo_output_setup(intel_sdvo,
2896 intel_sdvo->caps.output_flags) != true) {
2898 SDVO_NAME(intel_sdvo));
2906 if (intel_sdvo->hotplug_active) {
2908 intel_sdvo->is_sdvob ? HPD_SDVO_B : HPD_SDVO_C;
2919 intel_sdvo->base.cloneable = false;
2921 intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo, sdvo_reg);
2924 if (!intel_sdvo_set_target_input(intel_sdvo))
2927 if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo,
2928 &intel_sdvo->pixel_clock_min,
2929 &intel_sdvo->pixel_clock_max))
2936 SDVO_NAME(intel_sdvo),
2937 intel_sdvo->caps.vendor_id, intel_sdvo->caps.device_id,
2938 intel_sdvo->caps.device_rev_id,
2939 intel_sdvo->pixel_clock_min / 1000,
2940 intel_sdvo->pixel_clock_max / 1000,
2941 (intel_sdvo->caps.sdvo_inputs_mask & 0x1) ? 'Y' : 'N',
2942 (intel_sdvo->caps.sdvo_inputs_mask & 0x2) ? 'Y' : 'N',
2944 intel_sdvo->caps.output_flags &
2946 intel_sdvo->caps.output_flags &
2951 intel_sdvo_output_cleanup(intel_sdvo);
2955 // i2c_del_adapter(&intel_sdvo->ddc);
2957 intel_sdvo_unselect_i2c_bus(intel_sdvo);
2958 kfree(intel_sdvo, sizeof(*intel_sdvo));