payloads/edk2: Disable the CPU Timer Lib unless supported
[coreboot.git] / src / mainboard / lenovo / x200 / blc.c
blobef2dbb1e59e24ce00c1433fa3da210171cb37f37
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <stdint.h>
4 #include <commonlib/helpers.h>
5 #include <console/console.h>
6 #include <northbridge/intel/gm45/gm45.h>
7 #include <drivers/intel/gma/opregion.h>
9 static const struct blc_pwm_t blc_entries[] = {
10 /* corrected to 320MHz CDClk, vendor set 753; works fine at both: */
11 {"LTD121EQ3B", 447},
12 {"LTD121EWVB", 165},
13 {"LTD133EQ1B", 264}, /* Found on an X301 */
14 {"B121EW03 V6 ", 165},
15 /* datasheets: between 100 and 20k, typical 200 */
16 /* TESTED: works best at 400 */
17 {"B121EW09 V3 ", 400},
18 {"HV121WX4-120", 110}, /* Aftermarket AFFS lcd, works well at low pwm */
19 {"LTN121AT03001", 110},
20 {"LTN121AP03001", 750},
21 /* TODO: untested panels found on thinkwiki */
22 /* Generally CCFL runs best at lower PWM */
23 /* {"B121EW09 V2 ", 450}, */
24 /* {"N121IB-L05", 450}, */
25 {"LP121WX3-TLC1", 400}, /* TESTED to work best at this value */
26 /* {"LP121WX3-TLA1" 450}, */
27 /* {"B121EW03 V3 " 110}, */
28 /* {"LTN121AP02001" 110}, */
31 int get_blc_values(const struct blc_pwm_t **entries)
33 *entries = blc_entries;
34 return ARRAY_SIZE(blc_entries);
37 const char *mainboard_vbt_filename(void)
39 u16 pwm_freq;
41 pwm_freq = get_blc_pwm_freq_value(NULL);
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";