blob: 655be567e61cea112b63ac9abdd5361fc0e7b80d [file] [log] [blame]
Angel Pons89ab2502020-04-03 01:22:28 +02001/* SPDX-License-Identifier: GPL-2.0-only */
Arthur Heymans20cb85f2017-04-29 14:31:32 +02002
3#include <stdint.h>
4#include <commonlib/helpers.h>
Arthur Heymans4cdb2b92018-11-28 16:57:15 +01005#include <console/console.h>
Arthur Heymans20cb85f2017-04-29 14:31:32 +02006#include <northbridge/intel/gm45/gm45.h>
Bill XIEfa385352023-04-04 10:45:49 +08007#include <device/pci.h>
Arthur Heymans4cdb2b92018-11-28 16:57:15 +01008#include <drivers/intel/gma/opregion.h>
Arthur Heymans20cb85f2017-04-29 14:31:32 +02009
10static const struct blc_pwm_t blc_entries[] = {
Nico Huber36dafd82017-05-22 19:23:39 +020011 /* corrected to 320MHz CDClk, vendor set 753; works fine at both: */
12 {"LTD121EQ3B", 447},
Arthur Heymans20cb85f2017-04-29 14:31:32 +020013 {"LTD121EWVB", 165},
Peter Lemenkov6b7d40a2020-01-22 11:40:16 +010014 {"LTD133EQ1B", 264}, /* Found on an X301 */
Arthur Heymans20cb85f2017-04-29 14:31:32 +020015 {"B121EW03 V6 ", 165},
16 /* datasheets: between 100 and 20k, typical 200 */
17 /* TESTED: works best at 400 */
18 {"B121EW09 V3 ", 400},
19 {"HV121WX4-120", 110}, /* Aftermarket AFFS lcd, works well at low pwm */
20 {"LTN121AT03001", 110},
Bill XIEad025892023-04-04 10:02:39 +080021 {"LTN121AT07L02", 750}, /* Its part name is LTN121AT07-L02 */
Arthur Heymans20cb85f2017-04-29 14:31:32 +020022 {"LTN121AP03001", 750},
23 /* TODO: untested panels found on thinkwiki */
24 /* Generally CCFL runs best at lower PWM */
25 /* {"B121EW09 V2 ", 450}, */
26 /* {"N121IB-L05", 450}, */
27 {"LP121WX3-TLC1", 400}, /* TESTED to work best at this value */
28 /* {"LP121WX3-TLA1" 450}, */
29 /* {"B121EW03 V3 " 110}, */
30 /* {"LTN121AP02001" 110}, */
31};
32
33int get_blc_values(const struct blc_pwm_t **entries)
34{
35 *entries = blc_entries;
36 return ARRAY_SIZE(blc_entries);
37}
Arthur Heymans4cdb2b92018-11-28 16:57:15 +010038
39const char *mainboard_vbt_filename(void)
40{
Nico Hubere5888da2023-05-18 13:51:18 +020041 u16 pwm_freq = get_blc_pwm_freq_value(gm45_get_lvds_edid_str());
Arthur Heymans4cdb2b92018-11-28 16:57:15 +010042
43 if (pwm_freq == 0) {
44 printk(BIOS_DEBUG,
45 "GMA: Display backlight type not found, assuming LED\n");
46 return "data_led.vbt";
47 } else if (pwm_freq > 200) {
48 printk(BIOS_DEBUG, "GMA: Using LED backlight VBT\n");
49 return "data_led.vbt";
50 } else {
51 printk(BIOS_DEBUG, "GMA: Using CCFL backlight VBT\n");
52 return "data_ccfl.vbt";
53 }
54}