Lines Matching refs:intel_sdvo

86 struct intel_sdvo;
90 struct intel_sdvo *sdvo;
94 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);
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->base.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
255 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_read_byte()
258 .addr = intel_sdvo->target_addr, in intel_sdvo_read_byte()
264 .addr = intel_sdvo->target_addr, in intel_sdvo_read_byte()
272 if ((ret = i2c_transfer(intel_sdvo->i2c, msgs, 2)) == 2) in intel_sdvo_read_byte()
414 static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_debug_write() argument
417 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_debug_write()
441 drm_dbg_kms(&dev_priv->drm, "%s: W: %02X %s\n", SDVO_NAME(intel_sdvo), in intel_sdvo_debug_write()
463 static bool __intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, in __intel_sdvo_write_cmd() argument
467 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in __intel_sdvo_write_cmd()
483 intel_sdvo_debug_write(intel_sdvo, cmd, args, args_len); in __intel_sdvo_write_cmd()
486 msgs[i].addr = intel_sdvo->target_addr; in __intel_sdvo_write_cmd()
493 msgs[i].addr = intel_sdvo->target_addr; in __intel_sdvo_write_cmd()
502 msgs[i+1].addr = intel_sdvo->target_addr; in __intel_sdvo_write_cmd()
507 msgs[i+2].addr = intel_sdvo->target_addr; in __intel_sdvo_write_cmd()
513 ret = i2c_transfer(intel_sdvo->i2c, msgs, i+3); in __intel_sdvo_write_cmd()
515 ret = __i2c_transfer(intel_sdvo->i2c, msgs, i+3); in __intel_sdvo_write_cmd()
533 static bool intel_sdvo_write_cmd(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_write_cmd() argument
536 return __intel_sdvo_write_cmd(intel_sdvo, cmd, args, args_len, true); in intel_sdvo_write_cmd()
539 static bool intel_sdvo_read_response(struct intel_sdvo *intel_sdvo, in intel_sdvo_read_response() argument
542 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_read_response()
568 if (!intel_sdvo_read_byte(intel_sdvo, in intel_sdvo_read_response()
580 if (!intel_sdvo_read_byte(intel_sdvo, in intel_sdvo_read_response()
600 if (!intel_sdvo_read_byte(intel_sdvo, in intel_sdvo_read_response()
611 SDVO_NAME(intel_sdvo), buffer); in intel_sdvo_read_response()
616 SDVO_NAME(intel_sdvo), buffer); in intel_sdvo_read_response()
630 static bool __intel_sdvo_set_control_bus_switch(struct intel_sdvo *intel_sdvo, in __intel_sdvo_set_control_bus_switch() argument
634 return __intel_sdvo_write_cmd(intel_sdvo, in __intel_sdvo_set_control_bus_switch()
639 static bool intel_sdvo_set_value(struct intel_sdvo *intel_sdvo, u8 cmd, const void *data, int len) in intel_sdvo_set_value() argument
641 if (!intel_sdvo_write_cmd(intel_sdvo, cmd, data, len)) in intel_sdvo_set_value()
644 return intel_sdvo_read_response(intel_sdvo, NULL, 0); in intel_sdvo_set_value()
648 intel_sdvo_get_value(struct intel_sdvo *intel_sdvo, u8 cmd, void *value, int len) in intel_sdvo_get_value() argument
650 if (!intel_sdvo_write_cmd(intel_sdvo, cmd, NULL, 0)) in intel_sdvo_get_value()
653 return intel_sdvo_read_response(intel_sdvo, value, len); in intel_sdvo_get_value()
656 static bool intel_sdvo_set_target_input(struct intel_sdvo *intel_sdvo) in intel_sdvo_set_target_input() argument
659 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_target_input()
670 static bool intel_sdvo_get_trained_inputs(struct intel_sdvo *intel_sdvo, bool *input_1, bool *input… in intel_sdvo_get_trained_inputs() argument
675 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_TRAINED_INPUTS, in intel_sdvo_get_trained_inputs()
684 static bool intel_sdvo_set_active_outputs(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_active_outputs() argument
687 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_active_outputs()
692 static bool intel_sdvo_get_active_outputs(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_active_outputs() argument
695 return intel_sdvo_get_value(intel_sdvo, in intel_sdvo_get_active_outputs()
700 static bool intel_sdvo_set_encoder_power_state(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_encoder_power_state() argument
720 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_encoder_power_state()
724 static bool intel_sdvo_get_input_pixel_clock_range(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_input_pixel_clock_range() argument
731 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_get_input_pixel_clock_range()
742 static bool intel_sdvo_set_target_output(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_target_output() argument
745 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_target_output()
750 static bool intel_sdvo_set_timing(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_set_timing() argument
753 return intel_sdvo_set_value(intel_sdvo, cmd, &dtd->part1, sizeof(dtd->part1)) && in intel_sdvo_set_timing()
754 intel_sdvo_set_value(intel_sdvo, cmd + 1, &dtd->part2, sizeof(dtd->part2)); in intel_sdvo_set_timing()
757 static bool intel_sdvo_get_timing(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_get_timing() argument
760 return intel_sdvo_get_value(intel_sdvo, cmd, &dtd->part1, sizeof(dtd->part1)) && in intel_sdvo_get_timing()
761 intel_sdvo_get_value(intel_sdvo, cmd + 1, &dtd->part2, sizeof(dtd->part2)); in intel_sdvo_get_timing()
764 static bool intel_sdvo_set_input_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_input_timing() argument
767 return intel_sdvo_set_timing(intel_sdvo, in intel_sdvo_set_input_timing()
771 static bool intel_sdvo_set_output_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_output_timing() argument
774 return intel_sdvo_set_timing(intel_sdvo, in intel_sdvo_set_output_timing()
778 static bool intel_sdvo_get_input_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_input_timing() argument
781 return intel_sdvo_get_timing(intel_sdvo, in intel_sdvo_get_input_timing()
786 intel_sdvo_create_preferred_input_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_preferred_input_timing() argument
807 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_create_preferred_input_timing()
812 static bool intel_sdvo_get_preferred_input_timing(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_preferred_input_timing() argument
817 return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART1, in intel_sdvo_get_preferred_input_timing()
819 intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_PREFERRED_INPUT_TIMING_PART2, in intel_sdvo_get_preferred_input_timing()
823 static bool intel_sdvo_set_clock_rate_mult(struct intel_sdvo *intel_sdvo, u8 val) in intel_sdvo_set_clock_rate_mult() argument
825 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_CLOCK_RATE_MULT, &val, 1); in intel_sdvo_set_clock_rate_mult()
927 static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo) in intel_sdvo_check_supp_encode() argument
932 return intel_sdvo_get_value(intel_sdvo, in intel_sdvo_check_supp_encode()
937 static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_encode() argument
940 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_ENCODE, &mode, 1); in intel_sdvo_set_encode()
943 static bool intel_sdvo_set_colorimetry(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_colorimetry() argument
946 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_COLORIMETRY, &mode, 1); in intel_sdvo_set_colorimetry()
949 static bool intel_sdvo_set_pixel_replication(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_pixel_replication() argument
952 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_PIXEL_REPLI, in intel_sdvo_set_pixel_replication()
956 static bool intel_sdvo_set_audio_state(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_audio_state() argument
959 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_AUDIO_STAT, in intel_sdvo_set_audio_state()
963 static bool intel_sdvo_get_hbuf_size(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_hbuf_size() argument
966 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HBUF_INFO, in intel_sdvo_get_hbuf_size()
978 static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
1007 static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_write_infoframe() argument
1011 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_write_infoframe()
1016 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1021 if (!intel_sdvo_get_hbuf_size(intel_sdvo, &hbuf_size)) in intel_sdvo_write_infoframe()
1036 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1042 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1047 static ssize_t intel_sdvo_read_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_read_infoframe() argument
1051 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_read_infoframe()
1056 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_read_infoframe()
1064 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_read_infoframe()
1069 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_read_infoframe()
1078 if (!intel_sdvo_get_hbuf_size(intel_sdvo, &hbuf_size)) in intel_sdvo_read_infoframe()
1088 if (!intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_HBUF_DATA, NULL, 0)) in intel_sdvo_read_infoframe()
1090 if (!intel_sdvo_read_response(intel_sdvo, &data[i], in intel_sdvo_read_infoframe()
1098 static bool intel_sdvo_compute_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_compute_avi_infoframe() argument
1102 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_compute_avi_infoframe()
1134 static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_avi_infoframe() argument
1137 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_set_avi_infoframe()
1154 return intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF, in intel_sdvo_set_avi_infoframe()
1159 static void intel_sdvo_get_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_avi_infoframe() argument
1162 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_get_avi_infoframe()
1171 len = intel_sdvo_read_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF, in intel_sdvo_get_avi_infoframe()
1195 static void intel_sdvo_get_eld(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_eld() argument
1198 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_get_eld()
1205 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_AUDIO_STAT, &val, 1)) in intel_sdvo_get_eld()
1211 len = intel_sdvo_read_infoframe(intel_sdvo, SDVO_HBUF_INDEX_ELD, in intel_sdvo_get_eld()
1217 static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_tv_format() argument
1228 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_tv_format()
1234 intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_output_timings_from_mode() argument
1240 if (!intel_sdvo_set_target_output(intel_sdvo, in intel_sdvo_set_output_timings_from_mode()
1245 if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) in intel_sdvo_set_output_timings_from_mode()
1256 intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_preferred_input_mode() argument
1264 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_get_preferred_input_mode()
1267 if (!intel_sdvo_create_preferred_input_timing(intel_sdvo, in intel_sdvo_get_preferred_input_mode()
1272 if (!intel_sdvo_get_preferred_input_timing(intel_sdvo, in intel_sdvo_get_preferred_input_mode()
1277 intel_sdvo->dtd_sdvo_flags = input_dtd.part2.sdvo_flags; in intel_sdvo_get_preferred_input_mode()
1329 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_limited_color_range() local
1331 if ((intel_sdvo->colorimetry_cap & SDVO_COLORIMETRY_RGB220) == 0) in intel_sdvo_limited_color_range()
1362 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_compute_config() local
1387 if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, in intel_sdvo_compute_config()
1392 (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, in intel_sdvo_compute_config()
1407 if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, in intel_sdvo_compute_config()
1412 (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, in intel_sdvo_compute_config()
1451 if (!intel_sdvo_compute_avi_infoframe(intel_sdvo, in intel_sdvo_compute_config()
1463 intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_##NAME, &val, sizeof(val)); \
1466 static void intel_sdvo_update_props(struct intel_sdvo *intel_sdvo, in intel_sdvo_update_props() argument
1535 struct intel_sdvo *intel_sdvo = to_sdvo(intel_encoder); in intel_sdvo_pre_enable() local
1541 intel_sdvo_update_props(intel_sdvo, sdvo_state); in intel_sdvo_pre_enable()
1553 intel_sdvo_set_value(intel_sdvo, in intel_sdvo_pre_enable()
1558 if (!intel_sdvo_set_target_output(intel_sdvo, in intel_sdvo_pre_enable()
1571 if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) in intel_sdvo_pre_enable()
1574 SDVO_NAME(intel_sdvo)); in intel_sdvo_pre_enable()
1577 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_pre_enable()
1581 intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_HDMI); in intel_sdvo_pre_enable()
1582 intel_sdvo_set_colorimetry(intel_sdvo, in intel_sdvo_pre_enable()
1586 intel_sdvo_set_avi_infoframe(intel_sdvo, crtc_state); in intel_sdvo_pre_enable()
1587 intel_sdvo_set_pixel_replication(intel_sdvo, in intel_sdvo_pre_enable()
1591 intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_DVI); in intel_sdvo_pre_enable()
1594 !intel_sdvo_set_tv_format(intel_sdvo, conn_state)) in intel_sdvo_pre_enable()
1600 input_dtd.part2.sdvo_flags = intel_sdvo->dtd_sdvo_flags; in intel_sdvo_pre_enable()
1601 if (!intel_sdvo_set_input_timing(intel_sdvo, &input_dtd)) in intel_sdvo_pre_enable()
1604 SDVO_NAME(intel_sdvo)); in intel_sdvo_pre_enable()
1615 if (!intel_sdvo_set_clock_rate_mult(intel_sdvo, rate)) in intel_sdvo_pre_enable()
1626 sdvox = intel_de_read(dev_priv, intel_sdvo->sdvo_reg); in intel_sdvo_pre_enable()
1627 if (intel_sdvo->base.port == PORT_B) in intel_sdvo_pre_enable()
1652 intel_sdvo_write_sdvox(intel_sdvo, sdvox); in intel_sdvo_pre_enable()
1659 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); in intel_sdvo_connector_get_hw_state() local
1662 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); in intel_sdvo_connector_get_hw_state()
1689 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_get_hw_state() local
1693 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); in intel_sdvo_get_hw_state()
1695 ret = intel_sdvo_port_enabled(dev_priv, intel_sdvo->sdvo_reg, pipe); in intel_sdvo_get_hw_state()
1705 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_get_config() local
1715 sdvox = intel_de_read(dev_priv, intel_sdvo->sdvo_reg); in intel_sdvo_get_config()
1717 ret = intel_sdvo_get_input_timing(intel_sdvo, &dtd); in intel_sdvo_get_config()
1760 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT, in intel_sdvo_get_config()
1780 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_COLORIMETRY, in intel_sdvo_get_config()
1786 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_AUDIO_STAT, in intel_sdvo_get_config()
1792 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ENCODE, in intel_sdvo_get_config()
1798 intel_sdvo_get_avi_infoframe(intel_sdvo, pipe_config); in intel_sdvo_get_config()
1800 intel_sdvo_get_eld(intel_sdvo, pipe_config); in intel_sdvo_get_config()
1807 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_disable_audio() local
1812 intel_sdvo_set_audio_state(intel_sdvo, 0); in intel_sdvo_disable_audio()
1819 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_enable_audio() local
1825 intel_sdvo_set_audio_state(intel_sdvo, 0); in intel_sdvo_enable_audio()
1827 intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_ELD, in intel_sdvo_enable_audio()
1831 intel_sdvo_set_audio_state(intel_sdvo, SDVO_AUDIO_ELD_VALID | in intel_sdvo_enable_audio()
1841 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_disable_sdvo() local
1845 intel_sdvo_set_active_outputs(intel_sdvo, 0); in intel_disable_sdvo()
1847 intel_sdvo_set_encoder_power_state(intel_sdvo, in intel_disable_sdvo()
1850 temp = intel_de_read(dev_priv, intel_sdvo->sdvo_reg); in intel_disable_sdvo()
1853 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1870 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1873 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1903 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_enable_sdvo() local
1912 temp = intel_de_read(dev_priv, intel_sdvo->sdvo_reg); in intel_enable_sdvo()
1914 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_enable_sdvo()
1919 success = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2); in intel_enable_sdvo()
1929 SDVO_NAME(intel_sdvo)); in intel_enable_sdvo()
1933 intel_sdvo_set_encoder_power_state(intel_sdvo, in intel_enable_sdvo()
1935 intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo_connector->output_flag); in intel_enable_sdvo()
1943 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_mode_valid() local
1964 if (intel_sdvo->pixel_clock_min > clock) in intel_sdvo_mode_valid()
1967 if (intel_sdvo->pixel_clock_max < clock) in intel_sdvo_mode_valid()
1981 static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct intel_sdvo_caps *caps) in intel_sdvo_get_capabilities() argument
1983 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_get_capabilities()
1985 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_get_capabilities()
2019 static u8 intel_sdvo_get_colorimetry_cap(struct intel_sdvo *intel_sdvo) in intel_sdvo_get_colorimetry_cap() argument
2023 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_COLORIMETRY_CAP, in intel_sdvo_get_colorimetry_cap()
2030 static u16 intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo) in intel_sdvo_get_hotplug_support() argument
2032 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_get_hotplug_support()
2045 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, in intel_sdvo_get_hotplug_support()
2054 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_enable_hotplug() local
2056 intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, in intel_sdvo_enable_hotplug()
2057 &intel_sdvo->hotplug_active, 2); in intel_sdvo_enable_hotplug()
2139 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_detect() local
2153 if (!intel_sdvo_set_target_output(intel_sdvo, in intel_sdvo_detect()
2157 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_detect()
2299 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(to_intel_connector(connector)); in intel_sdvo_get_tv_modes() local
2300 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_get_tv_modes()
2323 if (!intel_sdvo_set_target_output(intel_sdvo, intel_sdvo_connector->output_flag)) in intel_sdvo_get_tv_modes()
2327 if (!intel_sdvo_write_cmd(intel_sdvo, in intel_sdvo_get_tv_modes()
2331 if (!intel_sdvo_read_response(intel_sdvo, &reply, 3)) in intel_sdvo_get_tv_modes()
2547 struct intel_sdvo *sdvo = to_sdvo(encoder); in intel_sdvo_encoder_destroy()
2564 intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo, in intel_sdvo_guess_ddc_bus()
2614 intel_sdvo_select_ddc_bus(struct intel_sdvo *sdvo, in intel_sdvo_select_ddc_bus()
2638 intel_sdvo_select_i2c_bus(struct intel_sdvo *sdvo) in intel_sdvo_select_i2c_bus()
2671 intel_sdvo_unselect_i2c_bus(struct intel_sdvo *sdvo) in intel_sdvo_unselect_i2c_bus()
2677 intel_sdvo_is_hdmi_connector(struct intel_sdvo *intel_sdvo) in intel_sdvo_is_hdmi_connector() argument
2679 return intel_sdvo_check_supp_encode(intel_sdvo); in intel_sdvo_is_hdmi_connector()
2683 intel_sdvo_get_target_addr(struct intel_sdvo *sdvo) in intel_sdvo_get_target_addr()
2723 struct intel_sdvo *sdvo, int bit);
2727 struct intel_sdvo *encoder) in intel_sdvo_connector_init()
2762 intel_sdvo_add_hdmi_properties(struct intel_sdvo *intel_sdvo, in intel_sdvo_add_hdmi_properties() argument
2766 if (intel_sdvo->colorimetry_cap & SDVO_COLORIMETRY_RGB220) in intel_sdvo_add_hdmi_properties()
2795 intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, u16 type) in intel_sdvo_dvi_init() argument
2797 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_dvi_init()
2814 if (intel_sdvo_get_hotplug_support(intel_sdvo) & in intel_sdvo_dvi_init()
2816 intel_sdvo->hotplug_active |= intel_sdvo_connector->output_flag; in intel_sdvo_dvi_init()
2831 if (intel_sdvo_is_hdmi_connector(intel_sdvo)) { in intel_sdvo_dvi_init()
2836 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_dvi_init()
2842 intel_sdvo_add_hdmi_properties(intel_sdvo, intel_sdvo_connector); in intel_sdvo_dvi_init()
2848 intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, u16 type) in intel_sdvo_tv_init() argument
2850 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_tv_init()
2851 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_tv_init()
2869 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_tv_init()
2874 if (!intel_sdvo_tv_create_property(intel_sdvo, intel_sdvo_connector, type)) in intel_sdvo_tv_init()
2877 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) in intel_sdvo_tv_init()
2888 intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, u16 type) in intel_sdvo_analog_init() argument
2890 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_analog_init()
2891 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_analog_init()
2911 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_analog_init()
2920 intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, u16 type) in intel_sdvo_lvds_init() argument
2922 struct intel_display *display = to_intel_display(&intel_sdvo->base); in intel_sdvo_lvds_init()
2923 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_lvds_init()
2942 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_lvds_init()
2947 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) in intel_sdvo_lvds_init()
2996 static bool intel_sdvo_output_init(struct intel_sdvo *sdvo, u16 type) in intel_sdvo_output_init()
3011 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo) in intel_sdvo_output_setup() argument
3013 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_output_setup()
3029 flags = intel_sdvo_filter_output_flags(intel_sdvo->caps.output_flags); in intel_sdvo_output_setup()
3034 SDVO_NAME(intel_sdvo), intel_sdvo->caps.output_flags); in intel_sdvo_output_setup()
3044 if (!intel_sdvo_output_init(intel_sdvo, type)) in intel_sdvo_output_setup()
3048 intel_sdvo->base.pipe_mask = ~0; in intel_sdvo_output_setup()
3053 static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo) in intel_sdvo_output_cleanup() argument
3055 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_output_cleanup()
3060 if (intel_attached_encoder(to_intel_connector(connector)) == &intel_sdvo->base) { in intel_sdvo_output_cleanup()
3067 static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, in intel_sdvo_tv_create_property() argument
3071 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_tv_create_property()
3075 if (!intel_sdvo_set_target_output(intel_sdvo, type)) in intel_sdvo_tv_create_property()
3079 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_tv_create_property()
3114 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_MAX_##NAME, &data_value, 4) || \
3115 !intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_##NAME, &response, 2)) \
3131 intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property_tv() argument
3135 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_create_enhance_property_tv()
3136 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_create_enhance_property_tv()
3145 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3150 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3178 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3183 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3226 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_DOT_CRAWL, &response, 2)) in intel_sdvo_create_enhance_property_tv()
3244 intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property_lvds() argument
3248 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_create_enhance_property_lvds()
3259 static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property() argument
3262 struct drm_i915_private *i915 = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_create_enhance_property()
3270 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property()
3279 …return intel_sdvo_create_enhance_property_tv(intel_sdvo, intel_sdvo_connector, enhancements.reply); in intel_sdvo_create_enhance_property()
3281 …return intel_sdvo_create_enhance_property_lvds(intel_sdvo, intel_sdvo_connector, enhancements.repl… in intel_sdvo_create_enhance_property()
3291 struct intel_sdvo *sdvo = ddc->sdvo; in intel_sdvo_ddc_proxy_xfer()
3302 struct intel_sdvo *sdvo = ddc->sdvo; in intel_sdvo_ddc_proxy_func()
3316 struct intel_sdvo *sdvo = ddc->sdvo; in proxy_lock_bus()
3325 struct intel_sdvo *sdvo = ddc->sdvo; in proxy_trylock_bus()
3334 struct intel_sdvo *sdvo = ddc->sdvo; in proxy_unlock_bus()
3347 struct intel_sdvo *sdvo, int ddc_bus) in intel_sdvo_init_ddc_proxy()
3385 struct intel_sdvo *intel_sdvo; in intel_sdvo_init() local
3394 intel_sdvo = kzalloc(sizeof(*intel_sdvo), GFP_KERNEL); in intel_sdvo_init()
3395 if (!intel_sdvo) in intel_sdvo_init()
3399 intel_encoder = &intel_sdvo->base; in intel_sdvo_init()
3408 intel_sdvo->sdvo_reg = sdvo_reg; in intel_sdvo_init()
3409 intel_sdvo->target_addr = intel_sdvo_get_target_addr(intel_sdvo) >> 1; in intel_sdvo_init()
3411 intel_sdvo_select_i2c_bus(intel_sdvo); in intel_sdvo_init()
3417 if (!intel_sdvo_read_byte(intel_sdvo, i, &byte)) { in intel_sdvo_init()
3420 SDVO_NAME(intel_sdvo)); in intel_sdvo_init()
3440 if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) in intel_sdvo_init()
3443 intel_sdvo->colorimetry_cap = in intel_sdvo_init()
3444 intel_sdvo_get_colorimetry_cap(intel_sdvo); in intel_sdvo_init()
3446 for (i = 0; i < ARRAY_SIZE(intel_sdvo->ddc); i++) { in intel_sdvo_init()
3449 ret = intel_sdvo_init_ddc_proxy(&intel_sdvo->ddc[i], in intel_sdvo_init()
3450 intel_sdvo, i + 1); in intel_sdvo_init()
3455 if (!intel_sdvo_output_setup(intel_sdvo)) { in intel_sdvo_init()
3458 SDVO_NAME(intel_sdvo)); in intel_sdvo_init()
3467 if (intel_sdvo->hotplug_active) { in intel_sdvo_init()
3468 if (intel_sdvo->base.port == PORT_B) in intel_sdvo_init()
3482 intel_sdvo->base.cloneable = 0; in intel_sdvo_init()
3485 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_init()
3488 if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo, in intel_sdvo_init()
3489 &intel_sdvo->pixel_clock_min, in intel_sdvo_init()
3490 &intel_sdvo->pixel_clock_max)) in intel_sdvo_init()
3497 SDVO_NAME(intel_sdvo), in intel_sdvo_init()
3498 intel_sdvo->caps.vendor_id, intel_sdvo->caps.device_id, in intel_sdvo_init()
3499 intel_sdvo->caps.device_rev_id, in intel_sdvo_init()
3500 intel_sdvo->pixel_clock_min / 1000, in intel_sdvo_init()
3501 intel_sdvo->pixel_clock_max / 1000, in intel_sdvo_init()
3502 intel_sdvo->caps.sdvo_num_inputs, in intel_sdvo_init()
3504 intel_sdvo->caps.output_flags & in intel_sdvo_init()
3508 intel_sdvo->caps.output_flags & in intel_sdvo_init()
3514 intel_sdvo_output_cleanup(intel_sdvo); in intel_sdvo_init()
3516 intel_sdvo_unselect_i2c_bus(intel_sdvo); in intel_sdvo_init()