41 # define VR00_BASE_ADDRESS_MASK 0x007f
51 # define VR01_PANEL_FIT_ENABLE (1 << 3)
57 # define VR01_LCD_ENABLE (1 << 2)
59 # define VR01_DVO_BYPASS_ENABLE (1 << 1)
61 # define VR01_DVO_ENABLE (1 << 0)
68 # define VR10_LVDS_ENABLE (1 << 4)
70 # define VR10_INTERFACE_1X18 (0 << 2)
72 # define VR10_INTERFACE_1X24 (1 << 2)
74 # define VR10_INTERFACE_2X18 (2 << 2)
76 # define VR10_INTERFACE_2X24 (3 << 2)
93 # define VR30_PANEL_ON (1 << 15)
96 # define VR40_STALL_ENABLE (1 << 13)
97 # define VR40_VERTICAL_INTERP_ENABLE (1 << 12)
98 # define VR40_ENHANCED_PANEL_FITTING (1 << 11)
99 # define VR40_HORIZONTAL_INTERP_ENABLE (1 << 10)
100 # define VR40_AUTO_RATIO_ENABLE (1 << 9)
101 # define VR40_CLOCK_GATING_ENABLE (1 << 8)
138 # define VR8E_PANEL_TYPE_MASK (0xf << 0)
139 # define VR8E_PANEL_INTERFACE_CMOS (0 << 4)
140 # define VR8E_PANEL_INTERFACE_LVDS (1 << 4)
141 # define VR8E_FORCE_DEFAULT_PANEL (1 << 5)
146 # define VR8F_VCH_PRESENT (1 << 0)
147 # define VR8F_DISPLAY_CONN (1 << 1)
148 # define VR8F_POWER_MASK (0x3c)
149 # define VR8F_POWER_POS (2)
196 *data = (in_buf[1] << 8) | in_buf[0];
201 DRM_DEBUG_KMS(
"Unable to read register 0x%02x from "
222 out_buf[1] = data & 0xff;
223 out_buf[2] = data >> 8;
229 DRM_DEBUG_KMS(
"Unable to write register 0x%02x to %s:%d.\n",
251 if (!ivch_read(dvo,
VR00, &temp))
260 DRM_DEBUG_KMS(
"ivch detect failed due to address mismatch "
262 (temp & VR00_BASE_ADDRESS_MASK), dvo->
slave_addr);
284 if (mode->
clock > 112000)
297 if (!ivch_read(dvo,
VR01, &vr01))
304 ivch_write(dvo,
VR80, backlight);
311 ivch_write(dvo,
VR01, vr01);
314 for (i = 0; i < 100; i++) {
315 if (!ivch_read(dvo,
VR30, &vr30))
331 if (!ivch_read(dvo,
VR01, &vr01))
357 x_ratio = (((mode->
hdisplay - 1) << 16) /
358 (adjusted_mode->
hdisplay - 1)) >> 2;
359 y_ratio = (((mode->
vdisplay - 1) << 16) /
360 (adjusted_mode->
vdisplay - 1)) >> 2;
361 ivch_write(dvo,
VR42, x_ratio);
362 ivch_write(dvo,
VR41, y_ratio);
369 ivch_write(dvo,
VR01, vr01);
370 ivch_write(dvo,
VR40, vr40);
379 ivch_read(dvo,
VR00, &val);
380 DRM_LOG_KMS(
"VR00: 0x%04x\n", val);
381 ivch_read(dvo,
VR01, &val);
382 DRM_LOG_KMS(
"VR01: 0x%04x\n", val);
383 ivch_read(dvo,
VR30, &val);
384 DRM_LOG_KMS(
"VR30: 0x%04x\n", val);
385 ivch_read(dvo,
VR40, &val);
386 DRM_LOG_KMS(
"VR40: 0x%04x\n", val);
389 ivch_read(dvo,
VR80, &val);
390 DRM_LOG_KMS(
"VR80: 0x%04x\n", val);
391 ivch_read(dvo,
VR81, &val);
392 DRM_LOG_KMS(
"VR81: 0x%04x\n", val);
393 ivch_read(dvo,
VR82, &val);
394 DRM_LOG_KMS(
"VR82: 0x%04x\n", val);
395 ivch_read(dvo,
VR83, &val);
396 DRM_LOG_KMS(
"VR83: 0x%04x\n", val);
397 ivch_read(dvo,
VR84, &val);
398 DRM_LOG_KMS(
"VR84: 0x%04x\n", val);
399 ivch_read(dvo,
VR85, &val);
400 DRM_LOG_KMS(
"VR85: 0x%04x\n", val);
401 ivch_read(dvo,
VR86, &val);
402 DRM_LOG_KMS(
"VR86: 0x%04x\n", val);
403 ivch_read(dvo,
VR87, &val);
404 DRM_LOG_KMS(
"VR87: 0x%04x\n", val);
405 ivch_read(dvo,
VR88, &val);
406 DRM_LOG_KMS(
"VR88: 0x%04x\n", val);
409 ivch_read(dvo,
VR8E, &val);
410 DRM_LOG_KMS(
"VR8E: 0x%04x\n", val);
413 ivch_read(dvo,
VR8F, &val);
414 DRM_LOG_KMS(
"VR8F: 0x%04x\n", val);
430 .get_hw_state = ivch_get_hw_state,
431 .mode_valid = ivch_mode_valid,
432 .mode_set = ivch_mode_set,
433 .detect = ivch_detect,
434 .dump_regs = ivch_dump_regs,
435 .destroy = ivch_destroy,