dvi.c 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570
  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. }
  185. /* Sense DVI Connector */
  186. int viafb_dvi_sense(void)
  187. {
  188. u8 RegSR1E = 0, RegSR3E = 0, RegCR6B = 0, RegCR91 = 0,
  189. RegCR93 = 0, RegCR9B = 0, data;
  190. int ret = false;
  191. DEBUG_MSG(KERN_INFO "viafb_dvi_sense!!\n");
  192. if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) {
  193. /* DI1 Pad on */
  194. RegSR1E = viafb_read_reg(VIASR, SR1E);
  195. viafb_write_reg(SR1E, VIASR, RegSR1E | 0x30);
  196. /* CR6B[0]VCK Input Selection: 1 = External clock. */
  197. RegCR6B = viafb_read_reg(VIACR, CR6B);
  198. viafb_write_reg(CR6B, VIACR, RegCR6B | 0x08);
  199. /* CR91[4] VDD On [3] Data On [2] VEE On [1] Back Light Off
  200. [0] Software Control Power Sequence */
  201. RegCR91 = viafb_read_reg(VIACR, CR91);
  202. viafb_write_reg(CR91, VIACR, 0x1D);
  203. /* CR93[7] DI1 Data Source Selection: 1 = DSP2.
  204. CR93[5] DI1 Clock Source: 1 = internal.
  205. CR93[4] DI1 Clock Polarity.
  206. CR93[3:1] DI1 Clock Adjust. CR93[0] DI1 enable */
  207. RegCR93 = viafb_read_reg(VIACR, CR93);
  208. viafb_write_reg(CR93, VIACR, 0x01);
  209. } else {
  210. /* DVP0/DVP1 Pad on */
  211. RegSR1E = viafb_read_reg(VIASR, SR1E);
  212. viafb_write_reg(SR1E, VIASR, RegSR1E | 0xF0);
  213. /* SR3E[1]Multi-function selection:
  214. 0 = Emulate I2C and DDC bus by GPIO2/3/4. */
  215. RegSR3E = viafb_read_reg(VIASR, SR3E);
  216. viafb_write_reg(SR3E, VIASR, RegSR3E & (~0x20));
  217. /* CR91[4] VDD On [3] Data On [2] VEE On [1] Back Light Off
  218. [0] Software Control Power Sequence */
  219. RegCR91 = viafb_read_reg(VIACR, CR91);
  220. viafb_write_reg(CR91, VIACR, 0x1D);
  221. /*CR9B[4] DVP1 Data Source Selection: 1 = From secondary
  222. display.CR9B[2:0] DVP1 Clock Adjust */
  223. RegCR9B = viafb_read_reg(VIACR, CR9B);
  224. viafb_write_reg(CR9B, VIACR, 0x01);
  225. }
  226. data = (u8) tmds_register_read(0x09);
  227. if (data & 0x04)
  228. ret = true;
  229. if (ret == false) {
  230. if (viafb_dvi_query_EDID())
  231. ret = true;
  232. }
  233. /* Restore status */
  234. viafb_write_reg(SR1E, VIASR, RegSR1E);
  235. viafb_write_reg(CR91, VIACR, RegCR91);
  236. if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) {
  237. viafb_write_reg(CR6B, VIACR, RegCR6B);
  238. viafb_write_reg(CR93, VIACR, RegCR93);
  239. } else {
  240. viafb_write_reg(SR3E, VIASR, RegSR3E);
  241. viafb_write_reg(CR9B, VIACR, RegCR9B);
  242. }
  243. return ret;
  244. }
  245. /* Query Flat Panel's EDID Table Version Through DVI Connector */
  246. static int viafb_dvi_query_EDID(void)
  247. {
  248. u8 data0, data1;
  249. int restore;
  250. DEBUG_MSG(KERN_INFO "viafb_dvi_query_EDID!!\n");
  251. restore = viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr;
  252. viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = 0xA0;
  253. data0 = (u8) tmds_register_read(0x00);
  254. data1 = (u8) tmds_register_read(0x01);
  255. if ((data0 == 0) && (data1 == 0xFF)) {
  256. viaparinfo->chip_info->
  257. tmds_chip_info.tmds_chip_slave_addr = restore;
  258. return EDID_VERSION_1; /* Found EDID1 Table */
  259. }
  260. data0 = (u8) tmds_register_read(0x00);
  261. viaparinfo->chip_info->tmds_chip_info.tmds_chip_slave_addr = restore;
  262. if (data0 == 0x20)
  263. return EDID_VERSION_2; /* Found EDID2 Table */
  264. else
  265. return false;
  266. }
  267. /* Get Panel Size Using EDID1 Table */
  268. static void dvi_get_panel_size_from_DDCv1(struct tmds_chip_information
  269. *tmds_chip, struct tmds_setting_information *tmds_setting)
  270. {
  271. int i, max_h = 0, tmp, restore;
  272. unsigned char rData;
  273. unsigned char EDID_DATA[18];
  274. DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv1 \n");
  275. restore = tmds_chip->tmds_chip_slave_addr;
  276. tmds_chip->tmds_chip_slave_addr = 0xA0;
  277. rData = tmds_register_read(0x23);
  278. if (rData & 0x3C)
  279. max_h = 640;
  280. if (rData & 0xC0)
  281. max_h = 720;
  282. if (rData & 0x03)
  283. max_h = 800;
  284. rData = tmds_register_read(0x24);
  285. if (rData & 0xC0)
  286. max_h = 800;
  287. if (rData & 0x1E)
  288. max_h = 1024;
  289. if (rData & 0x01)
  290. max_h = 1280;
  291. for (i = 0x25; i < 0x6D; i++) {
  292. switch (i) {
  293. case 0x26:
  294. case 0x28:
  295. case 0x2A:
  296. case 0x2C:
  297. case 0x2E:
  298. case 0x30:
  299. case 0x32:
  300. case 0x34:
  301. rData = tmds_register_read(i);
  302. if (rData == 1)
  303. break;
  304. /* data = (data + 31) * 8 */
  305. tmp = (rData + 31) << 3;
  306. if (tmp > max_h)
  307. max_h = tmp;
  308. break;
  309. case 0x36:
  310. case 0x48:
  311. case 0x5A:
  312. case 0x6C:
  313. tmds_register_read_bytes(i, EDID_DATA, 10);
  314. if (!(EDID_DATA[0] || EDID_DATA[1])) {
  315. /* The first two byte must be zero. */
  316. if (EDID_DATA[3] == 0xFD) {
  317. /* To get max pixel clock. */
  318. tmds_setting->max_pixel_clock =
  319. EDID_DATA[9] * 10;
  320. }
  321. }
  322. break;
  323. default:
  324. break;
  325. }
  326. }
  327. tmds_setting->max_hres = max_h;
  328. switch (max_h) {
  329. case 640:
  330. tmds_setting->max_vres = 480;
  331. break;
  332. case 800:
  333. tmds_setting->max_vres = 600;
  334. break;
  335. case 1024:
  336. tmds_setting->max_vres = 768;
  337. break;
  338. case 1280:
  339. tmds_setting->max_vres = 1024;
  340. break;
  341. case 1400:
  342. tmds_setting->max_vres = 1050;
  343. break;
  344. case 1440:
  345. tmds_setting->max_vres = 1050;
  346. break;
  347. case 1600:
  348. tmds_setting->max_vres = 1200;
  349. break;
  350. case 1920:
  351. tmds_setting->max_vres = 1080;
  352. break;
  353. default:
  354. DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d ! "
  355. "set default panel size.\n", max_h);
  356. break;
  357. }
  358. DEBUG_MSG(KERN_INFO "DVI max pixelclock = %d\n",
  359. tmds_setting->max_pixel_clock);
  360. tmds_chip->tmds_chip_slave_addr = restore;
  361. }
  362. /* Get Panel Size Using EDID2 Table */
  363. static void dvi_get_panel_size_from_DDCv2(struct tmds_chip_information
  364. *tmds_chip, struct tmds_setting_information *tmds_setting)
  365. {
  366. int restore;
  367. unsigned char R_Buffer[2];
  368. DEBUG_MSG(KERN_INFO "\n dvi_get_panel_size_from_DDCv2 \n");
  369. restore = tmds_chip->tmds_chip_slave_addr;
  370. tmds_chip->tmds_chip_slave_addr = 0xA2;
  371. /* Horizontal: 0x76, 0x77 */
  372. tmds_register_read_bytes(0x76, R_Buffer, 2);
  373. tmds_setting->max_hres = R_Buffer[0] + (R_Buffer[1] << 8);
  374. switch (tmds_setting->max_hres) {
  375. case 640:
  376. tmds_setting->max_vres = 480;
  377. break;
  378. case 800:
  379. tmds_setting->max_vres = 600;
  380. break;
  381. case 1024:
  382. tmds_setting->max_vres = 768;
  383. break;
  384. case 1280:
  385. tmds_setting->max_vres = 1024;
  386. break;
  387. case 1400:
  388. tmds_setting->max_vres = 1050;
  389. break;
  390. case 1440:
  391. tmds_setting->max_vres = 1050;
  392. break;
  393. case 1600:
  394. tmds_setting->max_vres = 1200;
  395. break;
  396. default:
  397. DEBUG_MSG(KERN_INFO "Unknown panel size max resolution = %d! "
  398. "set default panel size.\n", tmds_setting->max_hres);
  399. break;
  400. }
  401. tmds_chip->tmds_chip_slave_addr = restore;
  402. }
  403. /* If Disable DVI, turn off pad */
  404. void viafb_dvi_disable(void)
  405. {
  406. if (viaparinfo->chip_info->
  407. tmds_chip_info.output_interface == INTERFACE_DVP0)
  408. viafb_write_reg(SR1E, VIASR,
  409. viafb_read_reg(VIASR, SR1E) & (~0xC0));
  410. if (viaparinfo->chip_info->
  411. tmds_chip_info.output_interface == INTERFACE_DVP1)
  412. viafb_write_reg(SR1E, VIASR,
  413. viafb_read_reg(VIASR, SR1E) & (~0x30));
  414. if (viaparinfo->chip_info->
  415. tmds_chip_info.output_interface == INTERFACE_DFP_HIGH)
  416. viafb_write_reg(SR2A, VIASR,
  417. viafb_read_reg(VIASR, SR2A) & (~0x0C));
  418. if (viaparinfo->chip_info->
  419. tmds_chip_info.output_interface == INTERFACE_DFP_LOW)
  420. viafb_write_reg(SR2A, VIASR,
  421. viafb_read_reg(VIASR, SR2A) & (~0x03));
  422. if (viaparinfo->chip_info->
  423. tmds_chip_info.output_interface == INTERFACE_TMDS)
  424. /* Turn off TMDS power. */
  425. viafb_write_reg(CRD2, VIACR,
  426. viafb_read_reg(VIACR, CRD2) | 0x08);
  427. }
  428. /* If Enable DVI, turn off pad */
  429. void viafb_dvi_enable(void)
  430. {
  431. u8 data;
  432. if (viaparinfo->chip_info->
  433. tmds_chip_info.output_interface == INTERFACE_DVP0) {
  434. viafb_write_reg(SR1E, VIASR,
  435. viafb_read_reg(VIASR, SR1E) | 0xC0);
  436. if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266)
  437. tmds_register_write(0x88, 0x3b);
  438. else
  439. /*clear CR91[5] to direct on display period
  440. in the secondary diplay path */
  441. viafb_write_reg(CR91, VIACR,
  442. viafb_read_reg(VIACR, CR91) & 0xDF);
  443. }
  444. if (viaparinfo->chip_info->
  445. tmds_chip_info.output_interface == INTERFACE_DVP1) {
  446. viafb_write_reg(SR1E, VIASR,
  447. viafb_read_reg(VIASR, SR1E) | 0x30);
  448. /*fix dvi cann't be enabled with MB VT5718C4 - Al Zhang */
  449. if (viaparinfo->chip_info->gfx_chip_name == UNICHROME_CLE266) {
  450. tmds_register_write(0x88, 0x3b);
  451. } else {
  452. /*clear CR91[5] to direct on display period
  453. in the secondary diplay path */
  454. viafb_write_reg(CR91, VIACR,
  455. viafb_read_reg(VIACR, CR91) & 0xDF);
  456. }
  457. /*fix DVI cannot enable on EPIA-M board */
  458. if (viafb_platform_epia_dvi == 1) {
  459. viafb_write_reg_mask(CR91, VIACR, 0x1f, 0x1f);
  460. viafb_write_reg_mask(CR88, VIACR, 0x00, BIT6 + BIT0);
  461. if (viafb_bus_width == 24) {
  462. if (viafb_device_lcd_dualedge == 1)
  463. data = 0x3F;
  464. else
  465. data = 0x37;
  466. viafb_i2c_writebyte(viaparinfo->chip_info->
  467. tmds_chip_info.i2c_port,
  468. viaparinfo->chip_info->
  469. tmds_chip_info.tmds_chip_slave_addr,
  470. 0x08, data);
  471. }
  472. }
  473. }
  474. if (viaparinfo->chip_info->
  475. tmds_chip_info.output_interface == INTERFACE_DFP_HIGH) {
  476. viafb_write_reg(SR2A, VIASR,
  477. viafb_read_reg(VIASR, SR2A) | 0x0C);
  478. viafb_write_reg(CR91, VIACR,
  479. viafb_read_reg(VIACR, CR91) & 0xDF);
  480. }
  481. if (viaparinfo->chip_info->
  482. tmds_chip_info.output_interface == INTERFACE_DFP_LOW) {
  483. viafb_write_reg(SR2A, VIASR,
  484. viafb_read_reg(VIASR, SR2A) | 0x03);
  485. viafb_write_reg(CR91, VIACR,
  486. viafb_read_reg(VIACR, CR91) & 0xDF);
  487. }
  488. if (viaparinfo->chip_info->
  489. tmds_chip_info.output_interface == INTERFACE_TMDS) {
  490. /* Turn on Display period in the panel path. */
  491. viafb_write_reg_mask(CR91, VIACR, 0, BIT7);
  492. /* Turn on TMDS power. */
  493. viafb_write_reg_mask(CRD2, VIACR, 0, BIT3);
  494. }
  495. }