Lines Matching +full:vga +full:- +full:dvi +full:- +full:encoder

3  * Copyright © 2006-2007 Intel Corporation
53 #define IS_TV(c) (c->output_flag & SDVO_TV_MASK)
54 #define IS_TMDS(c) (c->output_flag & SDVO_TMDS_MASK)
55 #define IS_LVDS(c) (c->output_flag & SDVO_LVDS_MASK)
56 #define IS_TV_OR_LVDS(c) (c->output_flag & (SDVO_TV_MASK | SDVO_LVDS_MASK))
105 * This is set if we're going to treat the device as TV-out.
108 * to decide this for us, the S-Video output on our HDMI+S-Video card
109 * shows up as RGB1 (VGA).
117 * This is set if we treat the device as HDMI, instead of DVI.
134 /* DDC bus used by this SDVO encoder */
159 /* add the property for the SDVO-TV */
177 /* add the property for the SDVO-TV/LVDS */
200 static struct psb_intel_sdvo *to_psb_intel_sdvo(struct drm_encoder *encoder) in to_psb_intel_sdvo() argument
202 return container_of(encoder, struct psb_intel_sdvo, base.base); in to_psb_intel_sdvo()
233 struct drm_device *dev = psb_intel_sdvo->base.base.dev; in psb_intel_sdvo_write_sdvox()
239 if (psb_intel_sdvo->sdvo_reg == SDVOB) in psb_intel_sdvo_write_sdvox()
262 .addr = psb_intel_sdvo->target_addr, in psb_intel_sdvo_read_byte()
268 .addr = psb_intel_sdvo->target_addr, in psb_intel_sdvo_read_byte()
276 if ((ret = i2c_transfer(psb_intel_sdvo->i2c, msgs, 2)) == 2) in psb_intel_sdvo_read_byte()
403 #define SDVO_NAME(svdo) (IS_SDVOB((svdo)->sdvo_reg) ? "SDVOB" : "SDVOC")
408 struct drm_device *dev = psb_intel_sdvo->base.base.dev; in psb_intel_sdvo_debug_write()
413 pos += snprintf(buffer + pos, max_t(int, sizeof(buffer) - pos, 0), args) in psb_intel_sdvo_debug_write()
433 drm_WARN_ON(dev, pos >= sizeof(buffer) - 1); in psb_intel_sdvo_debug_write()
466 msgs[i].addr = psb_intel_sdvo->target_addr; in psb_intel_sdvo_write_cmd()
470 buf[2*i + 0] = SDVO_I2C_ARG_0 - i; in psb_intel_sdvo_write_cmd()
473 msgs[i].addr = psb_intel_sdvo->target_addr; in psb_intel_sdvo_write_cmd()
482 msgs[i+1].addr = psb_intel_sdvo->target_addr; in psb_intel_sdvo_write_cmd()
487 msgs[i+2].addr = psb_intel_sdvo->target_addr; in psb_intel_sdvo_write_cmd()
492 ret = i2c_transfer(psb_intel_sdvo->i2c, msgs, i+3); in psb_intel_sdvo_write_cmd()
509 struct drm_device *dev = psb_intel_sdvo->base.base.dev; in psb_intel_sdvo_read_response()
529 status == SDVO_CMD_STATUS_TARGET_NOT_SPECIFIED) && retry--) { in psb_intel_sdvo_read_response()
538 pos += snprintf(buffer + pos, max_t(int, sizeof(buffer) - pos, 0), args) in psb_intel_sdvo_read_response()
557 drm_WARN_ON(dev, pos >= sizeof(buffer) - 1); in psb_intel_sdvo_read_response()
571 if (mode->clock >= 100000) in psb_intel_sdvo_get_pixel_multiplier()
573 else if (mode->clock >= 50000) in psb_intel_sdvo_get_pixel_multiplier()
694 return psb_intel_sdvo_set_value(psb_intel_sdvo, cmd, &dtd->part1, sizeof(dtd->part1)) && in psb_intel_sdvo_set_timing()
695 psb_intel_sdvo_set_value(psb_intel_sdvo, cmd + 1, &dtd->part2, sizeof(dtd->part2)); in psb_intel_sdvo_set_timing()
726 if (psb_intel_sdvo->is_lvds && in psb_intel_sdvo_create_preferred_input_timing()
727 (psb_intel_sdvo->sdvo_lvds_fixed_mode->hdisplay != width || in psb_intel_sdvo_create_preferred_input_timing()
728 psb_intel_sdvo->sdvo_lvds_fixed_mode->vdisplay != height)) in psb_intel_sdvo_create_preferred_input_timing()
739 BUILD_BUG_ON(sizeof(dtd->part1) != 8); in psb_intel_sdvo_get_preferred_input_timing()
740 BUILD_BUG_ON(sizeof(dtd->part2) != 8); in psb_intel_sdvo_get_preferred_input_timing()
742 &dtd->part1, sizeof(dtd->part1)) && in psb_intel_sdvo_get_preferred_input_timing()
744 &dtd->part2, sizeof(dtd->part2)); in psb_intel_sdvo_get_preferred_input_timing()
759 width = mode->crtc_hdisplay; in psb_intel_sdvo_get_dtd_from_mode()
760 height = mode->crtc_vdisplay; in psb_intel_sdvo_get_dtd_from_mode()
763 h_blank_len = mode->crtc_hblank_end - mode->crtc_hblank_start; in psb_intel_sdvo_get_dtd_from_mode()
764 h_sync_len = mode->crtc_hsync_end - mode->crtc_hsync_start; in psb_intel_sdvo_get_dtd_from_mode()
766 v_blank_len = mode->crtc_vblank_end - mode->crtc_vblank_start; in psb_intel_sdvo_get_dtd_from_mode()
767 v_sync_len = mode->crtc_vsync_end - mode->crtc_vsync_start; in psb_intel_sdvo_get_dtd_from_mode()
769 h_sync_offset = mode->crtc_hsync_start - mode->crtc_hblank_start; in psb_intel_sdvo_get_dtd_from_mode()
770 v_sync_offset = mode->crtc_vsync_start - mode->crtc_vblank_start; in psb_intel_sdvo_get_dtd_from_mode()
772 dtd->part1.clock = mode->clock / 10; in psb_intel_sdvo_get_dtd_from_mode()
773 dtd->part1.h_active = width & 0xff; in psb_intel_sdvo_get_dtd_from_mode()
774 dtd->part1.h_blank = h_blank_len & 0xff; in psb_intel_sdvo_get_dtd_from_mode()
775 dtd->part1.h_high = (((width >> 8) & 0xf) << 4) | in psb_intel_sdvo_get_dtd_from_mode()
777 dtd->part1.v_active = height & 0xff; in psb_intel_sdvo_get_dtd_from_mode()
778 dtd->part1.v_blank = v_blank_len & 0xff; in psb_intel_sdvo_get_dtd_from_mode()
779 dtd->part1.v_high = (((height >> 8) & 0xf) << 4) | in psb_intel_sdvo_get_dtd_from_mode()
782 dtd->part2.h_sync_off = h_sync_offset & 0xff; in psb_intel_sdvo_get_dtd_from_mode()
783 dtd->part2.h_sync_width = h_sync_len & 0xff; in psb_intel_sdvo_get_dtd_from_mode()
784 dtd->part2.v_sync_off_width = (v_sync_offset & 0xf) << 4 | in psb_intel_sdvo_get_dtd_from_mode()
786 dtd->part2.sync_off_width_high = ((h_sync_offset & 0x300) >> 2) | in psb_intel_sdvo_get_dtd_from_mode()
790 dtd->part2.dtd_flags = 0x18; in psb_intel_sdvo_get_dtd_from_mode()
791 if (mode->flags & DRM_MODE_FLAG_PHSYNC) in psb_intel_sdvo_get_dtd_from_mode()
792 dtd->part2.dtd_flags |= 0x2; in psb_intel_sdvo_get_dtd_from_mode()
793 if (mode->flags & DRM_MODE_FLAG_PVSYNC) in psb_intel_sdvo_get_dtd_from_mode()
794 dtd->part2.dtd_flags |= 0x4; in psb_intel_sdvo_get_dtd_from_mode()
796 dtd->part2.sdvo_flags = 0; in psb_intel_sdvo_get_dtd_from_mode()
797 dtd->part2.v_sync_off_high = v_sync_offset & 0xc0; in psb_intel_sdvo_get_dtd_from_mode()
798 dtd->part2.reserved = 0; in psb_intel_sdvo_get_dtd_from_mode()
804 mode->hdisplay = dtd->part1.h_active; in psb_intel_sdvo_get_mode_from_dtd()
805 mode->hdisplay += ((dtd->part1.h_high >> 4) & 0x0f) << 8; in psb_intel_sdvo_get_mode_from_dtd()
806 mode->hsync_start = mode->hdisplay + dtd->part2.h_sync_off; in psb_intel_sdvo_get_mode_from_dtd()
807 mode->hsync_start += (dtd->part2.sync_off_width_high & 0xc0) << 2; in psb_intel_sdvo_get_mode_from_dtd()
808 mode->hsync_end = mode->hsync_start + dtd->part2.h_sync_width; in psb_intel_sdvo_get_mode_from_dtd()
809 mode->hsync_end += (dtd->part2.sync_off_width_high & 0x30) << 4; in psb_intel_sdvo_get_mode_from_dtd()
810 mode->htotal = mode->hdisplay + dtd->part1.h_blank; in psb_intel_sdvo_get_mode_from_dtd()
811 mode->htotal += (dtd->part1.h_high & 0xf) << 8; in psb_intel_sdvo_get_mode_from_dtd()
813 mode->vdisplay = dtd->part1.v_active; in psb_intel_sdvo_get_mode_from_dtd()
814 mode->vdisplay += ((dtd->part1.v_high >> 4) & 0x0f) << 8; in psb_intel_sdvo_get_mode_from_dtd()
815 mode->vsync_start = mode->vdisplay; in psb_intel_sdvo_get_mode_from_dtd()
816 mode->vsync_start += (dtd->part2.v_sync_off_width >> 4) & 0xf; in psb_intel_sdvo_get_mode_from_dtd()
817 mode->vsync_start += (dtd->part2.sync_off_width_high & 0x0c) << 2; in psb_intel_sdvo_get_mode_from_dtd()
818 mode->vsync_start += dtd->part2.v_sync_off_high & 0xc0; in psb_intel_sdvo_get_mode_from_dtd()
819 mode->vsync_end = mode->vsync_start + in psb_intel_sdvo_get_mode_from_dtd()
820 (dtd->part2.v_sync_off_width & 0xf); in psb_intel_sdvo_get_mode_from_dtd()
821 mode->vsync_end += (dtd->part2.sync_off_width_high & 0x3) << 4; in psb_intel_sdvo_get_mode_from_dtd()
822 mode->vtotal = mode->vdisplay + dtd->part1.v_blank; in psb_intel_sdvo_get_mode_from_dtd()
823 mode->vtotal += (dtd->part1.v_high & 0xf) << 8; in psb_intel_sdvo_get_mode_from_dtd()
825 mode->clock = dtd->part1.clock * 10; in psb_intel_sdvo_get_mode_from_dtd()
827 mode->flags &= ~(DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC); in psb_intel_sdvo_get_mode_from_dtd()
828 if (dtd->part2.dtd_flags & 0x2) in psb_intel_sdvo_get_mode_from_dtd()
829 mode->flags |= DRM_MODE_FLAG_PHSYNC; in psb_intel_sdvo_get_mode_from_dtd()
830 if (dtd->part2.dtd_flags & 0x4) in psb_intel_sdvo_get_mode_from_dtd()
831 mode->flags |= DRM_MODE_FLAG_PVSYNC; in psb_intel_sdvo_get_mode_from_dtd()
866 psb_intel_sdvo_get_value(encoder, SDVO_CMD_GET_HBUF_AV_SPLIT, &av_split, 1);
870 psb_intel_sdvo_write_cmd(encoder, SDVO_CMD_SET_HBUF_INDEX,
872 psb_intel_sdvo_write_cmd(encoder, SDVO_CMD_GET_HBUF_INFO, NULL, 0);
873 psb_intel_sdvo_read_response(encoder, &buf_size, 1);
877 psb_intel_sdvo_write_cmd(encoder, SDVO_CMD_GET_HBUF_DATA,
879 psb_intel_sdvo_read_response(encoder, pos, 8);
898 format_map = 1 << psb_intel_sdvo->tv_format_index; in psb_intel_sdvo_set_tv_format()
915 psb_intel_sdvo->attached_output)) in psb_intel_sdvo_set_output_timings_from_mode()
935 mode->clock / 10, in psb_intel_sdvo_set_input_timings_for_mode()
936 mode->hdisplay, in psb_intel_sdvo_set_input_timings_for_mode()
937 mode->vdisplay)) in psb_intel_sdvo_set_input_timings_for_mode()
941 &psb_intel_sdvo->input_dtd)) in psb_intel_sdvo_set_input_timings_for_mode()
944 psb_intel_sdvo_get_mode_from_dtd(adjusted_mode, &psb_intel_sdvo->input_dtd); in psb_intel_sdvo_set_input_timings_for_mode()
950 static bool psb_intel_sdvo_mode_fixup(struct drm_encoder *encoder, in psb_intel_sdvo_mode_fixup() argument
954 struct psb_intel_sdvo *psb_intel_sdvo = to_psb_intel_sdvo(encoder); in psb_intel_sdvo_mode_fixup()
961 if (psb_intel_sdvo->is_tv) { in psb_intel_sdvo_mode_fixup()
968 } else if (psb_intel_sdvo->is_lvds) { in psb_intel_sdvo_mode_fixup()
970 psb_intel_sdvo->sdvo_lvds_fixed_mode)) in psb_intel_sdvo_mode_fixup()
981 psb_intel_sdvo->pixel_multiplier = in psb_intel_sdvo_mode_fixup()
983 adjusted_mode->clock *= psb_intel_sdvo->pixel_multiplier; in psb_intel_sdvo_mode_fixup()
988 static void psb_intel_sdvo_mode_set(struct drm_encoder *encoder, in psb_intel_sdvo_mode_set() argument
992 struct drm_device *dev = encoder->dev; in psb_intel_sdvo_mode_set()
993 struct drm_crtc *crtc = encoder->crtc; in psb_intel_sdvo_mode_set()
995 struct psb_intel_sdvo *psb_intel_sdvo = to_psb_intel_sdvo(encoder); in psb_intel_sdvo_mode_set()
1006 * output. This is only correct if we're a single-input device, in in psb_intel_sdvo_mode_set()
1008 * channel on the motherboard. In a two-input device, the first input in psb_intel_sdvo_mode_set()
1011 in_out.in0 = psb_intel_sdvo->attached_output; in psb_intel_sdvo_mode_set()
1020 psb_intel_sdvo->attached_output)) in psb_intel_sdvo_mode_set()
1026 if (psb_intel_sdvo->is_tv || psb_intel_sdvo->is_lvds) { in psb_intel_sdvo_mode_set()
1027 input_dtd = psb_intel_sdvo->input_dtd; in psb_intel_sdvo_mode_set()
1031 psb_intel_sdvo->attached_output)) in psb_intel_sdvo_mode_set()
1042 if (psb_intel_sdvo->has_hdmi_monitor) { in psb_intel_sdvo_mode_set()
1050 if (psb_intel_sdvo->is_tv && in psb_intel_sdvo_mode_set()
1056 switch (psb_intel_sdvo->pixel_multiplier) { in psb_intel_sdvo_mode_set()
1067 sdvox = REG_READ_AUX(psb_intel_sdvo->sdvo_reg); in psb_intel_sdvo_mode_set()
1069 sdvox = REG_READ(psb_intel_sdvo->sdvo_reg); in psb_intel_sdvo_mode_set()
1071 switch (psb_intel_sdvo->sdvo_reg) { in psb_intel_sdvo_mode_set()
1081 if (gma_crtc->pipe == 1) in psb_intel_sdvo_mode_set()
1083 if (psb_intel_sdvo->has_hdmi_audio) in psb_intel_sdvo_mode_set()
1087 sdvox |= (pixel_multiplier - 1) << SDVO_PORT_MULTIPLY_SHIFT; in psb_intel_sdvo_mode_set()
1095 static void psb_intel_sdvo_dpms(struct drm_encoder *encoder, int mode) in psb_intel_sdvo_dpms() argument
1097 struct drm_device *dev = encoder->dev; in psb_intel_sdvo_dpms()
1098 struct psb_intel_sdvo *psb_intel_sdvo = to_psb_intel_sdvo(encoder); in psb_intel_sdvo_dpms()
1121 temp = REG_READ_AUX(psb_intel_sdvo->sdvo_reg); in psb_intel_sdvo_dpms()
1123 temp = REG_READ(psb_intel_sdvo->sdvo_reg); in psb_intel_sdvo_dpms()
1134 temp = REG_READ_AUX(psb_intel_sdvo->sdvo_reg); in psb_intel_sdvo_dpms()
1136 temp = REG_READ(psb_intel_sdvo->sdvo_reg); in psb_intel_sdvo_dpms()
1156 psb_intel_sdvo_set_active_outputs(psb_intel_sdvo, psb_intel_sdvo->attached_output); in psb_intel_sdvo_dpms()
1166 if (mode->flags & DRM_MODE_FLAG_DBLSCAN) in psb_intel_sdvo_mode_valid()
1169 if (psb_intel_sdvo->pixel_clock_min > mode->clock) in psb_intel_sdvo_mode_valid()
1172 if (psb_intel_sdvo->pixel_clock_max < mode->clock) in psb_intel_sdvo_mode_valid()
1175 if (psb_intel_sdvo->is_lvds) { in psb_intel_sdvo_mode_valid()
1176 if (mode->hdisplay > psb_intel_sdvo->sdvo_lvds_fixed_mode->hdisplay) in psb_intel_sdvo_mode_valid()
1179 if (mode->vdisplay > psb_intel_sdvo->sdvo_lvds_fixed_mode->vdisplay) in psb_intel_sdvo_mode_valid()
1207 caps->vendor_id, in psb_intel_sdvo_get_capabilities()
1208 caps->device_id, in psb_intel_sdvo_get_capabilities()
1209 caps->device_rev_id, in psb_intel_sdvo_get_capabilities()
1210 caps->sdvo_version_major, in psb_intel_sdvo_get_capabilities()
1211 caps->sdvo_version_minor, in psb_intel_sdvo_get_capabilities()
1212 caps->sdvo_inputs_mask, in psb_intel_sdvo_get_capabilities()
1213 caps->smooth_scaling, in psb_intel_sdvo_get_capabilities()
1214 caps->sharp_scaling, in psb_intel_sdvo_get_capabilities()
1215 caps->up_scaling, in psb_intel_sdvo_get_capabilities()
1216 caps->down_scaling, in psb_intel_sdvo_get_capabilities()
1217 caps->stall_support, in psb_intel_sdvo_get_capabilities()
1218 caps->output_flags); in psb_intel_sdvo_get_capabilities()
1227 int caps = psb_intel_sdvo->caps.output_flags & 0xf; in psb_intel_sdvo_multifunc_encoder()
1228 return caps & -caps; in psb_intel_sdvo_multifunc_encoder()
1235 return drm_get_edid(connector, &sdvo->ddc); in psb_intel_sdvo_get_edid()
1238 /* Mac mini hack -- use the same DDC as the analog connector */
1242 struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); in psb_intel_sdvo_get_analog_edid()
1245 &dev_priv->gmbus[dev_priv->crt_ddc_pin].adapter); in psb_intel_sdvo_get_analog_edid()
1258 u8 ddc, saved_ddc = psb_intel_sdvo->ddc_bus; in psb_intel_sdvo_hdmi_sink_detect()
1264 for (ddc = psb_intel_sdvo->ddc_bus >> 1; ddc > 1; ddc >>= 1) { in psb_intel_sdvo_hdmi_sink_detect()
1265 psb_intel_sdvo->ddc_bus = ddc; in psb_intel_sdvo_hdmi_sink_detect()
1275 psb_intel_sdvo->ddc_bus = saved_ddc; in psb_intel_sdvo_hdmi_sink_detect()
1279 * When there is no edid and no monitor is connected with VGA in psb_intel_sdvo_hdmi_sink_detect()
1280 * port, try to use the CRT ddc to read the EDID for DVI-connector. in psb_intel_sdvo_hdmi_sink_detect()
1288 if (edid->input & DRM_EDID_INPUT_DIGITAL) { in psb_intel_sdvo_hdmi_sink_detect()
1290 if (psb_intel_sdvo->is_hdmi) { in psb_intel_sdvo_hdmi_sink_detect()
1291 psb_intel_sdvo->has_hdmi_monitor = drm_detect_hdmi_monitor(edid); in psb_intel_sdvo_hdmi_sink_detect()
1292 psb_intel_sdvo->has_hdmi_audio = drm_detect_monitor_audio(edid); in psb_intel_sdvo_hdmi_sink_detect()
1301 if (psb_intel_sdvo_connector->force_audio) in psb_intel_sdvo_hdmi_sink_detect()
1302 psb_intel_sdvo->has_hdmi_audio = psb_intel_sdvo_connector->force_audio > 0; in psb_intel_sdvo_hdmi_sink_detect()
1321 if (psb_intel_sdvo->caps.output_flags & in psb_intel_sdvo_detect()
1330 psb_intel_sdvo_connector->output_flag); in psb_intel_sdvo_detect()
1335 psb_intel_sdvo->attached_output = response; in psb_intel_sdvo_detect()
1337 psb_intel_sdvo->has_hdmi_monitor = false; in psb_intel_sdvo_detect()
1338 psb_intel_sdvo->has_hdmi_audio = false; in psb_intel_sdvo_detect()
1340 if ((psb_intel_sdvo_connector->output_flag & response) == 0) in psb_intel_sdvo_detect()
1352 if (edid->input & DRM_EDID_INPUT_DIGITAL) in psb_intel_sdvo_detect()
1361 /* May update encoder flag for like clock for SDVO TV, etc.*/ in psb_intel_sdvo_detect()
1363 psb_intel_sdvo->is_tv = false; in psb_intel_sdvo_detect()
1364 psb_intel_sdvo->is_lvds = false; in psb_intel_sdvo_detect()
1365 psb_intel_sdvo->base.needs_tv_clock = false; in psb_intel_sdvo_detect()
1368 psb_intel_sdvo->is_tv = true; in psb_intel_sdvo_detect()
1369 psb_intel_sdvo->base.needs_tv_clock = true; in psb_intel_sdvo_detect()
1372 psb_intel_sdvo->is_lvds = psb_intel_sdvo->sdvo_lvds_fixed_mode != NULL; in psb_intel_sdvo_detect()
1386 * Mac mini hack. On this device, the DVI-I connector shares one DDC in psb_intel_sdvo_get_ddc_modes()
1396 bool monitor_is_digital = !!(edid->input & DRM_EDID_INPUT_DIGITAL); in psb_intel_sdvo_get_ddc_modes()
1483 format_map = 1 << psb_intel_sdvo->tv_format_index; in psb_intel_sdvo_get_tv_modes()
1487 if (!psb_intel_sdvo_set_target_output(psb_intel_sdvo, psb_intel_sdvo->attached_output)) in psb_intel_sdvo_get_tv_modes()
1501 nmode = drm_mode_duplicate(connector->dev, in psb_intel_sdvo_get_tv_modes()
1511 struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); in psb_intel_sdvo_get_lvds_modes()
1519 psb_intel_ddc_get_modes(connector, psb_intel_sdvo->i2c); in psb_intel_sdvo_get_lvds_modes()
1520 if (list_empty(&connector->probed_modes) == false) in psb_intel_sdvo_get_lvds_modes()
1524 if (dev_priv->sdvo_lvds_vbt_mode != NULL) { in psb_intel_sdvo_get_lvds_modes()
1525 newmode = drm_mode_duplicate(connector->dev, in psb_intel_sdvo_get_lvds_modes()
1526 dev_priv->sdvo_lvds_vbt_mode); in psb_intel_sdvo_get_lvds_modes()
1529 newmode->type = (DRM_MODE_TYPE_PREFERRED | in psb_intel_sdvo_get_lvds_modes()
1536 list_for_each_entry(newmode, &connector->probed_modes, head) { in psb_intel_sdvo_get_lvds_modes()
1537 if (newmode->type & DRM_MODE_TYPE_PREFERRED) { in psb_intel_sdvo_get_lvds_modes()
1538 psb_intel_sdvo->sdvo_lvds_fixed_mode = in psb_intel_sdvo_get_lvds_modes()
1539 drm_mode_duplicate(connector->dev, newmode); in psb_intel_sdvo_get_lvds_modes()
1541 drm_mode_set_crtcinfo(psb_intel_sdvo->sdvo_lvds_fixed_mode, in psb_intel_sdvo_get_lvds_modes()
1544 psb_intel_sdvo->is_lvds = true; in psb_intel_sdvo_get_lvds_modes()
1562 return !list_empty(&connector->probed_modes); in psb_intel_sdvo_get_modes()
1579 if (!psb_intel_sdvo->is_hdmi) in psb_intel_sdvo_detect_hdmi_audio()
1583 if (edid != NULL && edid->input & DRM_EDID_INPUT_DIGITAL) in psb_intel_sdvo_detect_hdmi_audio()
1596 struct drm_psb_private *dev_priv = to_drm_psb_private(connector->dev); in psb_intel_sdvo_set_property()
1601 ret = drm_object_property_set_value(&connector->base, property, val); in psb_intel_sdvo_set_property()
1605 if (property == dev_priv->force_audio_property) { in psb_intel_sdvo_set_property()
1609 if (i == psb_intel_sdvo_connector->force_audio) in psb_intel_sdvo_set_property()
1612 psb_intel_sdvo_connector->force_audio = i; in psb_intel_sdvo_set_property()
1619 if (has_audio == psb_intel_sdvo->has_hdmi_audio) in psb_intel_sdvo_set_property()
1622 psb_intel_sdvo->has_hdmi_audio = has_audio; in psb_intel_sdvo_set_property()
1626 if (property == dev_priv->broadcast_rgb_property) { in psb_intel_sdvo_set_property()
1627 if (val == !!psb_intel_sdvo->color_range) in psb_intel_sdvo_set_property()
1630 psb_intel_sdvo->color_range = val ? SDVO_COLOR_RANGE_16_235 : 0; in psb_intel_sdvo_set_property()
1635 if (psb_intel_sdvo_connector->name == property) { \ in psb_intel_sdvo_set_property()
1636 if (psb_intel_sdvo_connector->cur_##name == temp_value) return 0; \ in psb_intel_sdvo_set_property()
1637 if (psb_intel_sdvo_connector->max_##name < temp_value) return -EINVAL; \ in psb_intel_sdvo_set_property()
1639 psb_intel_sdvo_connector->cur_##name = temp_value; \ in psb_intel_sdvo_set_property()
1643 if (property == psb_intel_sdvo_connector->tv_format) { in psb_intel_sdvo_set_property()
1645 return -EINVAL; in psb_intel_sdvo_set_property()
1647 if (psb_intel_sdvo->tv_format_index == in psb_intel_sdvo_set_property()
1648 psb_intel_sdvo_connector->tv_format_supported[val]) in psb_intel_sdvo_set_property()
1651 psb_intel_sdvo->tv_format_index = psb_intel_sdvo_connector->tv_format_supported[val]; in psb_intel_sdvo_set_property()
1655 if (psb_intel_sdvo_connector->left == property) { in psb_intel_sdvo_set_property()
1656 drm_object_property_set_value(&connector->base, in psb_intel_sdvo_set_property()
1657 psb_intel_sdvo_connector->right, val); in psb_intel_sdvo_set_property()
1658 if (psb_intel_sdvo_connector->left_margin == temp_value) in psb_intel_sdvo_set_property()
1661 psb_intel_sdvo_connector->left_margin = temp_value; in psb_intel_sdvo_set_property()
1662 psb_intel_sdvo_connector->right_margin = temp_value; in psb_intel_sdvo_set_property()
1663 temp_value = psb_intel_sdvo_connector->max_hscan - in psb_intel_sdvo_set_property()
1664 psb_intel_sdvo_connector->left_margin; in psb_intel_sdvo_set_property()
1667 } else if (psb_intel_sdvo_connector->right == property) { in psb_intel_sdvo_set_property()
1668 drm_object_property_set_value(&connector->base, in psb_intel_sdvo_set_property()
1669 psb_intel_sdvo_connector->left, val); in psb_intel_sdvo_set_property()
1670 if (psb_intel_sdvo_connector->right_margin == temp_value) in psb_intel_sdvo_set_property()
1673 psb_intel_sdvo_connector->left_margin = temp_value; in psb_intel_sdvo_set_property()
1674 psb_intel_sdvo_connector->right_margin = temp_value; in psb_intel_sdvo_set_property()
1675 temp_value = psb_intel_sdvo_connector->max_hscan - in psb_intel_sdvo_set_property()
1676 psb_intel_sdvo_connector->left_margin; in psb_intel_sdvo_set_property()
1679 } else if (psb_intel_sdvo_connector->top == property) { in psb_intel_sdvo_set_property()
1680 drm_object_property_set_value(&connector->base, in psb_intel_sdvo_set_property()
1681 psb_intel_sdvo_connector->bottom, val); in psb_intel_sdvo_set_property()
1682 if (psb_intel_sdvo_connector->top_margin == temp_value) in psb_intel_sdvo_set_property()
1685 psb_intel_sdvo_connector->top_margin = temp_value; in psb_intel_sdvo_set_property()
1686 psb_intel_sdvo_connector->bottom_margin = temp_value; in psb_intel_sdvo_set_property()
1687 temp_value = psb_intel_sdvo_connector->max_vscan - in psb_intel_sdvo_set_property()
1688 psb_intel_sdvo_connector->top_margin; in psb_intel_sdvo_set_property()
1691 } else if (psb_intel_sdvo_connector->bottom == property) { in psb_intel_sdvo_set_property()
1692 drm_object_property_set_value(&connector->base, in psb_intel_sdvo_set_property()
1693 psb_intel_sdvo_connector->top, val); in psb_intel_sdvo_set_property()
1694 if (psb_intel_sdvo_connector->bottom_margin == temp_value) in psb_intel_sdvo_set_property()
1697 psb_intel_sdvo_connector->top_margin = temp_value; in psb_intel_sdvo_set_property()
1698 psb_intel_sdvo_connector->bottom_margin = temp_value; in psb_intel_sdvo_set_property()
1699 temp_value = psb_intel_sdvo_connector->max_vscan - in psb_intel_sdvo_set_property()
1700 psb_intel_sdvo_connector->top_margin; in psb_intel_sdvo_set_property()
1719 return -EINVAL; /* unknown property */ in psb_intel_sdvo_set_property()
1723 return -EIO; in psb_intel_sdvo_set_property()
1727 if (psb_intel_sdvo->base.base.crtc) { in psb_intel_sdvo_set_property()
1728 struct drm_crtc *crtc = psb_intel_sdvo->base.base.crtc; in psb_intel_sdvo_set_property()
1729 drm_crtc_helper_set_mode(crtc, &crtc->mode, crtc->x, in psb_intel_sdvo_set_property()
1730 crtc->y, crtc->primary->fb); in psb_intel_sdvo_set_property()
1739 struct drm_device *dev = connector->dev; in psb_intel_sdvo_save()
1741 struct psb_intel_sdvo *sdvo = to_psb_intel_sdvo(&gma_encoder->base); in psb_intel_sdvo_save()
1743 sdvo->saveSDVO = REG_READ(sdvo->sdvo_reg); in psb_intel_sdvo_save()
1748 struct drm_device *dev = connector->dev; in psb_intel_sdvo_restore()
1749 struct drm_encoder *encoder = &gma_attached_encoder(connector)->base; in psb_intel_sdvo_restore() local
1750 struct psb_intel_sdvo *sdvo = to_psb_intel_sdvo(encoder); in psb_intel_sdvo_restore()
1751 struct drm_crtc *crtc = encoder->crtc; in psb_intel_sdvo_restore()
1753 REG_WRITE(sdvo->sdvo_reg, sdvo->saveSDVO); in psb_intel_sdvo_restore()
1757 if (connector->status == connector_status_connected) in psb_intel_sdvo_restore()
1758 drm_crtc_helper_set_mode(crtc, &crtc->mode, crtc->x, crtc->y, in psb_intel_sdvo_restore()
1784 static void psb_intel_sdvo_enc_destroy(struct drm_encoder *encoder) in psb_intel_sdvo_enc_destroy() argument
1786 struct psb_intel_sdvo *psb_intel_sdvo = to_psb_intel_sdvo(encoder); in psb_intel_sdvo_enc_destroy()
1788 if (psb_intel_sdvo->sdvo_lvds_fixed_mode != NULL) in psb_intel_sdvo_enc_destroy()
1789 drm_mode_destroy(encoder->dev, in psb_intel_sdvo_enc_destroy()
1790 psb_intel_sdvo->sdvo_lvds_fixed_mode); in psb_intel_sdvo_enc_destroy()
1792 i2c_del_adapter(&psb_intel_sdvo->ddc); in psb_intel_sdvo_enc_destroy()
1793 gma_encoder_destroy(encoder); in psb_intel_sdvo_enc_destroy()
1807 sdvo->ddc_bus = 2; in psb_intel_sdvo_guess_ddc_bus()
1816 switch (sdvo->controlled_output) { in psb_intel_sdvo_guess_ddc_bus()
1833 mask &= sdvo->caps.output_flags; in psb_intel_sdvo_guess_ddc_bus()
1840 sdvo->ddc_bus = 1 << num_bits; in psb_intel_sdvo_guess_ddc_bus()
1858 mapping = &(dev_priv->sdvo_mappings[0]); in psb_intel_sdvo_select_ddc_bus()
1860 mapping = &(dev_priv->sdvo_mappings[1]); in psb_intel_sdvo_select_ddc_bus()
1862 if (mapping->initialized) in psb_intel_sdvo_select_ddc_bus()
1863 sdvo->ddc_bus = 1 << ((mapping->ddc_pin & 0xf0) >> 4); in psb_intel_sdvo_select_ddc_bus()
1876 mapping = &dev_priv->sdvo_mappings[0]; in psb_intel_sdvo_select_i2c_bus()
1878 mapping = &dev_priv->sdvo_mappings[1]; in psb_intel_sdvo_select_i2c_bus()
1882 if (mapping->initialized) { in psb_intel_sdvo_select_i2c_bus()
1883 pin = mapping->i2c_pin; in psb_intel_sdvo_select_i2c_bus()
1884 speed = mapping->i2c_speed; in psb_intel_sdvo_select_i2c_bus()
1888 sdvo->i2c = &dev_priv->gmbus[pin].adapter; in psb_intel_sdvo_select_i2c_bus()
1889 gma_intel_gmbus_set_speed(sdvo->i2c, speed); in psb_intel_sdvo_select_i2c_bus()
1890 gma_intel_gmbus_force_bit(sdvo->i2c, true); in psb_intel_sdvo_select_i2c_bus()
1892 sdvo->i2c = &dev_priv->gmbus[GMBUS_PORT_DPB].adapter; in psb_intel_sdvo_select_i2c_bus()
1908 my_mapping = &dev_priv->sdvo_mappings[0]; in psb_intel_sdvo_get_target_addr()
1909 other_mapping = &dev_priv->sdvo_mappings[1]; in psb_intel_sdvo_get_target_addr()
1911 my_mapping = &dev_priv->sdvo_mappings[1]; in psb_intel_sdvo_get_target_addr()
1912 other_mapping = &dev_priv->sdvo_mappings[0]; in psb_intel_sdvo_get_target_addr()
1916 if (my_mapping->target_addr) in psb_intel_sdvo_get_target_addr()
1917 return my_mapping->target_addr; in psb_intel_sdvo_get_target_addr()
1922 if (other_mapping->target_addr) { in psb_intel_sdvo_get_target_addr()
1923 if (other_mapping->target_addr == 0x70) in psb_intel_sdvo_get_target_addr()
1940 struct psb_intel_sdvo *encoder) in psb_intel_sdvo_connector_init() argument
1942 drm_connector_init(encoder->base.base.dev, in psb_intel_sdvo_connector_init()
1943 &connector->base.base, in psb_intel_sdvo_connector_init()
1945 connector->base.base.connector_type); in psb_intel_sdvo_connector_init()
1947 drm_connector_helper_add(&connector->base.base, in psb_intel_sdvo_connector_init()
1950 connector->base.base.interlace_allowed = 0; in psb_intel_sdvo_connector_init()
1951 connector->base.base.doublescan_allowed = 0; in psb_intel_sdvo_connector_init()
1952 connector->base.base.display_info.subpixel_order = SubPixelHorizontalRGB; in psb_intel_sdvo_connector_init()
1954 connector->base.save = psb_intel_sdvo_save; in psb_intel_sdvo_connector_init()
1955 connector->base.restore = psb_intel_sdvo_restore; in psb_intel_sdvo_connector_init()
1957 gma_connector_attach_encoder(&connector->base, &encoder->base); in psb_intel_sdvo_connector_init()
1964 struct drm_device *dev = connector->base.base.dev; in psb_intel_sdvo_add_hdmi_properties()
1966 intel_attach_force_audio_property(&connector->base.base); in psb_intel_sdvo_add_hdmi_properties()
1967 intel_attach_broadcast_rgb_property(&connector->base.base); in psb_intel_sdvo_add_hdmi_properties()
1974 struct drm_encoder *encoder = &psb_intel_sdvo->base.base; in psb_intel_sdvo_dvi_init() local
1984 psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS0; in psb_intel_sdvo_dvi_init()
1985 psb_intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS0; in psb_intel_sdvo_dvi_init()
1987 psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_TMDS1; in psb_intel_sdvo_dvi_init()
1988 psb_intel_sdvo_connector->output_flag = SDVO_OUTPUT_TMDS1; in psb_intel_sdvo_dvi_init()
1991 intel_connector = &psb_intel_sdvo_connector->base; in psb_intel_sdvo_dvi_init()
1992 connector = &intel_connector->base; in psb_intel_sdvo_dvi_init()
1993 // connector->polled = DRM_CONNECTOR_POLL_CONNECT | DRM_CONNECTOR_POLL_DISCONNECT; in psb_intel_sdvo_dvi_init()
1994 encoder->encoder_type = DRM_MODE_ENCODER_TMDS; in psb_intel_sdvo_dvi_init()
1995 connector->connector_type = DRM_MODE_CONNECTOR_DVID; in psb_intel_sdvo_dvi_init()
1998 connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; in psb_intel_sdvo_dvi_init()
1999 psb_intel_sdvo->is_hdmi = true; in psb_intel_sdvo_dvi_init()
2001 psb_intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | in psb_intel_sdvo_dvi_init()
2005 if (psb_intel_sdvo->is_hdmi) in psb_intel_sdvo_dvi_init()
2014 struct drm_encoder *encoder = &psb_intel_sdvo->base.base; in psb_intel_sdvo_tv_init() local
2023 intel_connector = &psb_intel_sdvo_connector->base; in psb_intel_sdvo_tv_init()
2024 connector = &intel_connector->base; in psb_intel_sdvo_tv_init()
2025 encoder->encoder_type = DRM_MODE_ENCODER_TVDAC; in psb_intel_sdvo_tv_init()
2026 connector->connector_type = DRM_MODE_CONNECTOR_SVIDEO; in psb_intel_sdvo_tv_init()
2028 psb_intel_sdvo->controlled_output |= type; in psb_intel_sdvo_tv_init()
2029 psb_intel_sdvo_connector->output_flag = type; in psb_intel_sdvo_tv_init()
2031 psb_intel_sdvo->is_tv = true; in psb_intel_sdvo_tv_init()
2032 psb_intel_sdvo->base.needs_tv_clock = true; in psb_intel_sdvo_tv_init()
2033 psb_intel_sdvo->base.clone_mask = 1 << INTEL_SDVO_TV_CLONE_BIT; in psb_intel_sdvo_tv_init()
2053 struct drm_encoder *encoder = &psb_intel_sdvo->base.base; in psb_intel_sdvo_analog_init() local
2062 intel_connector = &psb_intel_sdvo_connector->base; in psb_intel_sdvo_analog_init()
2063 connector = &intel_connector->base; in psb_intel_sdvo_analog_init()
2064 connector->polled = DRM_CONNECTOR_POLL_CONNECT; in psb_intel_sdvo_analog_init()
2065 encoder->encoder_type = DRM_MODE_ENCODER_DAC; in psb_intel_sdvo_analog_init()
2066 connector->connector_type = DRM_MODE_CONNECTOR_VGA; in psb_intel_sdvo_analog_init()
2069 psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB0; in psb_intel_sdvo_analog_init()
2070 psb_intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB0; in psb_intel_sdvo_analog_init()
2072 psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_RGB1; in psb_intel_sdvo_analog_init()
2073 psb_intel_sdvo_connector->output_flag = SDVO_OUTPUT_RGB1; in psb_intel_sdvo_analog_init()
2076 psb_intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | in psb_intel_sdvo_analog_init()
2087 struct drm_encoder *encoder = &psb_intel_sdvo->base.base; in psb_intel_sdvo_lvds_init() local
2096 intel_connector = &psb_intel_sdvo_connector->base; in psb_intel_sdvo_lvds_init()
2097 connector = &intel_connector->base; in psb_intel_sdvo_lvds_init()
2098 encoder->encoder_type = DRM_MODE_ENCODER_LVDS; in psb_intel_sdvo_lvds_init()
2099 connector->connector_type = DRM_MODE_CONNECTOR_LVDS; in psb_intel_sdvo_lvds_init()
2102 psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS0; in psb_intel_sdvo_lvds_init()
2103 psb_intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS0; in psb_intel_sdvo_lvds_init()
2105 psb_intel_sdvo->controlled_output |= SDVO_OUTPUT_LVDS1; in psb_intel_sdvo_lvds_init()
2106 psb_intel_sdvo_connector->output_flag = SDVO_OUTPUT_LVDS1; in psb_intel_sdvo_lvds_init()
2109 psb_intel_sdvo->base.clone_mask = ((1 << INTEL_ANALOG_CLONE_BIT) | in psb_intel_sdvo_lvds_init()
2126 psb_intel_sdvo->is_tv = false; in psb_intel_sdvo_output_setup()
2127 psb_intel_sdvo->base.needs_tv_clock = false; in psb_intel_sdvo_output_setup()
2128 psb_intel_sdvo->is_lvds = false; in psb_intel_sdvo_output_setup()
2168 psb_intel_sdvo->controlled_output = 0; in psb_intel_sdvo_output_setup()
2169 memcpy(bytes, &psb_intel_sdvo->caps.output_flags, 2); in psb_intel_sdvo_output_setup()
2175 psb_intel_sdvo->base.crtc_mask = (1 << 0) | (1 << 1); in psb_intel_sdvo_output_setup()
2184 struct drm_device *dev = psb_intel_sdvo->base.base.dev; in psb_intel_sdvo_tv_create_property()
2202 psb_intel_sdvo_connector->format_supported_num = 0; in psb_intel_sdvo_tv_create_property()
2205 …psb_intel_sdvo_connector->tv_format_supported[psb_intel_sdvo_connector->format_supported_num++] = … in psb_intel_sdvo_tv_create_property()
2208 psb_intel_sdvo_connector->tv_format = in psb_intel_sdvo_tv_create_property()
2210 "mode", psb_intel_sdvo_connector->format_supported_num); in psb_intel_sdvo_tv_create_property()
2211 if (!psb_intel_sdvo_connector->tv_format) in psb_intel_sdvo_tv_create_property()
2214 for (i = 0; i < psb_intel_sdvo_connector->format_supported_num; i++) in psb_intel_sdvo_tv_create_property()
2216 psb_intel_sdvo_connector->tv_format, in psb_intel_sdvo_tv_create_property()
2217 i, tv_format_names[psb_intel_sdvo_connector->tv_format_supported[i]]); in psb_intel_sdvo_tv_create_property()
2219 psb_intel_sdvo->tv_format_index = psb_intel_sdvo_connector->tv_format_supported[0]; in psb_intel_sdvo_tv_create_property()
2220 drm_object_attach_property(&psb_intel_sdvo_connector->base.base.base, in psb_intel_sdvo_tv_create_property()
2221 psb_intel_sdvo_connector->tv_format, 0); in psb_intel_sdvo_tv_create_property()
2231 psb_intel_sdvo_connector->max_##name = data_value[0]; \
2232 psb_intel_sdvo_connector->cur_##name = response; \
2233 psb_intel_sdvo_connector->name = \
2235 if (!psb_intel_sdvo_connector->name) return false; \
2236 drm_object_attach_property(&connector->base, \
2237 psb_intel_sdvo_connector->name, \
2238 psb_intel_sdvo_connector->cur_##name); \
2249 struct drm_device *dev = psb_intel_sdvo->base.base.dev; in psb_intel_sdvo_create_enhance_property_tv()
2250 struct drm_connector *connector = &psb_intel_sdvo_connector->base.base; in psb_intel_sdvo_create_enhance_property_tv()
2265 psb_intel_sdvo_connector->max_hscan = data_value[0]; in psb_intel_sdvo_create_enhance_property_tv()
2266 psb_intel_sdvo_connector->left_margin = data_value[0] - response; in psb_intel_sdvo_create_enhance_property_tv()
2267 psb_intel_sdvo_connector->right_margin = psb_intel_sdvo_connector->left_margin; in psb_intel_sdvo_create_enhance_property_tv()
2268 psb_intel_sdvo_connector->left = in psb_intel_sdvo_create_enhance_property_tv()
2270 if (!psb_intel_sdvo_connector->left) in psb_intel_sdvo_create_enhance_property_tv()
2273 drm_object_attach_property(&connector->base, in psb_intel_sdvo_create_enhance_property_tv()
2274 psb_intel_sdvo_connector->left, in psb_intel_sdvo_create_enhance_property_tv()
2275 psb_intel_sdvo_connector->left_margin); in psb_intel_sdvo_create_enhance_property_tv()
2277 psb_intel_sdvo_connector->right = in psb_intel_sdvo_create_enhance_property_tv()
2279 if (!psb_intel_sdvo_connector->right) in psb_intel_sdvo_create_enhance_property_tv()
2282 drm_object_attach_property(&connector->base, in psb_intel_sdvo_create_enhance_property_tv()
2283 psb_intel_sdvo_connector->right, in psb_intel_sdvo_create_enhance_property_tv()
2284 psb_intel_sdvo_connector->right_margin); in psb_intel_sdvo_create_enhance_property_tv()
2301 psb_intel_sdvo_connector->max_vscan = data_value[0]; in psb_intel_sdvo_create_enhance_property_tv()
2302 psb_intel_sdvo_connector->top_margin = data_value[0] - response; in psb_intel_sdvo_create_enhance_property_tv()
2303 psb_intel_sdvo_connector->bottom_margin = psb_intel_sdvo_connector->top_margin; in psb_intel_sdvo_create_enhance_property_tv()
2304 psb_intel_sdvo_connector->top = in psb_intel_sdvo_create_enhance_property_tv()
2306 if (!psb_intel_sdvo_connector->top) in psb_intel_sdvo_create_enhance_property_tv()
2309 drm_object_attach_property(&connector->base, in psb_intel_sdvo_create_enhance_property_tv()
2310 psb_intel_sdvo_connector->top, in psb_intel_sdvo_create_enhance_property_tv()
2311 psb_intel_sdvo_connector->top_margin); in psb_intel_sdvo_create_enhance_property_tv()
2313 psb_intel_sdvo_connector->bottom = in psb_intel_sdvo_create_enhance_property_tv()
2315 if (!psb_intel_sdvo_connector->bottom) in psb_intel_sdvo_create_enhance_property_tv()
2318 drm_object_attach_property(&connector->base, in psb_intel_sdvo_create_enhance_property_tv()
2319 psb_intel_sdvo_connector->bottom, in psb_intel_sdvo_create_enhance_property_tv()
2320 psb_intel_sdvo_connector->bottom_margin); in psb_intel_sdvo_create_enhance_property_tv()
2343 psb_intel_sdvo_connector->max_dot_crawl = 1; in psb_intel_sdvo_create_enhance_property_tv()
2344 psb_intel_sdvo_connector->cur_dot_crawl = response & 0x1; in psb_intel_sdvo_create_enhance_property_tv()
2345 psb_intel_sdvo_connector->dot_crawl = in psb_intel_sdvo_create_enhance_property_tv()
2347 if (!psb_intel_sdvo_connector->dot_crawl) in psb_intel_sdvo_create_enhance_property_tv()
2350 drm_object_attach_property(&connector->base, in psb_intel_sdvo_create_enhance_property_tv()
2351 psb_intel_sdvo_connector->dot_crawl, in psb_intel_sdvo_create_enhance_property_tv()
2352 psb_intel_sdvo_connector->cur_dot_crawl); in psb_intel_sdvo_create_enhance_property_tv()
2364 struct drm_device *dev = psb_intel_sdvo->base.base.dev; in psb_intel_sdvo_create_enhance_property_lvds()
2365 struct drm_connector *connector = &psb_intel_sdvo_connector->base.base; in psb_intel_sdvo_create_enhance_property_lvds()
2405 struct psb_intel_sdvo *sdvo = adapter->algo_data; in psb_intel_sdvo_ddc_proxy_xfer()
2407 if (!psb_intel_sdvo_set_control_bus_switch(sdvo, sdvo->ddc_bus)) in psb_intel_sdvo_ddc_proxy_xfer()
2408 return -EIO; in psb_intel_sdvo_ddc_proxy_xfer()
2410 return sdvo->i2c->algo->master_xfer(sdvo->i2c, msgs, num); in psb_intel_sdvo_ddc_proxy_xfer()
2415 struct psb_intel_sdvo *sdvo = adapter->algo_data; in psb_intel_sdvo_ddc_proxy_func()
2416 return sdvo->i2c->algo->functionality(sdvo->i2c); in psb_intel_sdvo_ddc_proxy_func()
2428 sdvo->ddc.owner = THIS_MODULE; in psb_intel_sdvo_init_ddc_proxy()
2429 snprintf(sdvo->ddc.name, I2C_NAME_SIZE, "SDVO DDC proxy"); in psb_intel_sdvo_init_ddc_proxy()
2430 sdvo->ddc.dev.parent = dev->dev; in psb_intel_sdvo_init_ddc_proxy()
2431 sdvo->ddc.algo_data = sdvo; in psb_intel_sdvo_init_ddc_proxy()
2432 sdvo->ddc.algo = &psb_intel_sdvo_ddc_proxy; in psb_intel_sdvo_init_ddc_proxy()
2434 return i2c_add_adapter(&sdvo->ddc) == 0; in psb_intel_sdvo_init_ddc_proxy()
2448 psb_intel_sdvo->sdvo_reg = sdvo_reg; in psb_intel_sdvo_init()
2449 psb_intel_sdvo->target_addr = psb_intel_sdvo_get_target_addr(dev, sdvo_reg) >> 1; in psb_intel_sdvo_init()
2456 /* encoder type will be decided later */ in psb_intel_sdvo_init()
2457 gma_encoder = &psb_intel_sdvo->base; in psb_intel_sdvo_init()
2458 gma_encoder->type = INTEL_OUTPUT_SDVO; in psb_intel_sdvo_init()
2459 drm_encoder_init(dev, &gma_encoder->base, &psb_intel_sdvo_enc_funcs, in psb_intel_sdvo_init()
2474 dev_priv->hotplug_supported_mask |= SDVOB_HOTPLUG_INT_STATUS; in psb_intel_sdvo_init()
2476 dev_priv->hotplug_supported_mask |= SDVOC_HOTPLUG_INT_STATUS; in psb_intel_sdvo_init()
2478 drm_encoder_helper_add(&gma_encoder->base, &psb_intel_sdvo_helper_funcs); in psb_intel_sdvo_init()
2481 if (!psb_intel_sdvo_get_capabilities(psb_intel_sdvo, &psb_intel_sdvo->caps)) in psb_intel_sdvo_init()
2485 psb_intel_sdvo->caps.output_flags) != true) { in psb_intel_sdvo_init()
2498 &psb_intel_sdvo->pixel_clock_min, in psb_intel_sdvo_init()
2499 &psb_intel_sdvo->pixel_clock_max)) in psb_intel_sdvo_init()
2503 "clock range %dMHz - %dMHz, " in psb_intel_sdvo_init()
2507 psb_intel_sdvo->caps.vendor_id, psb_intel_sdvo->caps.device_id, in psb_intel_sdvo_init()
2508 psb_intel_sdvo->caps.device_rev_id, in psb_intel_sdvo_init()
2509 psb_intel_sdvo->pixel_clock_min / 1000, in psb_intel_sdvo_init()
2510 psb_intel_sdvo->pixel_clock_max / 1000, in psb_intel_sdvo_init()
2511 (psb_intel_sdvo->caps.sdvo_inputs_mask & 0x1) ? 'Y' : 'N', in psb_intel_sdvo_init()
2512 (psb_intel_sdvo->caps.sdvo_inputs_mask & 0x2) ? 'Y' : 'N', in psb_intel_sdvo_init()
2514 psb_intel_sdvo->caps.output_flags & in psb_intel_sdvo_init()
2516 psb_intel_sdvo->caps.output_flags & in psb_intel_sdvo_init()
2521 drm_encoder_cleanup(&gma_encoder->base); in psb_intel_sdvo_init()
2522 i2c_del_adapter(&psb_intel_sdvo->ddc); in psb_intel_sdvo_init()