31 #define CH7xxx_REG_VID 0x4a
32 #define CH7xxx_REG_DID 0x4b
34 #define CH7011_VID 0x83
35 #define CH7009A_VID 0x84
36 #define CH7009B_VID 0x85
37 #define CH7301_VID 0x95
39 #define CH7xxx_VID 0x84
40 #define CH7xxx_DID 0x17
42 #define CH7xxx_NUM_REGS 0x4c
44 #define CH7xxx_CM 0x1c
45 #define CH7xxx_CM_XCM (1<<0)
46 #define CH7xxx_CM_MCP (1<<2)
47 #define CH7xxx_INPUT_CLOCK 0x1d
48 #define CH7xxx_GPIO 0x1e
49 #define CH7xxx_GPIO_HPIR (1<<3)
50 #define CH7xxx_IDF 0x1f
52 #define CH7xxx_IDF_HSP (1<<3)
53 #define CH7xxx_IDF_VSP (1<<4)
55 #define CH7xxx_CONNECTION_DETECT 0x20
56 #define CH7xxx_CDET_DVI (1<<5)
58 #define CH7301_DAC_CNTL 0x21
59 #define CH7301_HOTPLUG 0x23
60 #define CH7xxx_TCTL 0x31
61 #define CH7xxx_TVCO 0x32
62 #define CH7xxx_TPCP 0x33
63 #define CH7xxx_TPD 0x34
64 #define CH7xxx_TPVT 0x35
65 #define CH7xxx_TLPF 0x36
66 #define CH7xxx_TCT 0x37
67 #define CH7301_TEST_PATTERN 0x48
69 #define CH7xxx_PM 0x49
70 #define CH7xxx_PM_FPD (1<<0)
71 #define CH7301_PM_DACPD0 (1<<1)
72 #define CH7301_PM_DACPD1 (1<<2)
73 #define CH7301_PM_DACPD2 (1<<3)
74 #define CH7xxx_PM_DVIL (1<<6)
75 #define CH7xxx_PM_DVIP (1<<7)
77 #define CH7301_SYNC_POLARITY 0x56
78 #define CH7301_SYNC_RGB_YUV (1<<0)
79 #define CH7301_SYNC_POL_DVI (1<<5)
85 static struct ch7xxx_id_struct {
103 for (i = 0; i <
ARRAY_SIZE(ch7xxx_ids); i++) {
104 if (ch7xxx_ids[i].vid == vid)
105 return ch7xxx_ids[
i].name;
142 if (!ch7xxx->
quiet) {
143 DRM_DEBUG_KMS(
"Unable to read register 0x%02x from %s:%02x.\n",
168 if (!ch7xxx->
quiet) {
169 DRM_DEBUG_KMS(
"Unable to write register 0x%02x to %s:%d.\n",
190 ch7xxx->
quiet =
true;
195 name = ch7xxx_get_id(vendor);
197 DRM_DEBUG_KMS(
"ch7xxx not detected; got 0x%02x from %s "
208 DRM_DEBUG_KMS(
"ch7xxx not detected; got 0x%02x from %s "
214 ch7xxx->
quiet =
false;
215 DRM_DEBUG_KMS(
"Detected %s chipset, vendor/device ID 0x%02x/0x%02x\n",
216 name, vendor, device);
247 if (mode->
clock > 165000)
257 uint8_t tvco, tpcp, tpd, tlpf, idf;
259 if (mode->
clock <= 65000) {
319 DRM_LOG_KMS(
"\n %02X: ", i);
320 ch7xxx_readb(dvo, i, &val);
321 DRM_LOG_KMS(
"%02X ", val);
337 .detect = ch7xxx_detect,
338 .mode_valid = ch7xxx_mode_valid,
339 .mode_set = ch7xxx_mode_set,
341 .get_hw_state = ch7xxx_get_hw_state,
342 .dump_regs = ch7xxx_dump_regs,
343 .destroy = ch7xxx_destroy,