dvi.c 15 KB

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