Lines Matching refs:intel_sdvo
78 struct intel_sdvo { struct
178 static struct intel_sdvo *to_sdvo(struct intel_encoder *encoder) in to_sdvo()
180 return container_of(encoder, struct intel_sdvo, base); in to_sdvo()
183 static struct intel_sdvo *intel_attached_sdvo(struct drm_connector *connector) in intel_attached_sdvo()
198 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags);
200 intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo,
204 intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo,
212 static void intel_sdvo_write_sdvox(struct intel_sdvo *intel_sdvo, u32 val) in intel_sdvo_write_sdvox() argument
214 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_write_sdvox()
220 I915_WRITE(intel_sdvo->sdvo_reg, val); in intel_sdvo_write_sdvox()
221 POSTING_READ(intel_sdvo->sdvo_reg); in intel_sdvo_write_sdvox()
227 I915_WRITE(intel_sdvo->sdvo_reg, val); in intel_sdvo_write_sdvox()
228 POSTING_READ(intel_sdvo->sdvo_reg); in intel_sdvo_write_sdvox()
233 if (intel_sdvo->port == PORT_B) in intel_sdvo_write_sdvox()
252 static bool intel_sdvo_read_byte(struct intel_sdvo *intel_sdvo, u8 addr, u8 *ch) in intel_sdvo_read_byte() argument
256 .addr = intel_sdvo->slave_addr, in intel_sdvo_read_byte()
262 .addr = intel_sdvo->slave_addr, in intel_sdvo_read_byte()
270 if ((ret = i2c_transfer(intel_sdvo->i2c, msgs, 2)) == 2) in intel_sdvo_read_byte()
412 static void intel_sdvo_debug_write(struct intel_sdvo *intel_sdvo, u8 cmd, in intel_sdvo_debug_write() argument
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
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_audio_state(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_audio_state() argument
950 return intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_AUDIO_STAT, in intel_sdvo_set_audio_state()
954 static bool intel_sdvo_get_hbuf_size(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_hbuf_size() argument
957 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HBUF_INFO, in intel_sdvo_get_hbuf_size()
969 static void intel_sdvo_dump_hdmi_buf(struct intel_sdvo *intel_sdvo)
998 static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_write_infoframe() argument
1006 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1011 if (!intel_sdvo_get_hbuf_size(intel_sdvo, &hbuf_size)) in intel_sdvo_write_infoframe()
1025 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1031 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_write_infoframe()
1036 static ssize_t intel_sdvo_read_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_read_infoframe() argument
1044 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_read_infoframe()
1052 if (!intel_sdvo_set_value(intel_sdvo, in intel_sdvo_read_infoframe()
1057 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_read_infoframe()
1065 if (!intel_sdvo_get_hbuf_size(intel_sdvo, &hbuf_size)) in intel_sdvo_read_infoframe()
1074 if (!intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_GET_HBUF_DATA, NULL, 0)) in intel_sdvo_read_infoframe()
1076 if (!intel_sdvo_read_response(intel_sdvo, &data[i], in intel_sdvo_read_infoframe()
1084 static bool intel_sdvo_compute_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_compute_avi_infoframe() argument
1119 static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_avi_infoframe() argument
1137 return intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF, in intel_sdvo_set_avi_infoframe()
1142 static void intel_sdvo_get_avi_infoframe(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_avi_infoframe() argument
1153 len = intel_sdvo_read_infoframe(intel_sdvo, SDVO_HBUF_INDEX_AVI_IF, in intel_sdvo_get_avi_infoframe()
1176 static bool intel_sdvo_set_tv_format(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_tv_format() argument
1187 return intel_sdvo_set_value(intel_sdvo, in intel_sdvo_set_tv_format()
1193 intel_sdvo_set_output_timings_from_mode(struct intel_sdvo *intel_sdvo, in intel_sdvo_set_output_timings_from_mode() argument
1198 if (!intel_sdvo_set_target_output(intel_sdvo, in intel_sdvo_set_output_timings_from_mode()
1199 intel_sdvo->attached_output)) in intel_sdvo_set_output_timings_from_mode()
1203 if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) in intel_sdvo_set_output_timings_from_mode()
1214 intel_sdvo_get_preferred_input_mode(struct intel_sdvo *intel_sdvo, in intel_sdvo_get_preferred_input_mode() argument
1222 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_get_preferred_input_mode()
1225 if (!intel_sdvo_create_preferred_input_timing(intel_sdvo, in intel_sdvo_get_preferred_input_mode()
1232 if (!intel_sdvo_get_preferred_input_timing(intel_sdvo, in intel_sdvo_get_preferred_input_mode()
1237 intel_sdvo->dtd_sdvo_flags = input_dtd.part2.sdvo_flags; in intel_sdvo_get_preferred_input_mode()
1274 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_compute_config() local
1296 if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, mode)) in intel_sdvo_compute_config()
1299 (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, in intel_sdvo_compute_config()
1305 if (!intel_sdvo_set_output_timings_from_mode(intel_sdvo, in intel_sdvo_compute_config()
1309 (void) intel_sdvo_get_preferred_input_mode(intel_sdvo, in intel_sdvo_compute_config()
1326 pipe_config->has_hdmi_sink = intel_sdvo->has_hdmi_monitor; in intel_sdvo_compute_config()
1329 (intel_sdvo_state->base.force_audio == HDMI_AUDIO_AUTO && intel_sdvo->has_hdmi_audio)) in intel_sdvo_compute_config()
1356 if (!intel_sdvo_compute_avi_infoframe(intel_sdvo, in intel_sdvo_compute_config()
1368 intel_sdvo_set_value(intel_sdvo, SDVO_CMD_SET_##NAME, &val, sizeof(val)); \
1371 static void intel_sdvo_update_props(struct intel_sdvo *intel_sdvo, in intel_sdvo_update_props() argument
1439 struct intel_sdvo *intel_sdvo = to_sdvo(intel_encoder); in intel_sdvo_pre_enable() local
1445 intel_sdvo_update_props(intel_sdvo, sdvo_state); in intel_sdvo_pre_enable()
1454 in_out.in0 = intel_sdvo->attached_output; in intel_sdvo_pre_enable()
1457 intel_sdvo_set_value(intel_sdvo, in intel_sdvo_pre_enable()
1462 if (!intel_sdvo_set_target_output(intel_sdvo, in intel_sdvo_pre_enable()
1463 intel_sdvo->attached_output)) in intel_sdvo_pre_enable()
1472 if (!intel_sdvo_set_output_timing(intel_sdvo, &output_dtd)) in intel_sdvo_pre_enable()
1474 SDVO_NAME(intel_sdvo)); in intel_sdvo_pre_enable()
1477 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_pre_enable()
1481 intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_HDMI); in intel_sdvo_pre_enable()
1482 intel_sdvo_set_colorimetry(intel_sdvo, in intel_sdvo_pre_enable()
1484 intel_sdvo_set_avi_infoframe(intel_sdvo, crtc_state); in intel_sdvo_pre_enable()
1486 intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_DVI); in intel_sdvo_pre_enable()
1489 !intel_sdvo_set_tv_format(intel_sdvo, conn_state)) in intel_sdvo_pre_enable()
1495 input_dtd.part2.sdvo_flags = intel_sdvo->dtd_sdvo_flags; in intel_sdvo_pre_enable()
1496 if (!intel_sdvo_set_input_timing(intel_sdvo, &input_dtd)) in intel_sdvo_pre_enable()
1498 SDVO_NAME(intel_sdvo)); in intel_sdvo_pre_enable()
1508 if (!intel_sdvo_set_clock_rate_mult(intel_sdvo, rate)) in intel_sdvo_pre_enable()
1521 sdvox = I915_READ(intel_sdvo->sdvo_reg); in intel_sdvo_pre_enable()
1522 if (intel_sdvo->port == PORT_B) in intel_sdvo_pre_enable()
1547 intel_sdvo_write_sdvox(intel_sdvo, sdvox); in intel_sdvo_pre_enable()
1554 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(&connector->base); in intel_sdvo_connector_get_hw_state() local
1557 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); in intel_sdvo_connector_get_hw_state()
1584 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_get_hw_state() local
1588 intel_sdvo_get_active_outputs(intel_sdvo, &active_outputs); in intel_sdvo_get_hw_state()
1590 ret = intel_sdvo_port_enabled(dev_priv, intel_sdvo->sdvo_reg, pipe); in intel_sdvo_get_hw_state()
1600 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_get_config() local
1610 sdvox = I915_READ(intel_sdvo->sdvo_reg); in intel_sdvo_get_config()
1612 ret = intel_sdvo_get_input_timing(intel_sdvo, &dtd); in intel_sdvo_get_config()
1655 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_CLOCK_RATE_MULT, in intel_sdvo_get_config()
1677 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_AUDIO_STAT, in intel_sdvo_get_config()
1685 if (intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ENCODE, in intel_sdvo_get_config()
1691 intel_sdvo_get_avi_infoframe(intel_sdvo, pipe_config); in intel_sdvo_get_config()
1694 static void intel_sdvo_disable_audio(struct intel_sdvo *intel_sdvo) in intel_sdvo_disable_audio() argument
1696 intel_sdvo_set_audio_state(intel_sdvo, 0); in intel_sdvo_disable_audio()
1699 static void intel_sdvo_enable_audio(struct intel_sdvo *intel_sdvo, in intel_sdvo_enable_audio() argument
1710 intel_sdvo_set_audio_state(intel_sdvo, 0); in intel_sdvo_enable_audio()
1712 intel_sdvo_write_infoframe(intel_sdvo, SDVO_HBUF_INDEX_ELD, in intel_sdvo_enable_audio()
1716 intel_sdvo_set_audio_state(intel_sdvo, SDVO_AUDIO_ELD_VALID | in intel_sdvo_enable_audio()
1725 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_disable_sdvo() local
1730 intel_sdvo_disable_audio(intel_sdvo); in intel_disable_sdvo()
1732 intel_sdvo_set_active_outputs(intel_sdvo, 0); in intel_disable_sdvo()
1734 intel_sdvo_set_encoder_power_state(intel_sdvo, in intel_disable_sdvo()
1737 temp = I915_READ(intel_sdvo->sdvo_reg); in intel_disable_sdvo()
1740 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1757 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1760 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_disable_sdvo()
1787 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_enable_sdvo() local
1794 temp = I915_READ(intel_sdvo->sdvo_reg); in intel_enable_sdvo()
1796 intel_sdvo_write_sdvox(intel_sdvo, temp); in intel_enable_sdvo()
1801 success = intel_sdvo_get_trained_inputs(intel_sdvo, &input1, &input2); in intel_enable_sdvo()
1810 "sync\n", SDVO_NAME(intel_sdvo)); in intel_enable_sdvo()
1814 intel_sdvo_set_encoder_power_state(intel_sdvo, in intel_enable_sdvo()
1816 intel_sdvo_set_active_outputs(intel_sdvo, intel_sdvo->attached_output); in intel_enable_sdvo()
1819 intel_sdvo_enable_audio(intel_sdvo, pipe_config, conn_state); in intel_enable_sdvo()
1826 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); in intel_sdvo_mode_valid() local
1834 if (intel_sdvo->pixel_clock_min > mode->clock) in intel_sdvo_mode_valid()
1837 if (intel_sdvo->pixel_clock_max < mode->clock) in intel_sdvo_mode_valid()
1857 static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct intel_sdvo_caps *caps) in intel_sdvo_get_capabilities() argument
1860 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_get_capabilities()
1894 static u16 intel_sdvo_get_hotplug_support(struct intel_sdvo *intel_sdvo) in intel_sdvo_get_hotplug_support() argument
1896 struct drm_i915_private *dev_priv = to_i915(intel_sdvo->base.base.dev); in intel_sdvo_get_hotplug_support()
1909 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, in intel_sdvo_get_hotplug_support()
1918 struct intel_sdvo *intel_sdvo = to_sdvo(encoder); in intel_sdvo_enable_hotplug() local
1920 intel_sdvo_write_cmd(intel_sdvo, SDVO_CMD_SET_ACTIVE_HOT_PLUG, in intel_sdvo_enable_hotplug()
1921 &intel_sdvo->hotplug_active, 2); in intel_sdvo_enable_hotplug()
1935 intel_sdvo_multifunc_encoder(struct intel_sdvo *intel_sdvo) in intel_sdvo_multifunc_encoder() argument
1938 return hweight16(intel_sdvo->caps.output_flags) > 1; in intel_sdvo_multifunc_encoder()
1944 struct intel_sdvo *sdvo = intel_attached_sdvo(connector); in intel_sdvo_get_edid()
1962 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); in intel_sdvo_tmds_sink_detect() local
1970 if (edid == NULL && intel_sdvo_multifunc_encoder(intel_sdvo)) { in intel_sdvo_tmds_sink_detect()
1971 u8 ddc, saved_ddc = intel_sdvo->ddc_bus; in intel_sdvo_tmds_sink_detect()
1977 for (ddc = intel_sdvo->ddc_bus >> 1; ddc > 1; ddc >>= 1) { in intel_sdvo_tmds_sink_detect()
1978 intel_sdvo->ddc_bus = ddc; in intel_sdvo_tmds_sink_detect()
1988 intel_sdvo->ddc_bus = saved_ddc; in intel_sdvo_tmds_sink_detect()
2004 intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid); in intel_sdvo_tmds_sink_detect()
2005 intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid); in intel_sdvo_tmds_sink_detect()
2031 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); in intel_sdvo_detect() local
2038 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_detect()
2050 intel_sdvo->attached_output = response; in intel_sdvo_detect()
2052 intel_sdvo->has_hdmi_monitor = false; in intel_sdvo_detect()
2053 intel_sdvo->has_hdmi_audio = false; in intel_sdvo_detect()
2178 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); in intel_sdvo_get_tv_modes() local
2195 if (!intel_sdvo_set_target_output(intel_sdvo, intel_sdvo->attached_output)) in intel_sdvo_get_tv_modes()
2199 if (!intel_sdvo_write_cmd(intel_sdvo, in intel_sdvo_get_tv_modes()
2203 if (!intel_sdvo_read_response(intel_sdvo, &reply, 3)) in intel_sdvo_get_tv_modes()
2218 struct intel_sdvo *intel_sdvo = intel_attached_sdvo(connector); in intel_sdvo_get_lvds_modes() local
2245 intel_ddc_get_modes(connector, &intel_sdvo->ddc); in intel_sdvo_get_lvds_modes()
2382 struct intel_sdvo *sdvo = intel_attached_sdvo(connector); in intel_sdvo_connector_register()
2397 struct intel_sdvo *sdvo = intel_attached_sdvo(connector); in intel_sdvo_connector_unregister()
2462 struct intel_sdvo *intel_sdvo = to_sdvo(to_intel_encoder(encoder)); in intel_sdvo_enc_destroy() local
2464 i2c_del_adapter(&intel_sdvo->ddc); in intel_sdvo_enc_destroy()
2473 intel_sdvo_guess_ddc_bus(struct intel_sdvo *sdvo) in intel_sdvo_guess_ddc_bus()
2523 struct intel_sdvo *sdvo) in intel_sdvo_select_ddc_bus()
2540 struct intel_sdvo *sdvo) in intel_sdvo_select_i2c_bus()
2568 intel_sdvo_unselect_i2c_bus(struct intel_sdvo *sdvo) in intel_sdvo_unselect_i2c_bus()
2574 intel_sdvo_is_hdmi_connector(struct intel_sdvo *intel_sdvo, int device) in intel_sdvo_is_hdmi_connector() argument
2576 return intel_sdvo_check_supp_encode(intel_sdvo); in intel_sdvo_is_hdmi_connector()
2581 struct intel_sdvo *sdvo) in intel_sdvo_get_slave_addr()
2620 struct intel_sdvo *encoder) in intel_sdvo_connector_init()
2647 intel_sdvo_add_hdmi_properties(struct intel_sdvo *intel_sdvo, in intel_sdvo_add_hdmi_properties() argument
2682 intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) in intel_sdvo_dvi_init() argument
2684 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_dvi_init()
2697 intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; in intel_sdvo_dvi_init()
2700 intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; in intel_sdvo_dvi_init()
2706 if (intel_sdvo_get_hotplug_support(intel_sdvo) & in intel_sdvo_dvi_init()
2708 intel_sdvo->hotplug_active |= intel_sdvo_connector->output_flag; in intel_sdvo_dvi_init()
2721 if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) { in intel_sdvo_dvi_init()
2726 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_dvi_init()
2732 intel_sdvo_add_hdmi_properties(intel_sdvo, intel_sdvo_connector); in intel_sdvo_dvi_init()
2738 intel_sdvo_tv_init(struct intel_sdvo *intel_sdvo, int type) in intel_sdvo_tv_init() argument
2740 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_tv_init()
2756 intel_sdvo->controlled_output |= type; in intel_sdvo_tv_init()
2759 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_tv_init()
2764 if (!intel_sdvo_tv_create_property(intel_sdvo, intel_sdvo_connector, type)) in intel_sdvo_tv_init()
2767 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) in intel_sdvo_tv_init()
2778 intel_sdvo_analog_init(struct intel_sdvo *intel_sdvo, int device) in intel_sdvo_analog_init() argument
2780 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_analog_init()
2798 intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; in intel_sdvo_analog_init()
2801 intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; in intel_sdvo_analog_init()
2805 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_analog_init()
2814 intel_sdvo_lvds_init(struct intel_sdvo *intel_sdvo, int device) in intel_sdvo_lvds_init() argument
2816 struct drm_encoder *encoder = &intel_sdvo->base.base; in intel_sdvo_lvds_init()
2834 intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; in intel_sdvo_lvds_init()
2837 intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; in intel_sdvo_lvds_init()
2841 if (intel_sdvo_connector_init(intel_sdvo_connector, intel_sdvo) < 0) { in intel_sdvo_lvds_init()
2846 if (!intel_sdvo_create_enhance_property(intel_sdvo, intel_sdvo_connector)) in intel_sdvo_lvds_init()
2873 intel_sdvo_output_setup(struct intel_sdvo *intel_sdvo, u16 flags) in intel_sdvo_output_setup() argument
2878 if (!intel_sdvo_dvi_init(intel_sdvo, 0)) in intel_sdvo_output_setup()
2882 if (!intel_sdvo_dvi_init(intel_sdvo, 1)) in intel_sdvo_output_setup()
2887 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_SVID0)) in intel_sdvo_output_setup()
2891 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_CVBS0)) in intel_sdvo_output_setup()
2895 if (!intel_sdvo_tv_init(intel_sdvo, SDVO_OUTPUT_YPRPB0)) in intel_sdvo_output_setup()
2899 if (!intel_sdvo_analog_init(intel_sdvo, 0)) in intel_sdvo_output_setup()
2903 if (!intel_sdvo_analog_init(intel_sdvo, 1)) in intel_sdvo_output_setup()
2907 if (!intel_sdvo_lvds_init(intel_sdvo, 0)) in intel_sdvo_output_setup()
2911 if (!intel_sdvo_lvds_init(intel_sdvo, 1)) in intel_sdvo_output_setup()
2917 intel_sdvo->controlled_output = 0; in intel_sdvo_output_setup()
2918 memcpy(bytes, &intel_sdvo->caps.output_flags, 2); in intel_sdvo_output_setup()
2920 SDVO_NAME(intel_sdvo), in intel_sdvo_output_setup()
2924 intel_sdvo->base.crtc_mask = (1 << 0) | (1 << 1) | (1 << 2); in intel_sdvo_output_setup()
2929 static void intel_sdvo_output_cleanup(struct intel_sdvo *intel_sdvo) in intel_sdvo_output_cleanup() argument
2931 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_output_cleanup()
2936 if (intel_attached_encoder(connector) == &intel_sdvo->base) { in intel_sdvo_output_cleanup()
2943 static bool intel_sdvo_tv_create_property(struct intel_sdvo *intel_sdvo, in intel_sdvo_tv_create_property() argument
2947 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_tv_create_property()
2951 if (!intel_sdvo_set_target_output(intel_sdvo, type)) in intel_sdvo_tv_create_property()
2955 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_tv_create_property()
2990 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_MAX_##NAME, &data_value, 4) || \
2991 !intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_##NAME, &response, 2)) \
3007 intel_sdvo_create_enhance_property_tv(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property_tv() argument
3011 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_create_enhance_property_tv()
3020 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3025 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3054 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3059 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property_tv()
3103 if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_DOT_CRAWL, &response, 2)) in intel_sdvo_create_enhance_property_tv()
3121 intel_sdvo_create_enhance_property_lvds(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property_lvds() argument
3125 struct drm_device *dev = intel_sdvo->base.base.dev; in intel_sdvo_create_enhance_property_lvds()
3136 static bool intel_sdvo_create_enhance_property(struct intel_sdvo *intel_sdvo, in intel_sdvo_create_enhance_property() argument
3146 if (!intel_sdvo_get_value(intel_sdvo, in intel_sdvo_create_enhance_property()
3155 …return intel_sdvo_create_enhance_property_tv(intel_sdvo, intel_sdvo_connector, enhancements.reply); in intel_sdvo_create_enhance_property()
3157 …return intel_sdvo_create_enhance_property_lvds(intel_sdvo, intel_sdvo_connector, enhancements.repl… in intel_sdvo_create_enhance_property()
3166 struct intel_sdvo *sdvo = adapter->algo_data; in intel_sdvo_ddc_proxy_xfer()
3176 struct intel_sdvo *sdvo = adapter->algo_data; in intel_sdvo_ddc_proxy_func()
3188 struct intel_sdvo *sdvo = adapter->algo_data; in proxy_lock_bus()
3195 struct intel_sdvo *sdvo = adapter->algo_data; in proxy_trylock_bus()
3202 struct intel_sdvo *sdvo = adapter->algo_data; in proxy_unlock_bus()
3213 intel_sdvo_init_ddc_proxy(struct intel_sdvo *sdvo, in intel_sdvo_init_ddc_proxy()
3242 struct intel_sdvo *intel_sdvo; in intel_sdvo_init() local
3247 intel_sdvo = kzalloc(sizeof(*intel_sdvo), GFP_KERNEL); in intel_sdvo_init()
3248 if (!intel_sdvo) in intel_sdvo_init()
3251 intel_sdvo->sdvo_reg = sdvo_reg; in intel_sdvo_init()
3252 intel_sdvo->port = port; in intel_sdvo_init()
3253 intel_sdvo->slave_addr = in intel_sdvo_init()
3254 intel_sdvo_get_slave_addr(dev_priv, intel_sdvo) >> 1; in intel_sdvo_init()
3255 intel_sdvo_select_i2c_bus(dev_priv, intel_sdvo); in intel_sdvo_init()
3256 if (!intel_sdvo_init_ddc_proxy(intel_sdvo, dev_priv)) in intel_sdvo_init()
3260 intel_encoder = &intel_sdvo->base; in intel_sdvo_init()
3272 if (!intel_sdvo_read_byte(intel_sdvo, i, &byte)) { in intel_sdvo_init()
3274 SDVO_NAME(intel_sdvo)); in intel_sdvo_init()
3292 if (!intel_sdvo_get_capabilities(intel_sdvo, &intel_sdvo->caps)) in intel_sdvo_init()
3295 if (intel_sdvo_output_setup(intel_sdvo, in intel_sdvo_init()
3296 intel_sdvo->caps.output_flags) != true) { in intel_sdvo_init()
3298 SDVO_NAME(intel_sdvo)); in intel_sdvo_init()
3307 if (intel_sdvo->hotplug_active) { in intel_sdvo_init()
3308 if (intel_sdvo->port == PORT_B) in intel_sdvo_init()
3322 intel_sdvo->base.cloneable = 0; in intel_sdvo_init()
3324 intel_sdvo_select_ddc_bus(dev_priv, intel_sdvo); in intel_sdvo_init()
3327 if (!intel_sdvo_set_target_input(intel_sdvo)) in intel_sdvo_init()
3330 if (!intel_sdvo_get_input_pixel_clock_range(intel_sdvo, in intel_sdvo_init()
3331 &intel_sdvo->pixel_clock_min, in intel_sdvo_init()
3332 &intel_sdvo->pixel_clock_max)) in intel_sdvo_init()
3339 SDVO_NAME(intel_sdvo), in intel_sdvo_init()
3340 intel_sdvo->caps.vendor_id, intel_sdvo->caps.device_id, in intel_sdvo_init()
3341 intel_sdvo->caps.device_rev_id, in intel_sdvo_init()
3342 intel_sdvo->pixel_clock_min / 1000, in intel_sdvo_init()
3343 intel_sdvo->pixel_clock_max / 1000, in intel_sdvo_init()
3344 (intel_sdvo->caps.sdvo_inputs_mask & 0x1) ? 'Y' : 'N', in intel_sdvo_init()
3345 (intel_sdvo->caps.sdvo_inputs_mask & 0x2) ? 'Y' : 'N', in intel_sdvo_init()
3347 intel_sdvo->caps.output_flags & in intel_sdvo_init()
3349 intel_sdvo->caps.output_flags & in intel_sdvo_init()
3354 intel_sdvo_output_cleanup(intel_sdvo); in intel_sdvo_init()
3358 i2c_del_adapter(&intel_sdvo->ddc); in intel_sdvo_init()
3360 intel_sdvo_unselect_i2c_bus(intel_sdvo); in intel_sdvo_init()
3361 kfree(intel_sdvo); in intel_sdvo_init()