blob: cdd39a11b5ce12c56c03b4b7d29c2bed90f9c63e [file] [log] [blame]
Arthur Heymans20cb85f2017-04-29 14:31:32 +02001/*
2 * This file is part of the coreboot project.
3 *
Arthur Heymans20cb85f2017-04-29 14:31:32 +02004 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; version 2 of the License.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14
15#include <stdint.h>
16#include <commonlib/helpers.h>
Arthur Heymans4cdb2b92018-11-28 16:57:15 +010017#include <console/console.h>
Arthur Heymans20cb85f2017-04-29 14:31:32 +020018#include <northbridge/intel/gm45/gm45.h>
Arthur Heymans4cdb2b92018-11-28 16:57:15 +010019#include <drivers/intel/gma/opregion.h>
Arthur Heymans20cb85f2017-04-29 14:31:32 +020020
21static const struct blc_pwm_t blc_entries[] = {
Nico Huber36dafd82017-05-22 19:23:39 +020022 /* corrected to 320MHz CDClk, vendor set 753; works fine at both: */
23 {"LTD121EQ3B", 447},
Arthur Heymans20cb85f2017-04-29 14:31:32 +020024 {"LTD121EWVB", 165},
Peter Lemenkov6b7d40a2020-01-22 11:40:16 +010025 {"LTD133EQ1B", 264}, /* Found on an X301 */
Arthur Heymans20cb85f2017-04-29 14:31:32 +020026 {"B121EW03 V6 ", 165},
27 /* datasheets: between 100 and 20k, typical 200 */
28 /* TESTED: works best at 400 */
29 {"B121EW09 V3 ", 400},
30 {"HV121WX4-120", 110}, /* Aftermarket AFFS lcd, works well at low pwm */
31 {"LTN121AT03001", 110},
32 {"LTN121AP03001", 750},
33 /* TODO: untested panels found on thinkwiki */
34 /* Generally CCFL runs best at lower PWM */
35 /* {"B121EW09 V2 ", 450}, */
36 /* {"N121IB-L05", 450}, */
37 {"LP121WX3-TLC1", 400}, /* TESTED to work best at this value */
38 /* {"LP121WX3-TLA1" 450}, */
39 /* {"B121EW03 V3 " 110}, */
40 /* {"LTN121AP02001" 110}, */
41};
42
43int get_blc_values(const struct blc_pwm_t **entries)
44{
45 *entries = blc_entries;
46 return ARRAY_SIZE(blc_entries);
47}
Arthur Heymans4cdb2b92018-11-28 16:57:15 +010048
49const char *mainboard_vbt_filename(void)
50{
51 u16 pwm_freq;
52
53 pwm_freq = get_blc_pwm_freq_value(NULL);
54
55 if (pwm_freq == 0) {
56 printk(BIOS_DEBUG,
57 "GMA: Display backlight type not found, assuming LED\n");
58 return "data_led.vbt";
59 } else if (pwm_freq > 200) {
60 printk(BIOS_DEBUG, "GMA: Using LED backlight VBT\n");
61 return "data_led.vbt";
62 } else {
63 printk(BIOS_DEBUG, "GMA: Using CCFL backlight VBT\n");
64 return "data_ccfl.vbt";
65 }
66}