Lines Matching refs:intel_sdvo
77 struct intel_sdvo { struct
179 static struct intel_sdvo *to_sdvo(struct intel_encoder *encoder) in to_sdvo()
181 return container_of(encoder, struct intel_sdvo, base); in to_sdvo()
184 static struct intel_sdvo *intel_attached_sdvo(struct intel_connector *connector) in intel_attached_sdvo()
199 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags);
201 intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
205 intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
213 static void intel_sdvo_write_sdvox(struct intel_sdvo *intel_sdvo, u32 val) in intel_sdvo_write_sdvox() argument
215 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_write_sdvox()
221 intel_de_write(dev_priv, intel_sdvo->sdvo_reg, val); in intel_sdvo_write_sdvox()
222 intel_de_posting_read(dev_priv, intel_sdvo->sdvo_reg); in intel_sdvo_write_sdvox()
228 intel_de_write(dev_priv, intel_sdvo->sdvo_reg, val); in intel_sdvo_write_sdvox()
229 intel_de_posting_read(dev_priv, intel_sdvo->sdvo_reg); in intel_sdvo_write_sdvox()
234 if (intel_sdvo->port == PORT_B) in intel_sdvo_write_sdvox()
253 static bool intel_sdvo_read_byte(struct intel_sdvo *intel_sdvo, u8 addr, u8 *ch) in intel_sdvo_read_byte() argument
257 .addr = intel_sdvo->slave_addr, in intel_sdvo_read_byte()
263 .addr = intel_sdvo->slave_addr, in intel_sdvo_read_byte()
271 if ((ret = i2c_transfer(intel_sdvo->i2c, msgs, 2)) == 2) in intel_sdvo_read_byte()
413 static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_debug_write() argument
416 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_debug_write()
440 DRM_DEBUG_KMS("%s: W: %02X %s\n", SDVO_NAME(intel_sdvo), cmd, buffer); in intel_sdvo_debug_write()
461 static bool __intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, in __intel_sdvo_write_cmd() argument
480 intel_sdvo_debug_write(intel_sdvo, cmd, args, args_len); in __intel_sdvo_write_cmd()
483 msgs[i].addr = intel_sdvo->slave_addr; in __intel_sdvo_write_cmd()
490 msgs[i].addr = intel_sdvo->slave_addr; in __intel_sdvo_write_cmd()
499 msgs[i+1].addr = intel_sdvo->slave_addr; in __intel_sdvo_write_cmd()
504 msgs[i+2].addr = intel_sdvo->slave_addr; in __intel_sdvo_write_cmd()
510 ret = i2c_transfer(intel_sdvo->i2c, msgs, i+3); in __intel_sdvo_write_cmd()
512 ret = __i2c_transfer(intel_sdvo->i2c, msgs, i+3); in __intel_sdvo_write_cmd()
530 static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_write_cmd() argument
533 return __intel_sdvo_write_cmd(intel_sdvo, cmd, args, args_len, true); in intel_sdvo_write_cmd()
536 static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, in intel_sdvo_read_response() argument
539 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_read_response()
565 if (!intel_sdvo_read_byte(intel_sdvo, in intel_sdvo_read_response()
577 if (!intel_sdvo_read_byte(intel_sdvo, in intel_sdvo_read_response()
597 if (!intel_sdvo_read_byte(intel_sdvo, in intel_sdvo_read_response()
607 DRM_DEBUG_KMS("%s: R: %s\n", SDVO_NAME(intel_sdvo), buffer); in intel_sdvo_read_response()
612 SDVO_NAME(intel_sdvo), buffer); in intel_sdvo_read_response()
626 static bool __intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo, in __intel_sdvo_set_control_bus_switch() argument
630 return __intel_sdvo_write_cmd(intel_sdvo, in __intel_sdvo_set_control_bus_switch()
635 static bool intel_sdvo_set_value(struct intel_sdvo *intel_sdvo, u8 cmd, const void *data, int len) in intel_sdvo_set_value() argument
637 if (!intel_sdvo_write_cmd(intel_sdvo, cmd, data, len)) in intel_sdvo_set_value()
640 return intel_sdvo_read_response(intel_sdvo, NULL, 0); in intel_sdvo_set_value()
644 intel_sdvo_get_value(struct intel_sdvo *intel_sdvo, u8 cmd, void *value, int len) in intel_sdvo_get_value() argument
646 if (!intel_sdvo_write_cmd(intel_sdvo, cmd, NULL, 0)) in intel_sdvo_get_value()
649 return intel_sdvo_read_response(intel_sdvo, value, len); in intel_sdvo_get_value()
652 static bool intel_sdvo_set_target_input(struct intel_sdvo *intel_sdvo) in intel_sdvo_set_target_input() argument
655 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_target_input()
666 static bool intel_sdvo_get_trained_inputs(struct intel_sdvo *intel_sdvo, bool *input_1, bool *input… in intel_sdvo_get_trained_inputs() argument
671 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_TRAINED_INPUTS, in intel_sdvo_get_trained_inputs()
680 static bool intel_sdvo_set_active_outputs(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_active_outputs() argument
683 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_active_outputs()
688 static bool intel_sdvo_get_active_outputs(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_active_outputs() argument
691 return intel_sdvo_get_value(intel_sdvo, in intel_sdvo_get_active_outputs()
696 static bool intel_sdvo_set_encoder_power_state(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_encoder_power_state() argument
716 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_encoder_power_state()
720 static bool intel_sdvo_get_input_pixel_clock_range(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_input_pixel_clock_range() argument
727 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_get_input_pixel_clock_range()
738 static bool intel_sdvo_set_target_output(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_target_output() argument
741 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_target_output()
746 static bool intel_sdvo_set_timing(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_set_timing() argument
749 return intel_sdvo_set_value(intel_sdvo, cmd, &dtd->part1, sizeof(dtd->part1)) && in intel_sdvo_set_timing()
750 intel_sdvo_set_value(intel_sdvo, cmd + 1, &dtd->part2, sizeof(dtd->part2)); in intel_sdvo_set_timing()
753 static bool intel_sdvo_get_timing(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_get_timing() argument
756 return intel_sdvo_get_value(intel_sdvo, cmd, &dtd->part1, sizeof(dtd->part1)) && in intel_sdvo_get_timing()
757 intel_sdvo_get_value(intel_sdvo, cmd + 1, &dtd->part2, sizeof(dtd->part2)); in intel_sdvo_get_timing()
760 static bool intel_sdvo_set_input_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_input_timing() argument
763 return intel_sdvo_set_timing(intel_sdvo, in intel_sdvo_set_input_timing()
767 static bool intel_sdvo_set_output_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_output_timing() argument
770 return intel_sdvo_set_timing(intel_sdvo, in intel_sdvo_set_output_timing()
774 static bool intel_sdvo_get_input_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_input_timing() argument
777 return intel_sdvo_get_timing(intel_sdvo, in intel_sdvo_get_input_timing()
782 intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_preferred_input_timing() argument
805 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_create_preferred_input_timing()
810 static bool intel_sdvo_get_preferred_input_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_preferred_input_timing() argument
815 return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1, in intel_sdvo_get_preferred_input_timing()
817 intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2, in intel_sdvo_get_preferred_input_timing()
821 static bool intel_sdvo_set_clock_rate_mult(struct intel_sdvo *intel_sdvo, u8 val) in intel_sdvo_set_clock_rate_mult() argument
823 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_CLOCK_RATE_MULT, &val, 1); in intel_sdvo_set_clock_rate_mult()
925 static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo) in intel_sdvo_check_supp_encode() argument
930 return intel_sdvo_get_value(intel_sdvo, in intel_sdvo_check_supp_encode()
935 static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_encode() argument
938 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_ENCODE, &mode, 1); in intel_sdvo_set_encode()
941 static bool intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_colorimetry() argument
944 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_COLORIMETRY, &mode, 1); in intel_sdvo_set_colorimetry()
947 static bool intel_sdvo_set_pixel_replication(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_pixel_replication() argument
950 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_PIXEL_REPLI, in intel_sdvo_set_pixel_replication()
954 static bool intel_sdvo_set_audio_state(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_audio_state() argument
957 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_AUDIO_STAT, in intel_sdvo_set_audio_state()
961 static bool intel_sdvo_get_hbuf_size(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_hbuf_size() argument
964 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HBUF_INFO, in intel_sdvo_get_hbuf_size()
976 static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
1005 static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_write_infoframe() argument
1013 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1018 if (!intel_sdvo_get_hbuf_size(intel_sdvo, &hbuf_size)) in intel_sdvo_write_infoframe()
1032 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1038 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1043 static ssize_t intel_sdvo_read_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_read_infoframe() argument
1051 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_read_infoframe()
1059 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_read_infoframe()
1064 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_read_infoframe()
1072 if (!intel_sdvo_get_hbuf_size(intel_sdvo, &hbuf_size)) in intel_sdvo_read_infoframe()
1081 if (!intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_HBUF_DATA, NULL, 0)) in intel_sdvo_read_infoframe()
1083 if (!intel_sdvo_read_response(intel_sdvo, &data[i], in intel_sdvo_read_infoframe()
1091 static bool intel_sdvo_compute_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_compute_avi_infoframe() argument
1095 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_compute_avi_infoframe()
1127 static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_avi_infoframe() argument
1130 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_set_avi_infoframe()
1147 return intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF, in intel_sdvo_set_avi_infoframe()
1152 static void intel_sdvo_get_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_avi_infoframe() argument
1163 len = intel_sdvo_read_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF, in intel_sdvo_get_avi_infoframe()
1186 static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_tv_format() argument
1197 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_tv_format()
1203 intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_output_timings_from_mode() argument
1208 if (!intel_sdvo_set_target_output(intel_sdvo, in intel_sdvo_set_output_timings_from_mode()
1209 intel_sdvo->attached_output)) in intel_sdvo_set_output_timings_from_mode()
1213 if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) in intel_sdvo_set_output_timings_from_mode()
1224 intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_preferred_input_mode() argument
1232 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_get_preferred_input_mode()
1235 if (!intel_sdvo_create_preferred_input_timing(intel_sdvo, in intel_sdvo_get_preferred_input_mode()
1242 if (!intel_sdvo_get_preferred_input_timing(intel_sdvo, in intel_sdvo_get_preferred_input_mode()
1247 intel_sdvo->dtd_sdvo_flags = input_dtd.part2.sdvo_flags; in intel_sdvo_get_preferred_input_mode()
1282 static bool intel_has_hdmi_sink(struct intel_sdvo *sdvo, in intel_has_hdmi_sink()
1293 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_limited_color_range() local
1295 if ((intel_sdvo->colorimetry_cap & SDVO_COLORIMETRY_RGB220) == 0) in intel_sdvo_limited_color_range()
1305 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_compute_config() local
1327 if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, mode)) in intel_sdvo_compute_config()
1330 (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, in intel_sdvo_compute_config()
1336 if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, in intel_sdvo_compute_config()
1340 (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, in intel_sdvo_compute_config()
1356 pipe_config->has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo, conn_state); in intel_sdvo_compute_config()
1360 pipe_config->has_audio = intel_sdvo->has_hdmi_audio; in intel_sdvo_compute_config()
1378 if (!intel_sdvo_compute_avi_infoframe(intel_sdvo, in intel_sdvo_compute_config()
1390 intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_##NAME, &val, sizeof(val)); \
1393 static void intel_sdvo_update_props(struct intel_sdvo *intel_sdvo, in intel_sdvo_update_props() argument
1462 struct intel_sdvo *intel_sdvo = to_sdvo(intel_encoder); in intel_sdvo_pre_enable() local
1468 intel_sdvo_update_props(intel_sdvo, sdvo_state); in intel_sdvo_pre_enable()
1477 in_out.in0 = intel_sdvo->attached_output; in intel_sdvo_pre_enable()
1480 intel_sdvo_set_value(intel_sdvo, in intel_sdvo_pre_enable()
1485 if (!intel_sdvo_set_target_output(intel_sdvo, in intel_sdvo_pre_enable()
1486 intel_sdvo->attached_output)) in intel_sdvo_pre_enable()
1495 if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) in intel_sdvo_pre_enable()
1498 SDVO_NAME(intel_sdvo)); in intel_sdvo_pre_enable()
1501 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_pre_enable()
1505 intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_HDMI); in intel_sdvo_pre_enable()
1506 intel_sdvo_set_colorimetry(intel_sdvo, in intel_sdvo_pre_enable()
1510 intel_sdvo_set_avi_infoframe(intel_sdvo, crtc_state); in intel_sdvo_pre_enable()
1511 intel_sdvo_set_pixel_replication(intel_sdvo, in intel_sdvo_pre_enable()
1515 intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_DVI); in intel_sdvo_pre_enable()
1518 !intel_sdvo_set_tv_format(intel_sdvo, conn_state)) in intel_sdvo_pre_enable()
1524 input_dtd.part2.sdvo_flags = intel_sdvo->dtd_sdvo_flags; in intel_sdvo_pre_enable()
1525 if (!intel_sdvo_set_input_timing(intel_sdvo, &input_dtd)) in intel_sdvo_pre_enable()
1528 SDVO_NAME(intel_sdvo)); in intel_sdvo_pre_enable()
1539 if (!intel_sdvo_set_clock_rate_mult(intel_sdvo, rate)) in intel_sdvo_pre_enable()
1550 sdvox = intel_de_read(dev_priv, intel_sdvo->sdvo_reg); in intel_sdvo_pre_enable()
1551 if (intel_sdvo->port == PORT_B) in intel_sdvo_pre_enable()
1576 intel_sdvo_write_sdvox(intel_sdvo, sdvox); in intel_sdvo_pre_enable()
1583 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); in intel_sdvo_connector_get_hw_state() local
1586 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); in intel_sdvo_connector_get_hw_state()
1613 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_get_hw_state() local
1617 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); in intel_sdvo_get_hw_state()
1619 ret = intel_sdvo_port_enabled(dev_priv, intel_sdvo->sdvo_reg, pipe); in intel_sdvo_get_hw_state()
1629 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_get_config() local
1639 sdvox = intel_de_read(dev_priv, intel_sdvo->sdvo_reg); in intel_sdvo_get_config()
1641 ret = intel_sdvo_get_input_timing(intel_sdvo, &dtd); in intel_sdvo_get_config()
1684 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT, in intel_sdvo_get_config()
1704 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_COLORIMETRY, in intel_sdvo_get_config()
1710 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_AUDIO_STAT, in intel_sdvo_get_config()
1718 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ENCODE, in intel_sdvo_get_config()
1724 intel_sdvo_get_avi_infoframe(intel_sdvo, pipe_config); in intel_sdvo_get_config()
1727 static void intel_sdvo_disable_audio(struct intel_sdvo *intel_sdvo) in intel_sdvo_disable_audio() argument
1729 intel_sdvo_set_audio_state(intel_sdvo, 0); in intel_sdvo_disable_audio()
1732 static void intel_sdvo_enable_audio(struct intel_sdvo *intel_sdvo, in intel_sdvo_enable_audio() argument
1743 intel_sdvo_set_audio_state(intel_sdvo, 0); in intel_sdvo_enable_audio()
1745 intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_ELD, in intel_sdvo_enable_audio()
1749 intel_sdvo_set_audio_state(intel_sdvo, SDVO_AUDIO_ELD_VALID | in intel_sdvo_enable_audio()
1759 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_disable_sdvo() local
1764 intel_sdvo_disable_audio(intel_sdvo); in intel_disable_sdvo()
1766 intel_sdvo_set_active_outputs(intel_sdvo, 0); in intel_disable_sdvo()
1768 intel_sdvo_set_encoder_power_state(intel_sdvo, in intel_disable_sdvo()
1771 temp = intel_de_read(dev_priv, intel_sdvo->sdvo_reg); in intel_disable_sdvo()
1774 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1791 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1794 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1824 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_enable_sdvo() local
1831 temp = intel_de_read(dev_priv, intel_sdvo->sdvo_reg); in intel_enable_sdvo()
1833 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_enable_sdvo()
1838 success = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2); in intel_enable_sdvo()
1848 "sync\n", SDVO_NAME(intel_sdvo)); in intel_enable_sdvo()
1852 intel_sdvo_set_encoder_power_state(intel_sdvo, in intel_enable_sdvo()
1854 intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo->attached_output); in intel_enable_sdvo()
1857 intel_sdvo_enable_audio(intel_sdvo, pipe_config, conn_state); in intel_enable_sdvo()
1864 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_mode_valid() local
1868 bool has_hdmi_sink = intel_has_hdmi_sink(intel_sdvo, connector->state); in intel_sdvo_mode_valid()
1884 if (intel_sdvo->pixel_clock_min > clock) in intel_sdvo_mode_valid()
1887 if (intel_sdvo->pixel_clock_max < clock) in intel_sdvo_mode_valid()
1904 static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct intel_sdvo_caps *caps) in intel_sdvo_get_capabilities() argument
1907 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_get_capabilities()
1941 static u8 intel_sdvo_get_colorimetry_cap(struct intel_sdvo *intel_sdvo) in intel_sdvo_get_colorimetry_cap() argument
1945 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_COLORIMETRY_CAP, in intel_sdvo_get_colorimetry_cap()
1952 static u16 intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo) in intel_sdvo_get_hotplug_support() argument
1954 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_get_hotplug_support()
1967 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, in intel_sdvo_get_hotplug_support()
1976 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_enable_hotplug() local
1978 intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, in intel_sdvo_enable_hotplug()
1979 &intel_sdvo->hotplug_active, 2); in intel_sdvo_enable_hotplug()
1992 intel_sdvo_multifunc_encoder(struct intel_sdvo *intel_sdvo) in intel_sdvo_multifunc_encoder() argument
1995 return hweight16(intel_sdvo->caps.output_flags) > 1; in intel_sdvo_multifunc_encoder()
2001 struct intel_sdvo *sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_get_edid()
2019 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_tmds_sink_detect() local
2027 if (edid == NULL && intel_sdvo_multifunc_encoder(intel_sdvo)) { in intel_sdvo_tmds_sink_detect()
2028 u8 ddc, saved_ddc = intel_sdvo->ddc_bus; in intel_sdvo_tmds_sink_detect()
2034 for (ddc = intel_sdvo->ddc_bus >> 1; ddc > 1; ddc >>= 1) { in intel_sdvo_tmds_sink_detect()
2035 intel_sdvo->ddc_bus = ddc; in intel_sdvo_tmds_sink_detect()
2045 intel_sdvo->ddc_bus = saved_ddc; in intel_sdvo_tmds_sink_detect()
2061 intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid); in intel_sdvo_tmds_sink_detect()
2062 intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid); in intel_sdvo_tmds_sink_detect()
2088 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_detect() local
2099 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_detect()
2111 intel_sdvo->attached_output = response; in intel_sdvo_detect()
2113 intel_sdvo->has_hdmi_monitor = false; in intel_sdvo_detect()
2114 intel_sdvo->has_hdmi_audio = false; in intel_sdvo_detect()
2241 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_get_tv_modes() local
2259 if (!intel_sdvo_set_target_output(intel_sdvo, intel_sdvo->attached_output)) in intel_sdvo_get_tv_modes()
2263 if (!intel_sdvo_write_cmd(intel_sdvo, in intel_sdvo_get_tv_modes()
2267 if (!intel_sdvo_read_response(intel_sdvo, &reply, 3)) in intel_sdvo_get_tv_modes()
2287 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_get_lvds_modes() local
2316 num_modes += intel_ddc_get_modes(connector, &intel_sdvo->ddc); in intel_sdvo_get_lvds_modes()
2453 struct intel_sdvo *sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_connector_register()
2468 struct intel_sdvo *sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_connector_unregister()
2533 struct intel_sdvo *intel_sdvo = to_sdvo(to_intel_encoder(encoder)); in intel_sdvo_enc_destroy() local
2535 i2c_del_adapter(&intel_sdvo->ddc); in intel_sdvo_enc_destroy()
2544 intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo) in intel_sdvo_guess_ddc_bus()
2594 struct intel_sdvo *sdvo) in intel_sdvo_select_ddc_bus()
2611 struct intel_sdvo *sdvo) in intel_sdvo_select_i2c_bus()
2639 intel_sdvo_unselect_i2c_bus(struct intel_sdvo *sdvo) in intel_sdvo_unselect_i2c_bus()
2645 intel_sdvo_is_hdmi_connector(struct intel_sdvo *intel_sdvo, int device) in intel_sdvo_is_hdmi_connector() argument
2647 return intel_sdvo_check_supp_encode(intel_sdvo); in intel_sdvo_is_hdmi_connector()
2652 struct intel_sdvo *sdvo) in intel_sdvo_get_slave_addr()
2691 struct intel_sdvo *encoder) in intel_sdvo_connector_init()
2718 intel_sdvo_add_hdmi_properties(struct intel_sdvo *intel_sdvo, in intel_sdvo_add_hdmi_properties() argument
2722 if (intel_sdvo->colorimetry_cap & SDVO_COLORIMETRY_RGB220) in intel_sdvo_add_hdmi_properties()
2749 intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) in intel_sdvo_dvi_init() argument
2751 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_dvi_init()
2770 if (intel_sdvo_get_hotplug_support(intel_sdvo) & in intel_sdvo_dvi_init()
2772 intel_sdvo->hotplug_active |= intel_sdvo_connector->output_flag; in intel_sdvo_dvi_init()
2786 if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) { in intel_sdvo_dvi_init()
2791 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_dvi_init()
2797 intel_sdvo_add_hdmi_properties(intel_sdvo, intel_sdvo_connector); in intel_sdvo_dvi_init()
2803 intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) in intel_sdvo_tv_init() argument
2805 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_tv_init()
2823 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_tv_init()
2828 if (!intel_sdvo_tv_create_property(intel_sdvo, intel_sdvo_connector, type)) in intel_sdvo_tv_init()
2831 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) in intel_sdvo_tv_init()
2842 intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) in intel_sdvo_analog_init() argument
2844 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_analog_init()
2866 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_analog_init()
2875 intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) in intel_sdvo_lvds_init() argument
2877 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_lvds_init()
2899 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_lvds_init()
2904 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) in intel_sdvo_lvds_init()
2948 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags) in intel_sdvo_output_setup() argument
2950 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_output_setup()
2954 intel_sdvo->controlled_output = flags; in intel_sdvo_output_setup()
2956 intel_sdvo_select_ddc_bus(i915, intel_sdvo); in intel_sdvo_output_setup()
2959 if (!intel_sdvo_dvi_init(intel_sdvo, 0)) in intel_sdvo_output_setup()
2963 if (!intel_sdvo_dvi_init(intel_sdvo, 1)) in intel_sdvo_output_setup()
2968 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_SVID0)) in intel_sdvo_output_setup()
2972 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_CVBS0)) in intel_sdvo_output_setup()
2976 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_YPRPB0)) in intel_sdvo_output_setup()
2980 if (!intel_sdvo_analog_init(intel_sdvo, 0)) in intel_sdvo_output_setup()
2984 if (!intel_sdvo_analog_init(intel_sdvo, 1)) in intel_sdvo_output_setup()
2988 if (!intel_sdvo_lvds_init(intel_sdvo, 0)) in intel_sdvo_output_setup()
2992 if (!intel_sdvo_lvds_init(intel_sdvo, 1)) in intel_sdvo_output_setup()
2998 memcpy(bytes, &intel_sdvo->caps.output_flags, 2); in intel_sdvo_output_setup()
3000 SDVO_NAME(intel_sdvo), in intel_sdvo_output_setup()
3004 intel_sdvo->base.pipe_mask = ~0; in intel_sdvo_output_setup()
3009 static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo) in intel_sdvo_output_cleanup() argument
3011 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_output_cleanup()
3016 if (intel_attached_encoder(to_intel_connector(connector)) == &intel_sdvo->base) { in intel_sdvo_output_cleanup()
3023 static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, in intel_sdvo_tv_create_property() argument
3027 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_tv_create_property()
3031 if (!intel_sdvo_set_target_output(intel_sdvo, type)) in intel_sdvo_tv_create_property()
3035 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_tv_create_property()
3070 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_MAX_##NAME, &data_value, 4) || \
3071 !intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_##NAME, &response, 2)) \
3087 intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property_tv() argument
3091 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_create_enhance_property_tv()
3100 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3105 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3134 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3139 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3183 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_DOT_CRAWL, &response, 2)) in intel_sdvo_create_enhance_property_tv()
3201 intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property_lvds() argument
3205 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_create_enhance_property_lvds()
3216 static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property() argument
3226 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property()
3235 …return intel_sdvo_create_enhance_property_tv(intel_sdvo, intel_sdvo_connector, enhancements.reply); in intel_sdvo_create_enhance_property()
3237 …return intel_sdvo_create_enhance_property_lvds(intel_sdvo, intel_sdvo_connector, enhancements.repl… in intel_sdvo_create_enhance_property()
3246 struct intel_sdvo *sdvo = adapter->algo_data; in intel_sdvo_ddc_proxy_xfer()
3256 struct intel_sdvo *sdvo = adapter->algo_data; in intel_sdvo_ddc_proxy_func()
3268 struct intel_sdvo *sdvo = adapter->algo_data; in proxy_lock_bus()
3275 struct intel_sdvo *sdvo = adapter->algo_data; in proxy_trylock_bus()
3282 struct intel_sdvo *sdvo = adapter->algo_data; in proxy_unlock_bus()
3293 intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo, in intel_sdvo_init_ddc_proxy()
3322 struct intel_sdvo *intel_sdvo; in intel_sdvo_init() local
3327 intel_sdvo = kzalloc(sizeof(*intel_sdvo), GFP_KERNEL); in intel_sdvo_init()
3328 if (!intel_sdvo) in intel_sdvo_init()
3331 intel_sdvo->sdvo_reg = sdvo_reg; in intel_sdvo_init()
3332 intel_sdvo->port = port; in intel_sdvo_init()
3333 intel_sdvo->slave_addr = in intel_sdvo_init()
3334 intel_sdvo_get_slave_addr(dev_priv, intel_sdvo) >> 1; in intel_sdvo_init()
3335 intel_sdvo_select_i2c_bus(dev_priv, intel_sdvo); in intel_sdvo_init()
3336 if (!intel_sdvo_init_ddc_proxy(intel_sdvo, dev_priv)) in intel_sdvo_init()
3340 intel_encoder = &intel_sdvo->base; in intel_sdvo_init()
3352 if (!intel_sdvo_read_byte(intel_sdvo, i, &byte)) { in intel_sdvo_init()
3355 SDVO_NAME(intel_sdvo)); in intel_sdvo_init()
3373 if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) in intel_sdvo_init()
3376 intel_sdvo->colorimetry_cap = in intel_sdvo_init()
3377 intel_sdvo_get_colorimetry_cap(intel_sdvo); in intel_sdvo_init()
3379 if (intel_sdvo_output_setup(intel_sdvo, in intel_sdvo_init()
3380 intel_sdvo->caps.output_flags) != true) { in intel_sdvo_init()
3383 SDVO_NAME(intel_sdvo)); in intel_sdvo_init()
3392 if (intel_sdvo->hotplug_active) { in intel_sdvo_init()
3393 if (intel_sdvo->port == PORT_B) in intel_sdvo_init()
3407 intel_sdvo->base.cloneable = 0; in intel_sdvo_init()
3410 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_init()
3413 if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo, in intel_sdvo_init()
3414 &intel_sdvo->pixel_clock_min, in intel_sdvo_init()
3415 &intel_sdvo->pixel_clock_max)) in intel_sdvo_init()
3422 SDVO_NAME(intel_sdvo), in intel_sdvo_init()
3423 intel_sdvo->caps.vendor_id, intel_sdvo->caps.device_id, in intel_sdvo_init()
3424 intel_sdvo->caps.device_rev_id, in intel_sdvo_init()
3425 intel_sdvo->pixel_clock_min / 1000, in intel_sdvo_init()
3426 intel_sdvo->pixel_clock_max / 1000, in intel_sdvo_init()
3427 (intel_sdvo->caps.sdvo_inputs_mask & 0x1) ? 'Y' : 'N', in intel_sdvo_init()
3428 (intel_sdvo->caps.sdvo_inputs_mask & 0x2) ? 'Y' : 'N', in intel_sdvo_init()
3430 intel_sdvo->caps.output_flags & in intel_sdvo_init()
3432 intel_sdvo->caps.output_flags & in intel_sdvo_init()
3437 intel_sdvo_output_cleanup(intel_sdvo); in intel_sdvo_init()
3441 i2c_del_adapter(&intel_sdvo->ddc); in intel_sdvo_init()
3443 intel_sdvo_unselect_i2c_bus(intel_sdvo); in intel_sdvo_init()
3444 kfree(intel_sdvo); in intel_sdvo_init()