forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-10-09 244b2c5ca8b14627e4a17755e5922221e121c771
kernel/drivers/firmware/efi/efi-bgrt.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0
12 /*
23 * Copyright 2012 Intel Corporation
34 * Author: Josh Triplett <josh@joshtriplett.org>
....@@ -5,10 +6,6 @@
56 * Based on the bgrt driver:
67 * Copyright 2012 Red Hat, Inc <mjg@redhat.com>
78 * Author: Matthew Garrett
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License version 2 as
11
- * published by the Free Software Foundation.
129 */
1310
1411 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
....@@ -45,7 +42,12 @@
4542 return;
4643 }
4744 *bgrt = *(struct acpi_table_bgrt *)table;
48
- if (bgrt->version != 1) {
45
+ /*
46
+ * Only version 1 is defined but some older laptops (seen on Lenovo
47
+ * Ivy Bridge models) have a correct version 1 BGRT table with the
48
+ * version set to 0, so we accept version 0 and 1.
49
+ */
50
+ if (bgrt->version > 1) {
4951 pr_notice("Ignoring BGRT: invalid version %u (expected 1)\n",
5052 bgrt->version);
5153 goto out;