intel_bios.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588
  1. // SPDX-License-Identifier: GPL-2.0-only
  2. /*
  3. * Copyright (c) 2006 Intel Corporation
  4. *
  5. * Authors:
  6. * Eric Anholt <eric@anholt.net>
  7. */
  8. #include <drm/display/drm_dp_helper.h>
  9. #include <drm/drm.h>
  10. #include "intel_bios.h"
  11. #include "psb_drv.h"
  12. #include "psb_intel_drv.h"
  13. #include "psb_intel_reg.h"
  14. #define TARGET_ADDR1 0x70
  15. #define TARGET_ADDR2 0x72
  16. static void *find_section(struct bdb_header *bdb, int section_id)
  17. {
  18. u8 *base = (u8 *)bdb;
  19. int index = 0;
  20. u16 total, current_size;
  21. u8 current_id;
  22. /* skip to first section */
  23. index += bdb->header_size;
  24. total = bdb->bdb_size;
  25. /* walk the sections looking for section_id */
  26. while (index < total) {
  27. current_id = *(base + index);
  28. index++;
  29. current_size = *((u16 *)(base + index));
  30. index += 2;
  31. if (current_id == section_id)
  32. return base + index;
  33. index += current_size;
  34. }
  35. return NULL;
  36. }
  37. static void
  38. parse_edp(struct drm_psb_private *dev_priv, struct bdb_header *bdb)
  39. {
  40. struct bdb_edp *edp;
  41. struct edp_power_seq *edp_pps;
  42. struct edp_link_params *edp_link_params;
  43. uint8_t panel_type;
  44. edp = find_section(bdb, BDB_EDP);
  45. dev_priv->edp.bpp = 18;
  46. if (!edp) {
  47. if (dev_priv->edp.support) {
  48. DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported, assume %dbpp panel color depth.\n",
  49. dev_priv->edp.bpp);
  50. }
  51. return;
  52. }
  53. panel_type = dev_priv->panel_type;
  54. switch ((edp->color_depth >> (panel_type * 2)) & 3) {
  55. case EDP_18BPP:
  56. dev_priv->edp.bpp = 18;
  57. break;
  58. case EDP_24BPP:
  59. dev_priv->edp.bpp = 24;
  60. break;
  61. case EDP_30BPP:
  62. dev_priv->edp.bpp = 30;
  63. break;
  64. }
  65. /* Get the eDP sequencing and link info */
  66. edp_pps = &edp->power_seqs[panel_type];
  67. edp_link_params = &edp->link_params[panel_type];
  68. dev_priv->edp.pps = *edp_pps;
  69. DRM_DEBUG_KMS("EDP timing in vbt t1_t3 %d t8 %d t9 %d t10 %d t11_t12 %d\n",
  70. dev_priv->edp.pps.t1_t3, dev_priv->edp.pps.t8,
  71. dev_priv->edp.pps.t9, dev_priv->edp.pps.t10,
  72. dev_priv->edp.pps.t11_t12);
  73. dev_priv->edp.rate = edp_link_params->rate ? DP_LINK_BW_2_7 :
  74. DP_LINK_BW_1_62;
  75. switch (edp_link_params->lanes) {
  76. case 0:
  77. dev_priv->edp.lanes = 1;
  78. break;
  79. case 1:
  80. dev_priv->edp.lanes = 2;
  81. break;
  82. case 3:
  83. default:
  84. dev_priv->edp.lanes = 4;
  85. break;
  86. }
  87. DRM_DEBUG_KMS("VBT reports EDP: Lane_count %d, Lane_rate %d, Bpp %d\n",
  88. dev_priv->edp.lanes, dev_priv->edp.rate, dev_priv->edp.bpp);
  89. switch (edp_link_params->preemphasis) {
  90. case 0:
  91. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_0;
  92. break;
  93. case 1:
  94. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_1;
  95. break;
  96. case 2:
  97. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_2;
  98. break;
  99. case 3:
  100. dev_priv->edp.preemphasis = DP_TRAIN_PRE_EMPH_LEVEL_3;
  101. break;
  102. }
  103. switch (edp_link_params->vswing) {
  104. case 0:
  105. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_0;
  106. break;
  107. case 1:
  108. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_1;
  109. break;
  110. case 2:
  111. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_2;
  112. break;
  113. case 3:
  114. dev_priv->edp.vswing = DP_TRAIN_VOLTAGE_SWING_LEVEL_3;
  115. break;
  116. }
  117. DRM_DEBUG_KMS("VBT reports EDP: VSwing %d, Preemph %d\n",
  118. dev_priv->edp.vswing, dev_priv->edp.preemphasis);
  119. }
  120. static u16
  121. get_blocksize(void *p)
  122. {
  123. u16 *block_ptr, block_size;
  124. block_ptr = (u16 *)((char *)p - 2);
  125. block_size = *block_ptr;
  126. return block_size;
  127. }
  128. static void fill_detail_timing_data(struct drm_display_mode *panel_fixed_mode,
  129. struct lvds_dvo_timing *dvo_timing)
  130. {
  131. panel_fixed_mode->hdisplay = (dvo_timing->hactive_hi << 8) |
  132. dvo_timing->hactive_lo;
  133. panel_fixed_mode->hsync_start = panel_fixed_mode->hdisplay +
  134. ((dvo_timing->hsync_off_hi << 8) | dvo_timing->hsync_off_lo);
  135. panel_fixed_mode->hsync_end = panel_fixed_mode->hsync_start +
  136. dvo_timing->hsync_pulse_width;
  137. panel_fixed_mode->htotal = panel_fixed_mode->hdisplay +
  138. ((dvo_timing->hblank_hi << 8) | dvo_timing->hblank_lo);
  139. panel_fixed_mode->vdisplay = (dvo_timing->vactive_hi << 8) |
  140. dvo_timing->vactive_lo;
  141. panel_fixed_mode->vsync_start = panel_fixed_mode->vdisplay +
  142. dvo_timing->vsync_off;
  143. panel_fixed_mode->vsync_end = panel_fixed_mode->vsync_start +
  144. dvo_timing->vsync_pulse_width;
  145. panel_fixed_mode->vtotal = panel_fixed_mode->vdisplay +
  146. ((dvo_timing->vblank_hi << 8) | dvo_timing->vblank_lo);
  147. panel_fixed_mode->clock = dvo_timing->clock * 10;
  148. panel_fixed_mode->type = DRM_MODE_TYPE_PREFERRED;
  149. if (dvo_timing->hsync_positive)
  150. panel_fixed_mode->flags |= DRM_MODE_FLAG_PHSYNC;
  151. else
  152. panel_fixed_mode->flags |= DRM_MODE_FLAG_NHSYNC;
  153. if (dvo_timing->vsync_positive)
  154. panel_fixed_mode->flags |= DRM_MODE_FLAG_PVSYNC;
  155. else
  156. panel_fixed_mode->flags |= DRM_MODE_FLAG_NVSYNC;
  157. /* Some VBTs have bogus h/vtotal values */
  158. if (panel_fixed_mode->hsync_end > panel_fixed_mode->htotal)
  159. panel_fixed_mode->htotal = panel_fixed_mode->hsync_end + 1;
  160. if (panel_fixed_mode->vsync_end > panel_fixed_mode->vtotal)
  161. panel_fixed_mode->vtotal = panel_fixed_mode->vsync_end + 1;
  162. drm_mode_set_name(panel_fixed_mode);
  163. }
  164. static void parse_backlight_data(struct drm_psb_private *dev_priv,
  165. struct bdb_header *bdb)
  166. {
  167. struct bdb_lvds_backlight *vbt_lvds_bl = NULL;
  168. struct bdb_lvds_backlight *lvds_bl;
  169. u8 p_type = 0;
  170. void *bl_start = NULL;
  171. struct bdb_lvds_options *lvds_opts
  172. = find_section(bdb, BDB_LVDS_OPTIONS);
  173. dev_priv->lvds_bl = NULL;
  174. if (lvds_opts)
  175. p_type = lvds_opts->panel_type;
  176. else
  177. return;
  178. bl_start = find_section(bdb, BDB_LVDS_BACKLIGHT);
  179. vbt_lvds_bl = (struct bdb_lvds_backlight *)(bl_start + 1) + p_type;
  180. lvds_bl = kmemdup(vbt_lvds_bl, sizeof(*vbt_lvds_bl), GFP_KERNEL);
  181. if (!lvds_bl) {
  182. dev_err(dev_priv->dev.dev, "out of memory for backlight data\n");
  183. return;
  184. }
  185. dev_priv->lvds_bl = lvds_bl;
  186. }
  187. /* Try to find integrated panel data */
  188. static void parse_lfp_panel_data(struct drm_psb_private *dev_priv,
  189. struct bdb_header *bdb)
  190. {
  191. struct bdb_lvds_options *lvds_options;
  192. struct bdb_lvds_lfp_data *lvds_lfp_data;
  193. struct bdb_lvds_lfp_data_entry *entry;
  194. struct lvds_dvo_timing *dvo_timing;
  195. struct drm_display_mode *panel_fixed_mode;
  196. /* Defaults if we can't find VBT info */
  197. dev_priv->lvds_dither = 0;
  198. dev_priv->lvds_vbt = 0;
  199. lvds_options = find_section(bdb, BDB_LVDS_OPTIONS);
  200. if (!lvds_options)
  201. return;
  202. dev_priv->lvds_dither = lvds_options->pixel_dither;
  203. dev_priv->panel_type = lvds_options->panel_type;
  204. if (lvds_options->panel_type == 0xff)
  205. return;
  206. lvds_lfp_data = find_section(bdb, BDB_LVDS_LFP_DATA);
  207. if (!lvds_lfp_data)
  208. return;
  209. entry = &lvds_lfp_data->data[lvds_options->panel_type];
  210. dvo_timing = &entry->dvo_timing;
  211. panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode),
  212. GFP_KERNEL);
  213. if (panel_fixed_mode == NULL) {
  214. dev_err(dev_priv->dev.dev, "out of memory for fixed panel mode\n");
  215. return;
  216. }
  217. dev_priv->lvds_vbt = 1;
  218. fill_detail_timing_data(panel_fixed_mode, dvo_timing);
  219. if (panel_fixed_mode->htotal > 0 && panel_fixed_mode->vtotal > 0) {
  220. dev_priv->lfp_lvds_vbt_mode = panel_fixed_mode;
  221. drm_mode_debug_printmodeline(panel_fixed_mode);
  222. } else {
  223. dev_dbg(dev_priv->dev.dev, "ignoring invalid LVDS VBT\n");
  224. dev_priv->lvds_vbt = 0;
  225. kfree(panel_fixed_mode);
  226. }
  227. return;
  228. }
  229. /* Try to find sdvo panel data */
  230. static void parse_sdvo_panel_data(struct drm_psb_private *dev_priv,
  231. struct bdb_header *bdb)
  232. {
  233. struct bdb_sdvo_lvds_options *sdvo_lvds_options;
  234. struct lvds_dvo_timing *dvo_timing;
  235. struct drm_display_mode *panel_fixed_mode;
  236. dev_priv->sdvo_lvds_vbt_mode = NULL;
  237. sdvo_lvds_options = find_section(bdb, BDB_SDVO_LVDS_OPTIONS);
  238. if (!sdvo_lvds_options)
  239. return;
  240. dvo_timing = find_section(bdb, BDB_SDVO_PANEL_DTDS);
  241. if (!dvo_timing)
  242. return;
  243. panel_fixed_mode = kzalloc(sizeof(*panel_fixed_mode), GFP_KERNEL);
  244. if (!panel_fixed_mode)
  245. return;
  246. fill_detail_timing_data(panel_fixed_mode,
  247. dvo_timing + sdvo_lvds_options->panel_type);
  248. dev_priv->sdvo_lvds_vbt_mode = panel_fixed_mode;
  249. return;
  250. }
  251. static void parse_general_features(struct drm_psb_private *dev_priv,
  252. struct bdb_header *bdb)
  253. {
  254. struct bdb_general_features *general;
  255. /* Set sensible defaults in case we can't find the general block */
  256. dev_priv->int_tv_support = 1;
  257. dev_priv->int_crt_support = 1;
  258. general = find_section(bdb, BDB_GENERAL_FEATURES);
  259. if (general) {
  260. dev_priv->int_tv_support = general->int_tv_support;
  261. dev_priv->int_crt_support = general->int_crt_support;
  262. dev_priv->lvds_use_ssc = general->enable_ssc;
  263. if (dev_priv->lvds_use_ssc) {
  264. dev_priv->lvds_ssc_freq
  265. = general->ssc_freq ? 100 : 96;
  266. }
  267. }
  268. }
  269. static void
  270. parse_sdvo_device_mapping(struct drm_psb_private *dev_priv,
  271. struct bdb_header *bdb)
  272. {
  273. struct sdvo_device_mapping *p_mapping;
  274. struct bdb_general_definitions *p_defs;
  275. struct child_device_config *p_child;
  276. int i, child_device_num, count;
  277. u16 block_size;
  278. p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
  279. if (!p_defs) {
  280. DRM_DEBUG_KMS("No general definition block is found, unable to construct sdvo mapping.\n");
  281. return;
  282. }
  283. /* judge whether the size of child device meets the requirements.
  284. * If the child device size obtained from general definition block
  285. * is different with sizeof(struct child_device_config), skip the
  286. * parsing of sdvo device info
  287. */
  288. if (p_defs->child_dev_size != sizeof(*p_child)) {
  289. /* different child dev size . Ignore it */
  290. DRM_DEBUG_KMS("different child size is found. Invalid.\n");
  291. return;
  292. }
  293. /* get the block size of general definitions */
  294. block_size = get_blocksize(p_defs);
  295. /* get the number of child device */
  296. child_device_num = (block_size - sizeof(*p_defs)) /
  297. sizeof(*p_child);
  298. count = 0;
  299. for (i = 0; i < child_device_num; i++) {
  300. p_child = &(p_defs->devices[i]);
  301. if (!p_child->device_type) {
  302. /* skip the device block if device type is invalid */
  303. continue;
  304. }
  305. if (p_child->target_addr != TARGET_ADDR1 &&
  306. p_child->target_addr != TARGET_ADDR2) {
  307. /*
  308. * If the target address is neither 0x70 nor 0x72,
  309. * it is not a SDVO device. Skip it.
  310. */
  311. continue;
  312. }
  313. if (p_child->dvo_port != DEVICE_PORT_DVOB &&
  314. p_child->dvo_port != DEVICE_PORT_DVOC) {
  315. /* skip the incorrect SDVO port */
  316. DRM_DEBUG_KMS("Incorrect SDVO port. Skip it\n");
  317. continue;
  318. }
  319. DRM_DEBUG_KMS("the SDVO device with target addr %2x is found on"
  320. " %s port\n",
  321. p_child->target_addr,
  322. (p_child->dvo_port == DEVICE_PORT_DVOB) ?
  323. "SDVOB" : "SDVOC");
  324. p_mapping = &(dev_priv->sdvo_mappings[p_child->dvo_port - 1]);
  325. if (!p_mapping->initialized) {
  326. p_mapping->dvo_port = p_child->dvo_port;
  327. p_mapping->target_addr = p_child->target_addr;
  328. p_mapping->dvo_wiring = p_child->dvo_wiring;
  329. p_mapping->ddc_pin = p_child->ddc_pin;
  330. p_mapping->i2c_pin = p_child->i2c_pin;
  331. p_mapping->initialized = 1;
  332. DRM_DEBUG_KMS("SDVO device: dvo=%x, addr=%x, wiring=%d, ddc_pin=%d, i2c_pin=%d\n",
  333. p_mapping->dvo_port,
  334. p_mapping->target_addr,
  335. p_mapping->dvo_wiring,
  336. p_mapping->ddc_pin,
  337. p_mapping->i2c_pin);
  338. } else {
  339. DRM_DEBUG_KMS("Maybe one SDVO port is shared by "
  340. "two SDVO device.\n");
  341. }
  342. if (p_child->target2_addr) {
  343. /* Maybe this is a SDVO device with multiple inputs */
  344. /* And the mapping info is not added */
  345. DRM_DEBUG_KMS("there exists the target2_addr. Maybe this"
  346. " is a SDVO device with multiple inputs.\n");
  347. }
  348. count++;
  349. }
  350. if (!count) {
  351. /* No SDVO device info is found */
  352. DRM_DEBUG_KMS("No SDVO device info is found in VBT\n");
  353. }
  354. return;
  355. }
  356. static void
  357. parse_driver_features(struct drm_psb_private *dev_priv,
  358. struct bdb_header *bdb)
  359. {
  360. struct bdb_driver_features *driver;
  361. driver = find_section(bdb, BDB_DRIVER_FEATURES);
  362. if (!driver)
  363. return;
  364. if (driver->lvds_config == BDB_DRIVER_FEATURE_EDP)
  365. dev_priv->edp.support = 1;
  366. dev_priv->lvds_enabled_in_vbt = driver->lvds_config != 0;
  367. DRM_DEBUG_KMS("LVDS VBT config bits: 0x%x\n", driver->lvds_config);
  368. /* This bit means to use 96Mhz for DPLL_A or not */
  369. if (driver->primary_lfp_id)
  370. dev_priv->dplla_96mhz = true;
  371. else
  372. dev_priv->dplla_96mhz = false;
  373. }
  374. static void
  375. parse_device_mapping(struct drm_psb_private *dev_priv,
  376. struct bdb_header *bdb)
  377. {
  378. struct bdb_general_definitions *p_defs;
  379. struct child_device_config *p_child, *child_dev_ptr;
  380. int i, child_device_num, count;
  381. u16 block_size;
  382. p_defs = find_section(bdb, BDB_GENERAL_DEFINITIONS);
  383. if (!p_defs) {
  384. DRM_DEBUG_KMS("No general definition block is found, no devices defined.\n");
  385. return;
  386. }
  387. /* judge whether the size of child device meets the requirements.
  388. * If the child device size obtained from general definition block
  389. * is different with sizeof(struct child_device_config), skip the
  390. * parsing of sdvo device info
  391. */
  392. if (p_defs->child_dev_size != sizeof(*p_child)) {
  393. /* different child dev size . Ignore it */
  394. DRM_DEBUG_KMS("different child size is found. Invalid.\n");
  395. return;
  396. }
  397. /* get the block size of general definitions */
  398. block_size = get_blocksize(p_defs);
  399. /* get the number of child device */
  400. child_device_num = (block_size - sizeof(*p_defs)) /
  401. sizeof(*p_child);
  402. count = 0;
  403. /* get the number of child devices that are present */
  404. for (i = 0; i < child_device_num; i++) {
  405. p_child = &(p_defs->devices[i]);
  406. if (!p_child->device_type) {
  407. /* skip the device block if device type is invalid */
  408. continue;
  409. }
  410. count++;
  411. }
  412. if (!count) {
  413. DRM_DEBUG_KMS("no child dev is parsed from VBT\n");
  414. return;
  415. }
  416. dev_priv->child_dev = kcalloc(count, sizeof(*p_child), GFP_KERNEL);
  417. if (!dev_priv->child_dev) {
  418. DRM_DEBUG_KMS("No memory space for child devices\n");
  419. return;
  420. }
  421. dev_priv->child_dev_num = count;
  422. count = 0;
  423. for (i = 0; i < child_device_num; i++) {
  424. p_child = &(p_defs->devices[i]);
  425. if (!p_child->device_type) {
  426. /* skip the device block if device type is invalid */
  427. continue;
  428. }
  429. child_dev_ptr = dev_priv->child_dev + count;
  430. count++;
  431. memcpy((void *)child_dev_ptr, (void *)p_child,
  432. sizeof(*p_child));
  433. }
  434. return;
  435. }
  436. /**
  437. * psb_intel_init_bios - initialize VBIOS settings & find VBT
  438. * @dev: DRM device
  439. *
  440. * Loads the Video BIOS and checks that the VBT exists. Sets scratch registers
  441. * to appropriate values.
  442. *
  443. * VBT existence is a sanity check that is relied on by other i830_bios.c code.
  444. * Note that it would be better to use a BIOS call to get the VBT, as BIOSes may
  445. * feed an updated VBT back through that, compared to what we'll fetch using
  446. * this method of groping around in the BIOS data.
  447. *
  448. * Returns 0 on success, nonzero on failure.
  449. */
  450. int psb_intel_init_bios(struct drm_device *dev)
  451. {
  452. struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
  453. struct pci_dev *pdev = to_pci_dev(dev->dev);
  454. struct vbt_header *vbt = NULL;
  455. struct bdb_header *bdb = NULL;
  456. u8 __iomem *bios = NULL;
  457. size_t size;
  458. int i;
  459. dev_priv->panel_type = 0xff;
  460. /* XXX Should this validation be moved to intel_opregion.c? */
  461. if (dev_priv->opregion.vbt) {
  462. struct vbt_header *vbt = dev_priv->opregion.vbt;
  463. if (memcmp(vbt->signature, "$VBT", 4) == 0) {
  464. DRM_DEBUG_KMS("Using VBT from OpRegion: %20s\n",
  465. vbt->signature);
  466. bdb = (struct bdb_header *)((char *)vbt + vbt->bdb_offset);
  467. } else
  468. dev_priv->opregion.vbt = NULL;
  469. }
  470. if (bdb == NULL) {
  471. bios = pci_map_rom(pdev, &size);
  472. if (!bios)
  473. return -1;
  474. /* Scour memory looking for the VBT signature */
  475. for (i = 0; i + 4 < size; i++) {
  476. if (!memcmp(bios + i, "$VBT", 4)) {
  477. vbt = (struct vbt_header *)(bios + i);
  478. break;
  479. }
  480. }
  481. if (!vbt) {
  482. dev_err(dev->dev, "VBT signature missing\n");
  483. pci_unmap_rom(pdev, bios);
  484. return -1;
  485. }
  486. bdb = (struct bdb_header *)(bios + i + vbt->bdb_offset);
  487. }
  488. /* Grab useful general dxefinitions */
  489. parse_general_features(dev_priv, bdb);
  490. parse_driver_features(dev_priv, bdb);
  491. parse_lfp_panel_data(dev_priv, bdb);
  492. parse_sdvo_panel_data(dev_priv, bdb);
  493. parse_sdvo_device_mapping(dev_priv, bdb);
  494. parse_device_mapping(dev_priv, bdb);
  495. parse_backlight_data(dev_priv, bdb);
  496. parse_edp(dev_priv, bdb);
  497. if (bios)
  498. pci_unmap_rom(pdev, bios);
  499. return 0;
  500. }
  501. /*
  502. * Destroy and free VBT data
  503. */
  504. void psb_intel_destroy_bios(struct drm_device *dev)
  505. {
  506. struct drm_psb_private *dev_priv = to_drm_psb_private(dev);
  507. kfree(dev_priv->sdvo_lvds_vbt_mode);
  508. kfree(dev_priv->lfp_lvds_vbt_mode);
  509. kfree(dev_priv->lvds_bl);
  510. }