Arthur Heymans | 20cb85f | 2017-04-29 14:31:32 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
Arthur Heymans | 20cb85f | 2017-04-29 14:31:32 +0200 | [diff] [blame] | 4 | * |
| 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 Heymans | 4cdb2b9 | 2018-11-28 16:57:15 +0100 | [diff] [blame] | 17 | #include <console/console.h> |
Arthur Heymans | 20cb85f | 2017-04-29 14:31:32 +0200 | [diff] [blame] | 18 | #include <northbridge/intel/gm45/gm45.h> |
Arthur Heymans | 4cdb2b9 | 2018-11-28 16:57:15 +0100 | [diff] [blame] | 19 | #include <drivers/intel/gma/opregion.h> |
Arthur Heymans | 20cb85f | 2017-04-29 14:31:32 +0200 | [diff] [blame] | 20 | |
| 21 | static const struct blc_pwm_t blc_entries[] = { |
Nico Huber | 36dafd8 | 2017-05-22 19:23:39 +0200 | [diff] [blame] | 22 | /* corrected to 320MHz CDClk, vendor set 753; works fine at both: */ |
| 23 | {"LTD121EQ3B", 447}, |
Arthur Heymans | 20cb85f | 2017-04-29 14:31:32 +0200 | [diff] [blame] | 24 | {"LTD121EWVB", 165}, |
Peter Lemenkov | 6b7d40a | 2020-01-22 11:40:16 +0100 | [diff] [blame] | 25 | {"LTD133EQ1B", 264}, /* Found on an X301 */ |
Arthur Heymans | 20cb85f | 2017-04-29 14:31:32 +0200 | [diff] [blame] | 26 | {"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 | |
| 43 | int get_blc_values(const struct blc_pwm_t **entries) |
| 44 | { |
| 45 | *entries = blc_entries; |
| 46 | return ARRAY_SIZE(blc_entries); |
| 47 | } |
Arthur Heymans | 4cdb2b9 | 2018-11-28 16:57:15 +0100 | [diff] [blame] | 48 | |
| 49 | const 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 | } |