dvi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572
  1. /*
  2. * Copyright 1998-2008 VIA Technologies, Inc. All Rights Reserved.
  3. * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public
  6. * License as published by the Free Software Foundation;
  7. * either version 2, or (at your option) any later version.
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
  10. * the implied warranty of MERCHANTABILITY or FITNESS FOR
  11. * A PARTICULAR PURPOSE.See the GNU General Public License
  12. * for more details.
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program; if not, write to the Free Software
  15. * Foundation, Inc.,
  16. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17. */
  18. #include <linux/via-core.h>
  19. #include <linux/via_i2c.h>
  20. #include "global.h"
  21. static void tmds_register_write(int index, u8 data);
  22. static int tmds_register_read(int index);
  23. static int tmds_register_read_bytes(int index, u8 *buff, int buff_len);
  24. static void dvi_get_panel_size_from_DDCv1(struct tmds_chip_information
  25. *tmds_chip, struct tmds_setting_information *tmds_setting);
  26. static void dvi_get_panel_size_from_DDCv2(struct tmds_chip_information
  27. *tmds_chip, struct tmds_setting_information *tmds_setting);
  28. static int viafb_dvi_query_EDID(void);
  29. static int check_tmds_chip(int device_id_subaddr, int device_id)
  30. {
  31. if (tmds_register_read(device_id_subaddr) == device_id)
  32. return OK;
  33. else
  34. return FAIL;
  35. }
  36. void viafb_init_dvi_size(struct tmds_chip_information *tmds_chip,
  37. struct tmds_setting_information *tmds_setting)
  38. {
  39. DEBUG_MSG(KERN_INFO "viafb_init_dvi_size()\n");
  40. viafb_dvi_sense();
  41. switch (viafb_dvi_query_EDID()) {
  42. case 1:
  43. dvi_get_panel_size_from_DDCv1(tmds_chip, tmds_setting);
  44. break;
  45. case 2:
  46. dvi_get_panel_size_from_DDCv2(tmds_chip, tmds_setting);
  47. break;
  48. default:
  49. printk(KERN_WARNING "viafb_init_dvi_size: DVI panel size undetected!\n");
  50. break;
  51. }
  52. return;
  53. }
  54. int viafb_tmds_trasmitter_identify(void)
  55. {
  56. unsigned char sr2a = 0, sr1e = 0, sr3e = 0;
  57. /* Turn on ouputting pad */
  58. switch (viaparinfo->chip_info->gfx_chip_name) {
  59. case UNICHROME_K8M890:
  60. /*=* DFP Low Pad on *=*/
  61. sr2a = viafb_read_reg(VIASR, SR2A);
  62. viafb_write_reg_mask(SR2A, VIASR, 0x03, BIT0 + BIT1);
  63. break;
  64. case UNICHROME_P4M900:
  65. case UNICHROME_P4M890:
  66. /* DFP Low Pad on */
  67. sr2a = viafb_read_reg(VIASR, SR2A);
  68. viafb_write_reg_mask(SR2A, VIASR, 0x03, BIT0 + BIT1);
  69. /* DVP0 Pad on */
  70. sr1e = viafb_read_reg(VIASR, SR1E);
  71. viafb_write_reg_mask(SR1E, VIASR, 0xC0, BIT6 + BIT7);
  72. break;
  73. default:
  74. /* DVP0/DVP1 Pad on */
  75. sr1e = viafb_read_reg(VIASR, SR1E);
  76. viafb_write_reg_mask(SR1E, VIASR, 0xF0, BIT4 +
  77. BIT5 + BIT6 + BIT7);
  78. /* SR3E[1]Multi-function selection:
  79. 0 = Emulate I2C and DDC bus by GPIO2/3/4. */
  80. sr3e = viafb_read_reg(VIASR, SR3E);
  81. viafb_write_reg_mask(SR3E, VIASR, 0x0, BIT5);
  82. break;
  83. }
  84. /* Check for VT1632: */
  85. viaparinfo->chip_info->tmds_chip_info.tmds_chip_name = VT1632_TMDS;
  86. viaparinfo->chip_info->
  87. tmds_chip_info.tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR;
  88. viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_31;
  89. if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID) != FAIL) {
  90. /*
  91. * Currently only support 12bits,dual edge,add 24bits mode later
  92. */
  93. tmds_register_write(0x08, 0x3b);
  94. DEBUG_MSG(KERN_INFO "\n VT1632 TMDS ! \n");
  95. DEBUG_MSG(KERN_INFO "\n %2d",
  96. viaparinfo->chip_info->tmds_chip_info.tmds_chip_name);
  97. DEBUG_MSG(KERN_INFO "\n %2d",
  98. viaparinfo->chip_info->tmds_chip_info.i2c_port);
  99. return OK;
  100. } else {
  101. viaparinfo->chip_info->tmds_chip_info.i2c_port = VIA_PORT_2C;
  102. if (check_tmds_chip(VT1632_DEVICE_ID_REG, VT1632_DEVICE_ID)
  103. != FAIL) {
  104. tmds_register_write(0x08, 0x3b);
  105. DEBUG_MSG(KERN_INFO "\n VT1632 TMDS ! \n");
  106. DEBUG_MSG(KERN_INFO "\n %2d",
  107. viaparinfo->chip_info->
  108. tmds_chip_info.tmds_chip_name);
  109. DEBUG_MSG(KERN_INFO "\n %2d",
  110. viaparinfo->chip_info->
  111. tmds_chip_info.i2c_port);
  112. return OK;
  113. }
  114. }
  115. viaparinfo->chip_info->tmds_chip_info.tmds_chip_name = INTEGRATED_TMDS;
  116. if ((viaparinfo->chip_info->gfx_chip_name == UNICHROME_CX700) &&
  117. ((viafb_display_hardware_layout == HW_LAYOUT_DVI_ONLY) ||
  118. (viafb_display_hardware_layout == HW_LAYOUT_LCD_DVI))) {
  119. DEBUG_MSG(KERN_INFO "\n Integrated TMDS ! \n");
  120. return OK;
  121. }
  122. switch (viaparinfo->chip_info->gfx_chip_name) {
  123. case UNICHROME_K8M890:
  124. viafb_write_reg(SR2A, VIASR, sr2a);
  125. break;
  126. case UNICHROME_P4M900:
  127. case UNICHROME_P4M890:
  128. viafb_write_reg(SR2A, VIASR, sr2a);
  129. viafb_write_reg(SR1E, VIASR, sr1e);
  130. break;
  131. default:
  132. viafb_write_reg(SR1E, VIASR, sr1e);
  133. viafb_write_reg(SR3E, VIASR, sr3e);
  134. break;
  135. }
  136. viaparinfo->chip_info->
  137. tmds_chip_info.tmds_chip_name = NON_TMDS_TRANSMITTER;
  138. viaparinfo->chip_info->tmds_chip_info.
  139. tmds_chip_slave_addr = VT1632_TMDS_I2C_ADDR;
  140. return FAIL;
  141. }
  142. static void tmds_register_write(int index, u8 data)
  143. {
  144. viafb_i2c_writebyte(viaparinfo->chip_info->tmds_chip_info.i2c_port,
  145. viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr,
  146. index, data);
  147. }
  148. static int tmds_register_read(int index)
  149. {
  150. u8 data;
  151. viafb_i2c_readbyte(viaparinfo->chip_info->tmds_chip_info.i2c_port,
  152. (u8) viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr,
  153. (u8) index, &data);
  154. return data;
  155. }
  156. static int tmds_register_read_bytes(int index, u8 *buff, int buff_len)
  157. {
  158. viafb_i2c_readbytes(viaparinfo->chip_info->tmds_chip_info.i2c_port,
  159. (u8) viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr,
  160. (u8) index, buff, buff_len);
  161. return 0;
  162. }
  163. /* DVI Set Mode */
  164. void viafb_dvi_set_mode(struct VideoModeTable *mode, int mode_bpp,
  165. int set_iga)
  166. {
  167. struct VideoModeTable *rb_mode;
  168. struct crt_mode_table *pDviTiming;
  169. unsigned long desirePixelClock, maxPixelClock;
  170. pDviTiming = mode->crtc;
  171. desirePixelClock = pDviTiming->clk / 1000000;
  172. maxPixelClock = (unsigned long)viaparinfo->
  173. tmds_setting_info->max_pixel_clock;
  174. DEBUG_MSG(KERN_INFO "\nDVI_set_mode!!\n");
  175. if ((maxPixelClock != 0) && (desirePixelClock > maxPixelClock)) {
  176. rb_mode = viafb_get_rb_mode(mode->crtc[0].crtc.hor_addr,
  177. mode->crtc[0].crtc.ver_addr);
  178. if (rb_mode) {
  179. mode = rb_mode;
  180. pDviTiming = rb_mode->crtc;
  181. }
  182. }
  183. viafb_fill_crtc_timing(pDviTiming, mode, mode_bpp / 8, set_iga);
  184. viafb_set_output_path(DEVICE_DVI, set_iga,
  185. viaparinfo->chip_info->tmds_chip_info.output_interface);
  186. }
  187. /* Sense DVI Connector */
  188. int viafb_dvi_sense(void)
  189. {
  190. u8 RegSR1E = 0, RegSR3E = 0, RegCR6B = 0, RegCR91 = 0,
  191. RegCR93 = 0, RegCR9B = 0, data;
  192. int ret = false;
  193. DEBUG_MSG(KERN_INFO "viafb_dvi_sense!!\n");
  194. if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) {
  195. /* DI1 Pad on */
  196. RegSR1E = viafb_read_reg(VIASR, SR1E);
  197. viafb_write_reg(SR1E, VIASR, RegSR1E | 0x30);
  198. /* CR6B[0]VCK Input Selection: 1 = External clock. */
  199. RegCR6B = viafb_read_reg(VIACR, CR6B);
  200. viafb_write_reg(CR6B, VIACR, RegCR6B | 0x08);
  201. /* CR91[4] VDD On [3] Data On [2] VEE On [1] Back Light Off
  202. [0] Software Control Power Sequence */
  203. RegCR91 = viafb_read_reg(VIACR, CR91);
  204. viafb_write_reg(CR91, VIACR, 0x1D);
  205. /* CR93[7] DI1 Data Source Selection: 1 = DSP2.
  206. CR93[5] DI1 Clock Source: 1 = internal.
  207. CR93[4] DI1 Clock Polarity.
  208. CR93[3:1] DI1 Clock Adjust. CR93[0] DI1 enable */
  209. RegCR93 = viafb_read_reg(VIACR, CR93);
  210. viafb_write_reg(CR93, VIACR, 0x01);
  211. } else {
  212. /* DVP0/DVP1 Pad on */
  213. RegSR1E = viafb_read_reg(VIASR, SR1E);
  214. viafb_write_reg(SR1E, VIASR, RegSR1E | 0xF0);
  215. /* SR3E[1]Multi-function selection:
  216. 0 = Emulate I2C and DDC bus by GPIO2/3/4. */
  217. RegSR3E = viafb_read_reg(VIASR, SR3E);
  218. viafb_write_reg(SR3E, VIASR, RegSR3E & (~0x20));
  219. /* CR91[4] VDD On [3] Data On [2] VEE On [1] Back Light Off
  220. [0] Software Control Power Sequence */
  221. RegCR91 = viafb_read_reg(VIACR, CR91);
  222. viafb_write_reg(CR91, VIACR, 0x1D);
  223. /*CR9B[4] DVP1 Data Source Selection: 1 = From secondary
  224. display.CR9B[2:0] DVP1 Clock Adjust */
  225. RegCR9B = viafb_read_reg(VIACR, CR9B);
  226. viafb_write_reg(CR9B, VIACR, 0x01);
  227. }
  228. data = (u8) tmds_register_read(0x09);
  229. if (data & 0x04)
  230. ret = true;
  231. if (ret == false) {
  232. if (viafb_dvi_query_EDID())
  233. ret = true;
  234. }
  235. /* Restore status */
  236. viafb_write_reg(SR1E, VIASR, RegSR1E);
  237. viafb_write_reg(CR91, VIACR, RegCR91);
  238. if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) {
  239. viafb_write_reg(CR6B, VIACR, RegCR6B);
  240. viafb_write_reg(CR93, VIACR, RegCR93);
  241. } else {
  242. viafb_write_reg(SR3E, VIASR, RegSR3E);
  243. viafb_write_reg(CR9B, VIACR, RegCR9B);
  244. }
  245. return ret;
  246. }
  247. /* Query Flat Panel's EDID Table Version Through DVI Connector */
  248. static int viafb_dvi_query_EDID(void)
  249. {
  250. u8 data0, data1;
  251. int restore;
  252. DEBUG_MSG(KERN_INFO "viafb_dvi_query_EDID!!\n");
  253. restore = viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr;
  254. viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = 0xA0;
  255. data0 = (u8) tmds_register_read(0x00);
  256. data1 = (u8) tmds_register_read(0x01);
  257. if ((data0 == 0) && (data1 == 0xFF)) {
  258. viaparinfo->chip_info->
  259. tmds_chip_info.tmds_chip_slave_addr = restore;
  260. return EDID_VERSION_1; /* Found EDID1 Table */
  261. }
  262. data0 = (u8) tmds_register_read(0x00);
  263. viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = restore;
  264. if (data0 == 0x20)
  265. return EDID_VERSION_2; /* Found EDID2 Table */
  266. else
  267. return false;
  268. }
  269. /* Get Panel Size Using EDID1 Table */
  270. static void dvi_get_panel_size_from_DDCv1(struct tmds_chip_information
  271. *tmds_chip, struct tmds_setting_information *tmds_setting)
  272. {
  273. int i, max_h = 0, tmp, restore;
  274. unsigned char rData;
  275. unsigned char EDID_DATA[18];
  276. DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv1 \n");
  277. restore = tmds_chip->tmds_chip_slave_addr;
  278. tmds_chip->tmds_chip_slave_addr = 0xA0;
  279. rData = tmds_register_read(0x23);
  280. if (rData & 0x3C)
  281. max_h = 640;
  282. if (rData & 0xC0)
  283. max_h = 720;
  284. if (rData & 0x03)
  285. max_h = 800;
  286. rData = tmds_register_read(0x24);
  287. if (rData & 0xC0)
  288. max_h = 800;
  289. if (rData & 0x1E)
  290. max_h = 1024;
  291. if (rData & 0x01)
  292. max_h = 1280;
  293. for (i = 0x25; i < 0x6D; i++) {
  294. switch (i) {
  295. case 0x26:
  296. case 0x28:
  297. case 0x2A:
  298. case 0x2C:
  299. case 0x2E:
  300. case 0x30:
  301. case 0x32:
  302. case 0x34:
  303. rData = tmds_register_read(i);
  304. if (rData == 1)
  305. break;
  306. /* data = (data + 31) * 8 */
  307. tmp = (rData + 31) << 3;
  308. if (tmp > max_h)
  309. max_h = tmp;
  310. break;
  311. case 0x36:
  312. case 0x48:
  313. case 0x5A:
  314. case 0x6C:
  315. tmds_register_read_bytes(i, EDID_DATA, 10);
  316. if (!(EDID_DATA[0] || EDID_DATA[1])) {
  317. /* The first two byte must be zero. */
  318. if (EDID_DATA[3] == 0xFD) {
  319. /* To get max pixel clock. */
  320. tmds_setting->max_pixel_clock =
  321. EDID_DATA[9] * 10;
  322. }
  323. }
  324. break;
  325. default:
  326. break;
  327. }
  328. }
  329. tmds_setting->max_hres = max_h;
  330. switch (max_h) {
  331. case 640:
  332. tmds_setting->max_vres = 480;
  333. break;
  334. case 800:
  335. tmds_setting->max_vres = 600;
  336. break;
  337. case 1024:
  338. tmds_setting->max_vres = 768;
  339. break;
  340. case 1280:
  341. tmds_setting->max_vres = 1024;
  342. break;
  343. case 1400:
  344. tmds_setting->max_vres = 1050;
  345. break;
  346. case 1440:
  347. tmds_setting->max_vres = 1050;
  348. break;
  349. case 1600:
  350. tmds_setting->max_vres = 1200;
  351. break;
  352. case 1920:
  353. tmds_setting->max_vres = 1080;
  354. break;
  355. default:
  356. DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d ! "
  357. "set default panel size.\n", max_h);
  358. break;
  359. }
  360. DEBUG_MSG(KERN_INFO "DVI max pixelclock = %d\n",
  361. tmds_setting->max_pixel_clock);
  362. tmds_chip->tmds_chip_slave_addr = restore;
  363. }
  364. /* Get Panel Size Using EDID2 Table */
  365. static void dvi_get_panel_size_from_DDCv2(struct tmds_chip_information
  366. *tmds_chip, struct tmds_setting_information *tmds_setting)
  367. {
  368. int restore;
  369. unsigned char R_Buffer[2];
  370. DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv2 \n");
  371. restore = tmds_chip->tmds_chip_slave_addr;
  372. tmds_chip->tmds_chip_slave_addr = 0xA2;
  373. /* Horizontal: 0x76, 0x77 */
  374. tmds_register_read_bytes(0x76, R_Buffer, 2);
  375. tmds_setting->max_hres = R_Buffer[0] + (R_Buffer[1] << 8);
  376. switch (tmds_setting->max_hres) {
  377. case 640:
  378. tmds_setting->max_vres = 480;
  379. break;
  380. case 800:
  381. tmds_setting->max_vres = 600;
  382. break;
  383. case 1024:
  384. tmds_setting->max_vres = 768;
  385. break;
  386. case 1280:
  387. tmds_setting->max_vres = 1024;
  388. break;
  389. case 1400:
  390. tmds_setting->max_vres = 1050;
  391. break;
  392. case 1440:
  393. tmds_setting->max_vres = 1050;
  394. break;
  395. case 1600:
  396. tmds_setting->max_vres = 1200;
  397. break;
  398. default:
  399. DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d! "
  400. "set default panel size.\n", tmds_setting->max_hres);
  401. break;
  402. }
  403. tmds_chip->tmds_chip_slave_addr = restore;
  404. }
  405. /* If Disable DVI, turn off pad */
  406. void viafb_dvi_disable(void)
  407. {
  408. if (viaparinfo->chip_info->
  409. tmds_chip_info.output_interface == INTERFACE_DVP0)
  410. viafb_write_reg(SR1E, VIASR,
  411. viafb_read_reg(VIASR, SR1E) & (~0xC0));
  412. if (viaparinfo->chip_info->
  413. tmds_chip_info.output_interface == INTERFACE_DVP1)
  414. viafb_write_reg(SR1E, VIASR,
  415. viafb_read_reg(VIASR, SR1E) & (~0x30));
  416. if (viaparinfo->chip_info->
  417. tmds_chip_info.output_interface == INTERFACE_DFP_HIGH)
  418. viafb_write_reg(SR2A, VIASR,
  419. viafb_read_reg(VIASR, SR2A) & (~0x0C));
  420. if (viaparinfo->chip_info->
  421. tmds_chip_info.output_interface == INTERFACE_DFP_LOW)
  422. viafb_write_reg(SR2A, VIASR,
  423. viafb_read_reg(VIASR, SR2A) & (~0x03));
  424. if (viaparinfo->chip_info->
  425. tmds_chip_info.output_interface == INTERFACE_TMDS)
  426. /* Turn off TMDS power. */
  427. viafb_write_reg(CRD2, VIACR,
  428. viafb_read_reg(VIACR, CRD2) | 0x08);
  429. }
  430. /* If Enable DVI, turn off pad */
  431. void viafb_dvi_enable(void)
  432. {
  433. u8 data;
  434. if (viaparinfo->chip_info->
  435. tmds_chip_info.output_interface == INTERFACE_DVP0) {
  436. viafb_write_reg(SR1E, VIASR,
  437. viafb_read_reg(VIASR, SR1E) | 0xC0);
  438. if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266)
  439. tmds_register_write(0x88, 0x3b);
  440. else
  441. /*clear CR91[5] to direct on display period
  442. in the secondary diplay path */
  443. viafb_write_reg(CR91, VIACR,
  444. viafb_read_reg(VIACR, CR91) & 0xDF);
  445. }
  446. if (viaparinfo->chip_info->
  447. tmds_chip_info.output_interface == INTERFACE_DVP1) {
  448. viafb_write_reg(SR1E, VIASR,
  449. viafb_read_reg(VIASR, SR1E) | 0x30);
  450. /*fix dvi cann't be enabled with MB VT5718C4 - Al Zhang */
  451. if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) {
  452. tmds_register_write(0x88, 0x3b);
  453. } else {
  454. /*clear CR91[5] to direct on display period
  455. in the secondary diplay path */
  456. viafb_write_reg(CR91, VIACR,
  457. viafb_read_reg(VIACR, CR91) & 0xDF);
  458. }
  459. /*fix DVI cannot enable on EPIA-M board */
  460. if (viafb_platform_epia_dvi == 1) {
  461. viafb_write_reg_mask(CR91, VIACR, 0x1f, 0x1f);
  462. viafb_write_reg_mask(CR88, VIACR, 0x00, BIT6 + BIT0);
  463. if (viafb_bus_width == 24) {
  464. if (viafb_device_lcd_dualedge == 1)
  465. data = 0x3F;
  466. else
  467. data = 0x37;
  468. viafb_i2c_writebyte(viaparinfo->chip_info->
  469. tmds_chip_info.i2c_port,
  470. viaparinfo->chip_info->
  471. tmds_chip_info.tmds_chip_slave_addr,
  472. 0x08, data);
  473. }
  474. }
  475. }
  476. if (viaparinfo->chip_info->
  477. tmds_chip_info.output_interface == INTERFACE_DFP_HIGH) {
  478. viafb_write_reg(SR2A, VIASR,
  479. viafb_read_reg(VIASR, SR2A) | 0x0C);
  480. viafb_write_reg(CR91, VIACR,
  481. viafb_read_reg(VIACR, CR91) & 0xDF);
  482. }
  483. if (viaparinfo->chip_info->
  484. tmds_chip_info.output_interface == INTERFACE_DFP_LOW) {
  485. viafb_write_reg(SR2A, VIASR,
  486. viafb_read_reg(VIASR, SR2A) | 0x03);
  487. viafb_write_reg(CR91, VIACR,
  488. viafb_read_reg(VIACR, CR91) & 0xDF);
  489. }
  490. if (viaparinfo->chip_info->
  491. tmds_chip_info.output_interface == INTERFACE_TMDS) {
  492. /* Turn on Display period in the panel path. */
  493. viafb_write_reg_mask(CR91, VIACR, 0, BIT7);
  494. /* Turn on TMDS power. */
  495. viafb_write_reg_mask(CRD2, VIACR, 0, BIT3);
  496. }
  497. }