lxfb_ops.c 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576
  1. /* Geode LX framebuffer driver
  2. *
  3. * Copyright (C) 2006-2007, Advanced Micro Devices,Inc.
  4. *
  5. * This program is free software; you can redistribute it and/or modify it
  6. * under the terms of the GNU General Public License as published by the
  7. * Free Software Foundation; either version 2 of the License, or (at your
  8. * option) any later version.
  9. */
  10. #include <linux/kernel.h>
  11. #include <linux/errno.h>
  12. #include <linux/fb.h>
  13. #include <linux/uaccess.h>
  14. #include <linux/delay.h>
  15. #include <asm/geode.h>
  16. #include "lxfb.h"
  17. /* TODO
  18. * Support panel scaling
  19. * Add acceleration
  20. * Add support for interlacing (TV out)
  21. * Support compression
  22. */
  23. /* This is the complete list of PLL frequencies that we can set -
  24. * we will choose the closest match to the incoming clock.
  25. * freq is the frequency of the dotclock * 1000 (for example,
  26. * 24823 = 24.983 Mhz).
  27. * pllval is the corresponding PLL value
  28. */
  29. static const struct {
  30. unsigned int pllval;
  31. unsigned int freq;
  32. } pll_table[] = {
  33. { 0x000131AC, 6231 },
  34. { 0x0001215D, 6294 },
  35. { 0x00011087, 6750 },
  36. { 0x0001216C, 7081 },
  37. { 0x0001218D, 7140 },
  38. { 0x000110C9, 7800 },
  39. { 0x00013147, 7875 },
  40. { 0x000110A7, 8258 },
  41. { 0x00012159, 8778 },
  42. { 0x00014249, 8875 },
  43. { 0x00010057, 9000 },
  44. { 0x0001219A, 9472 },
  45. { 0x00012158, 9792 },
  46. { 0x00010045, 10000 },
  47. { 0x00010089, 10791 },
  48. { 0x000110E7, 11225 },
  49. { 0x00012136, 11430 },
  50. { 0x00013207, 12375 },
  51. { 0x00012187, 12500 },
  52. { 0x00014286, 14063 },
  53. { 0x000110E5, 15016 },
  54. { 0x00014214, 16250 },
  55. { 0x00011105, 17045 },
  56. { 0x000131E4, 18563 },
  57. { 0x00013183, 18750 },
  58. { 0x00014284, 19688 },
  59. { 0x00011104, 20400 },
  60. { 0x00016363, 23625 },
  61. { 0x00015303, 24380 },
  62. { 0x000031AC, 24923 },
  63. { 0x0000215D, 25175 },
  64. { 0x00001087, 27000 },
  65. { 0x0000216C, 28322 },
  66. { 0x0000218D, 28560 },
  67. { 0x00010041, 29913 },
  68. { 0x000010C9, 31200 },
  69. { 0x00003147, 31500 },
  70. { 0x000141A1, 32400 },
  71. { 0x000010A7, 33032 },
  72. { 0x00012182, 33375 },
  73. { 0x000141B1, 33750 },
  74. { 0x00002159, 35112 },
  75. { 0x00004249, 35500 },
  76. { 0x00000057, 36000 },
  77. { 0x000141E1, 37125 },
  78. { 0x0000219A, 37889 },
  79. { 0x00002158, 39168 },
  80. { 0x00000045, 40000 },
  81. { 0x000131A1, 40500 },
  82. { 0x00010061, 42301 },
  83. { 0x00000089, 43163 },
  84. { 0x00012151, 43875 },
  85. { 0x000010E7, 44900 },
  86. { 0x00002136, 45720 },
  87. { 0x000152E1, 47250 },
  88. { 0x00010071, 48000 },
  89. { 0x00003207, 49500 },
  90. { 0x00002187, 50000 },
  91. { 0x00014291, 50625 },
  92. { 0x00011101, 51188 },
  93. { 0x00017481, 54563 },
  94. { 0x00004286, 56250 },
  95. { 0x00014170, 57375 },
  96. { 0x00016210, 58500 },
  97. { 0x000010E5, 60065 },
  98. { 0x00013140, 62796 },
  99. { 0x00004214, 65000 },
  100. { 0x00016250, 65250 },
  101. { 0x00001105, 68179 },
  102. { 0x000141C0, 69600 },
  103. { 0x00015220, 70160 },
  104. { 0x00010050, 72000 },
  105. { 0x000031E4, 74250 },
  106. { 0x00003183, 75000 },
  107. { 0x00004284, 78750 },
  108. { 0x00012130, 80052 },
  109. { 0x00001104, 81600 },
  110. { 0x00006363, 94500 },
  111. { 0x00005303, 97520 },
  112. { 0x00002183, 100187 },
  113. { 0x00002122, 101420 },
  114. { 0x00001081, 108000 },
  115. { 0x00006201, 113310 },
  116. { 0x00000041, 119650 },
  117. { 0x000041A1, 129600 },
  118. { 0x00002182, 133500 },
  119. { 0x000041B1, 135000 },
  120. { 0x00000051, 144000 },
  121. { 0x000041E1, 148500 },
  122. { 0x000062D1, 157500 },
  123. { 0x000031A1, 162000 },
  124. { 0x00000061, 169203 },
  125. { 0x00004231, 172800 },
  126. { 0x00002151, 175500 },
  127. { 0x000052E1, 189000 },
  128. { 0x00000071, 192000 },
  129. { 0x00003201, 198000 },
  130. { 0x00004291, 202500 },
  131. { 0x00001101, 204750 },
  132. { 0x00007481, 218250 },
  133. { 0x00004170, 229500 },
  134. { 0x00006210, 234000 },
  135. { 0x00003140, 251182 },
  136. { 0x00006250, 261000 },
  137. { 0x000041C0, 278400 },
  138. { 0x00005220, 280640 },
  139. { 0x00000050, 288000 },
  140. { 0x000041E0, 297000 },
  141. { 0x00002130, 320207 }
  142. };
  143. static void lx_set_dotpll(u32 pllval)
  144. {
  145. u32 dotpll_lo, dotpll_hi;
  146. int i;
  147. rdmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
  148. if ((dotpll_lo & GLCP_DOTPLL_LOCK) && (dotpll_hi == pllval))
  149. return;
  150. dotpll_hi = pllval;
  151. dotpll_lo &= ~(GLCP_DOTPLL_BYPASS | GLCP_DOTPLL_HALFPIX);
  152. dotpll_lo |= GLCP_DOTPLL_RESET;
  153. wrmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
  154. /* Wait 100us for the PLL to lock */
  155. udelay(100);
  156. /* Now, loop for the lock bit */
  157. for (i = 0; i < 1000; i++) {
  158. rdmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
  159. if (dotpll_lo & GLCP_DOTPLL_LOCK)
  160. break;
  161. }
  162. /* Clear the reset bit */
  163. dotpll_lo &= ~GLCP_DOTPLL_RESET;
  164. wrmsr(MSR_GLCP_DOTPLL, dotpll_lo, dotpll_hi);
  165. }
  166. /* Set the clock based on the frequency specified by the current mode */
  167. static void lx_set_clock(struct fb_info *info)
  168. {
  169. unsigned int diff, min, best = 0;
  170. unsigned int freq, i;
  171. freq = (unsigned int) (1000000000 / info->var.pixclock);
  172. min = abs(pll_table[0].freq - freq);
  173. for (i = 0; i < ARRAY_SIZE(pll_table); i++) {
  174. diff = abs(pll_table[i].freq - freq);
  175. if (diff < min) {
  176. min = diff;
  177. best = i;
  178. }
  179. }
  180. lx_set_dotpll(pll_table[best].pllval & 0x00017FFF);
  181. }
  182. static void lx_graphics_disable(struct fb_info *info)
  183. {
  184. struct lxfb_par *par = info->par;
  185. unsigned int val, gcfg;
  186. /* Note: This assumes that the video is in a quitet state */
  187. write_vp(par, VP_A1T, 0);
  188. write_vp(par, VP_A2T, 0);
  189. write_vp(par, VP_A3T, 0);
  190. /* Turn off the VGA and video enable */
  191. val = read_dc(par, DC_GENERAL_CFG) & ~(DC_GENERAL_CFG_VGAE |
  192. DC_GENERAL_CFG_VIDE);
  193. write_dc(par, DC_GENERAL_CFG, val);
  194. val = read_vp(par, VP_VCFG) & ~VP_VCFG_VID_EN;
  195. write_vp(par, VP_VCFG, val);
  196. write_dc(par, DC_IRQ, DC_IRQ_MASK | DC_IRQ_VIP_VSYNC_LOSS_IRQ_MASK |
  197. DC_IRQ_STATUS | DC_IRQ_VIP_VSYNC_IRQ_STATUS);
  198. val = read_dc(par, DC_GENLK_CTL) & ~DC_GENLK_CTL_GENLK_EN;
  199. write_dc(par, DC_GENLK_CTL, val);
  200. val = read_dc(par, DC_CLR_KEY);
  201. write_dc(par, DC_CLR_KEY, val & ~DC_CLR_KEY_CLR_KEY_EN);
  202. /* We don't actually blank the panel, due to the long latency
  203. involved with bringing it back */
  204. val = read_vp(par, VP_MISC) | VP_MISC_DACPWRDN;
  205. write_vp(par, VP_MISC, val);
  206. /* Turn off the display */
  207. val = read_vp(par, VP_DCFG);
  208. write_vp(par, VP_DCFG, val & ~(VP_DCFG_CRT_EN | VP_DCFG_HSYNC_EN |
  209. VP_DCFG_VSYNC_EN | VP_DCFG_DAC_BL_EN));
  210. gcfg = read_dc(par, DC_GENERAL_CFG);
  211. gcfg &= ~(DC_GENERAL_CFG_CMPE | DC_GENERAL_CFG_DECE);
  212. write_dc(par, DC_GENERAL_CFG, gcfg);
  213. /* Turn off the TGEN */
  214. val = read_dc(par, DC_DISPLAY_CFG);
  215. val &= ~DC_DISPLAY_CFG_TGEN;
  216. write_dc(par, DC_DISPLAY_CFG, val);
  217. /* Wait 1000 usecs to ensure that the TGEN is clear */
  218. udelay(1000);
  219. /* Turn off the FIFO loader */
  220. gcfg &= ~DC_GENERAL_CFG_DFLE;
  221. write_dc(par, DC_GENERAL_CFG, gcfg);
  222. /* Lastly, wait for the GP to go idle */
  223. do {
  224. val = read_gp(par, GP_BLT_STATUS);
  225. } while ((val & GP_BLT_STATUS_PB) || !(val & GP_BLT_STATUS_CE));
  226. }
  227. static void lx_graphics_enable(struct fb_info *info)
  228. {
  229. struct lxfb_par *par = info->par;
  230. u32 temp, config;
  231. /* Set the video request register */
  232. write_vp(par, VP_VRR, 0);
  233. /* Set up the polarities */
  234. config = read_vp(par, VP_DCFG);
  235. config &= ~(VP_DCFG_CRT_SYNC_SKW | VP_DCFG_PWR_SEQ_DELAY |
  236. VP_DCFG_CRT_HSYNC_POL | VP_DCFG_CRT_VSYNC_POL);
  237. config |= (VP_DCFG_CRT_SYNC_SKW_DEFAULT | VP_DCFG_PWR_SEQ_DELAY_DEFAULT
  238. | VP_DCFG_GV_GAM);
  239. if (info->var.sync & FB_SYNC_HOR_HIGH_ACT)
  240. config |= VP_DCFG_CRT_HSYNC_POL;
  241. if (info->var.sync & FB_SYNC_VERT_HIGH_ACT)
  242. config |= VP_DCFG_CRT_VSYNC_POL;
  243. if (par->output & OUTPUT_PANEL) {
  244. u32 msrlo, msrhi;
  245. write_fp(par, FP_PT1, 0);
  246. write_fp(par, FP_PT2, FP_PT2_SCRC);
  247. write_fp(par, FP_DFC, FP_DFC_BC);
  248. msrlo = DF_DEFAULT_TFT_PAD_SEL_LOW;
  249. msrhi = DF_DEFAULT_TFT_PAD_SEL_HIGH;
  250. wrmsr(MSR_LX_MSR_PADSEL, msrlo, msrhi);
  251. }
  252. if (par->output & OUTPUT_CRT) {
  253. config |= VP_DCFG_CRT_EN | VP_DCFG_HSYNC_EN |
  254. VP_DCFG_VSYNC_EN | VP_DCFG_DAC_BL_EN;
  255. }
  256. write_vp(par, VP_DCFG, config);
  257. /* Turn the CRT dacs back on */
  258. if (par->output & OUTPUT_CRT) {
  259. temp = read_vp(par, VP_MISC);
  260. temp &= ~(VP_MISC_DACPWRDN | VP_MISC_APWRDN);
  261. write_vp(par, VP_MISC, temp);
  262. }
  263. /* Turn the panel on (if it isn't already) */
  264. if (par->output & OUTPUT_PANEL) {
  265. temp = read_fp(par, FP_PM);
  266. if (!(temp & 0x09))
  267. write_fp(par, FP_PM, temp | FP_PM_P);
  268. }
  269. }
  270. unsigned int lx_framebuffer_size(void)
  271. {
  272. unsigned int val;
  273. /* The frame buffer size is reported by a VSM in VSA II */
  274. /* Virtual Register Class = 0x02 */
  275. /* VG_MEM_SIZE (1MB units) = 0x00 */
  276. outw(0xFC53, 0xAC1C);
  277. outw(0x0200, 0xAC1C);
  278. val = (unsigned int)(inw(0xAC1E)) & 0xFE;
  279. return (val << 20);
  280. }
  281. void lx_set_mode(struct fb_info *info)
  282. {
  283. struct lxfb_par *par = info->par;
  284. u64 msrval;
  285. unsigned int max, dv, val, size;
  286. unsigned int gcfg, dcfg;
  287. int hactive, hblankstart, hsyncstart, hsyncend, hblankend, htotal;
  288. int vactive, vblankstart, vsyncstart, vsyncend, vblankend, vtotal;
  289. /* Unlock the DC registers */
  290. write_dc(par, DC_UNLOCK, DC_UNLOCK_UNLOCK);
  291. lx_graphics_disable(info);
  292. lx_set_clock(info);
  293. /* Set output mode */
  294. rdmsrl(MSR_LX_GLD_MSR_CONFIG, msrval);
  295. msrval &= ~DF_CONFIG_OUTPUT_MASK;
  296. if (par->output & OUTPUT_PANEL) {
  297. msrval |= DF_OUTPUT_PANEL;
  298. if (par->output & OUTPUT_CRT)
  299. msrval |= DF_SIMULTANEOUS_CRT_AND_FP;
  300. else
  301. msrval &= ~DF_SIMULTANEOUS_CRT_AND_FP;
  302. } else {
  303. msrval |= DF_OUTPUT_CRT;
  304. }
  305. wrmsrl(MSR_LX_GLD_MSR_CONFIG, msrval);
  306. /* Clear the various buffers */
  307. /* FIXME: Adjust for panning here */
  308. write_dc(par, DC_FB_ST_OFFSET, 0);
  309. write_dc(par, DC_CB_ST_OFFSET, 0);
  310. write_dc(par, DC_CURS_ST_OFFSET, 0);
  311. /* FIXME: Add support for interlacing */
  312. /* FIXME: Add support for scaling */
  313. val = read_dc(par, DC_GENLK_CTL);
  314. val &= ~(DC_GENLK_CTL_ALPHA_FLICK_EN | DC_GENLK_CTL_FLICK_EN |
  315. DC_GENLK_CTL_FLICK_SEL_MASK);
  316. /* Default scaling params */
  317. write_dc(par, DC_GFX_SCALE, (0x4000 << 16) | 0x4000);
  318. write_dc(par, DC_IRQ_FILT_CTL, 0);
  319. write_dc(par, DC_GENLK_CTL, val);
  320. /* FIXME: Support compression */
  321. if (info->fix.line_length > 4096)
  322. dv = DC_DV_CTL_DV_LINE_SIZE_8K;
  323. else if (info->fix.line_length > 2048)
  324. dv = DC_DV_CTL_DV_LINE_SIZE_4K;
  325. else if (info->fix.line_length > 1024)
  326. dv = DC_DV_CTL_DV_LINE_SIZE_2K;
  327. else
  328. dv = DC_DV_CTL_DV_LINE_SIZE_1K;
  329. max = info->fix.line_length * info->var.yres;
  330. max = (max + 0x3FF) & 0xFFFFFC00;
  331. write_dc(par, DC_DV_TOP, max | DC_DV_TOP_DV_TOP_EN);
  332. val = read_dc(par, DC_DV_CTL) & ~DC_DV_CTL_DV_LINE_SIZE;
  333. write_dc(par, DC_DV_CTL, val | dv);
  334. size = info->var.xres * (info->var.bits_per_pixel >> 3);
  335. write_dc(par, DC_GFX_PITCH, info->fix.line_length >> 3);
  336. write_dc(par, DC_LINE_SIZE, (size + 7) >> 3);
  337. /* Set default watermark values */
  338. rdmsrl(MSR_LX_SPARE_MSR, msrval);
  339. msrval &= ~(DC_SPARE_DISABLE_CFIFO_HGO | DC_SPARE_VFIFO_ARB_SELECT |
  340. DC_SPARE_LOAD_WM_LPEN_MASK | DC_SPARE_WM_LPEN_OVRD |
  341. DC_SPARE_DISABLE_INIT_VID_PRI | DC_SPARE_DISABLE_VFIFO_WM);
  342. msrval |= DC_SPARE_DISABLE_VFIFO_WM | DC_SPARE_DISABLE_INIT_VID_PRI;
  343. wrmsrl(MSR_LX_SPARE_MSR, msrval);
  344. gcfg = DC_GENERAL_CFG_DFLE; /* Display fifo enable */
  345. gcfg |= (0x6 << DC_GENERAL_CFG_DFHPSL_SHIFT) | /* default priority */
  346. (0xb << DC_GENERAL_CFG_DFHPEL_SHIFT);
  347. gcfg |= DC_GENERAL_CFG_FDTY; /* Set the frame dirty mode */
  348. dcfg = DC_DISPLAY_CFG_VDEN; /* Enable video data */
  349. dcfg |= DC_DISPLAY_CFG_GDEN; /* Enable graphics */
  350. dcfg |= DC_DISPLAY_CFG_TGEN; /* Turn on the timing generator */
  351. dcfg |= DC_DISPLAY_CFG_TRUP; /* Update timings immediately */
  352. dcfg |= DC_DISPLAY_CFG_PALB; /* Palette bypass in > 8 bpp modes */
  353. dcfg |= DC_DISPLAY_CFG_VISL;
  354. dcfg |= DC_DISPLAY_CFG_DCEN; /* Always center the display */
  355. /* Set the current BPP mode */
  356. switch (info->var.bits_per_pixel) {
  357. case 8:
  358. dcfg |= DC_DISPLAY_CFG_DISP_MODE_8BPP;
  359. break;
  360. case 16:
  361. dcfg |= DC_DISPLAY_CFG_DISP_MODE_16BPP;
  362. break;
  363. case 32:
  364. case 24:
  365. dcfg |= DC_DISPLAY_CFG_DISP_MODE_24BPP;
  366. break;
  367. }
  368. /* Now - set up the timings */
  369. hactive = info->var.xres;
  370. hblankstart = hactive;
  371. hsyncstart = hblankstart + info->var.right_margin;
  372. hsyncend = hsyncstart + info->var.hsync_len;
  373. hblankend = hsyncend + info->var.left_margin;
  374. htotal = hblankend;
  375. vactive = info->var.yres;
  376. vblankstart = vactive;
  377. vsyncstart = vblankstart + info->var.lower_margin;
  378. vsyncend = vsyncstart + info->var.vsync_len;
  379. vblankend = vsyncend + info->var.upper_margin;
  380. vtotal = vblankend;
  381. write_dc(par, DC_H_ACTIVE_TIMING, (hactive - 1) | ((htotal - 1) << 16));
  382. write_dc(par, DC_H_BLANK_TIMING,
  383. (hblankstart - 1) | ((hblankend - 1) << 16));
  384. write_dc(par, DC_H_SYNC_TIMING,
  385. (hsyncstart - 1) | ((hsyncend - 1) << 16));
  386. write_dc(par, DC_V_ACTIVE_TIMING, (vactive - 1) | ((vtotal - 1) << 16));
  387. write_dc(par, DC_V_BLANK_TIMING,
  388. (vblankstart - 1) | ((vblankend - 1) << 16));
  389. write_dc(par, DC_V_SYNC_TIMING,
  390. (vsyncstart - 1) | ((vsyncend - 1) << 16));
  391. write_dc(par, DC_FB_ACTIVE,
  392. (info->var.xres - 1) << 16 | (info->var.yres - 1));
  393. /* And re-enable the graphics output */
  394. lx_graphics_enable(info);
  395. /* Write the two main configuration registers */
  396. write_dc(par, DC_DISPLAY_CFG, dcfg);
  397. write_dc(par, DC_ARB_CFG, 0);
  398. write_dc(par, DC_GENERAL_CFG, gcfg);
  399. /* Lock the DC registers */
  400. write_dc(par, DC_UNLOCK, DC_UNLOCK_LOCK);
  401. }
  402. void lx_set_palette_reg(struct fb_info *info, unsigned regno,
  403. unsigned red, unsigned green, unsigned blue)
  404. {
  405. struct lxfb_par *par = info->par;
  406. int val;
  407. /* Hardware palette is in RGB 8-8-8 format. */
  408. val = (red << 8) & 0xff0000;
  409. val |= (green) & 0x00ff00;
  410. val |= (blue >> 8) & 0x0000ff;
  411. write_dc(par, DC_PAL_ADDRESS, regno);
  412. write_dc(par, DC_PAL_DATA, val);
  413. }
  414. int lx_blank_display(struct fb_info *info, int blank_mode)
  415. {
  416. struct lxfb_par *par = info->par;
  417. u32 dcfg, fp_pm;
  418. int blank, hsync, vsync;
  419. /* CRT power saving modes. */
  420. switch (blank_mode) {
  421. case FB_BLANK_UNBLANK:
  422. blank = 0; hsync = 1; vsync = 1;
  423. break;
  424. case FB_BLANK_NORMAL:
  425. blank = 1; hsync = 1; vsync = 1;
  426. break;
  427. case FB_BLANK_VSYNC_SUSPEND:
  428. blank = 1; hsync = 1; vsync = 0;
  429. break;
  430. case FB_BLANK_HSYNC_SUSPEND:
  431. blank = 1; hsync = 0; vsync = 1;
  432. break;
  433. case FB_BLANK_POWERDOWN:
  434. blank = 1; hsync = 0; vsync = 0;
  435. break;
  436. default:
  437. return -EINVAL;
  438. }
  439. dcfg = read_vp(par, VP_DCFG);
  440. dcfg &= ~(VP_DCFG_DAC_BL_EN | VP_DCFG_HSYNC_EN | VP_DCFG_VSYNC_EN);
  441. if (!blank)
  442. dcfg |= VP_DCFG_DAC_BL_EN;
  443. if (hsync)
  444. dcfg |= VP_DCFG_HSYNC_EN;
  445. if (vsync)
  446. dcfg |= VP_DCFG_VSYNC_EN;
  447. write_vp(par, VP_DCFG, dcfg);
  448. /* Power on/off flat panel */
  449. if (par->output & OUTPUT_PANEL) {
  450. fp_pm = read_fp(par, FP_PM);
  451. if (blank_mode == FB_BLANK_POWERDOWN)
  452. fp_pm &= ~FP_PM_P;
  453. else
  454. fp_pm |= FP_PM_P;
  455. write_fp(par, FP_PM, fp_pm);
  456. }
  457. return 0;
  458. }