hc
2024-05-10 9999e48639b3cecb08ffb37358bcba3b48161b29
kernel/drivers/acpi/acpi_video.c
....@@ -1,23 +1,10 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * video.c - ACPI Video Driver
34 *
45 * Copyright (C) 2004 Luming Yu <luming.yu@intel.com>
56 * Copyright (C) 2004 Bruno Ducrot <ducrot@poupinou.org>
67 * Copyright (C) 2006 Thomas Tuttle <linux-kernel@ttuttle.net>
7
- *
8
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
9
- *
10
- * This program is free software; you can redistribute it and/or modify
11
- * it under the terms of the GNU General Public License as published by
12
- * the Free Software Foundation; either version 2 of the License, or (at
13
- * your option) any later version.
14
- *
15
- * This program is distributed in the hope that it will be useful, but
16
- * WITHOUT ANY WARRANTY; without even the implied warranty of
17
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18
- * General Public License for more details.
19
- *
20
- * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
218 */
229
2310 #include <linux/kernel.h>
....@@ -511,6 +498,22 @@
511498 DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE R830"),
512499 },
513500 },
501
+ {
502
+ .callback = video_disable_backlight_sysfs_if,
503
+ .ident = "Toshiba Satellite Z830",
504
+ .matches = {
505
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
506
+ DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE Z830"),
507
+ },
508
+ },
509
+ {
510
+ .callback = video_disable_backlight_sysfs_if,
511
+ .ident = "Toshiba Portege Z830",
512
+ .matches = {
513
+ DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"),
514
+ DMI_MATCH(DMI_PRODUCT_NAME, "PORTEGE Z830"),
515
+ },
516
+ },
514517 /*
515518 * Some machine's _DOD IDs don't have bit 31(Device ID Scheme) set
516519 * but the IDs actually follow the Device ID Scheme.
....@@ -600,7 +603,7 @@
600603 ACPI_VIDEO_FIRST_LEVEL - 1 - bqc_value;
601604
602605 level = device->brightness->levels[bqc_value +
603
- ACPI_VIDEO_FIRST_LEVEL];
606
+ ACPI_VIDEO_FIRST_LEVEL];
604607 } else {
605608 level = bqc_value;
606609 }
....@@ -721,9 +724,13 @@
721724 * event notify code.
722725 * lcd_flag :
723726 * 0. The system BIOS should automatically control the brightness level
724
- * of the LCD when the power changes from AC to DC
727
+ * of the LCD when:
728
+ * - the power changes from AC to DC (ACPI appendix B)
729
+ * - a brightness hotkey gets pressed (implied by Win7/8 backlight docs)
725730 * 1. The system BIOS should NOT automatically control the brightness
726
- * level of the LCD when the power changes from AC to DC.
731
+ * level of the LCD when:
732
+ * - the power changes from AC to DC (ACPI appendix B)
733
+ * - a brightness hotkey gets pressed (implied by Win7/8 backlight docs)
727734 * Return Value:
728735 * -EINVAL wrong arg.
729736 */
....@@ -961,7 +968,7 @@
961968 int i, max_level = 0;
962969 unsigned long long level, level_old;
963970 struct acpi_video_device_brightness *br = NULL;
964
- int result = -EINVAL;
971
+ int result;
965972
966973 result = acpi_video_get_levels(device->dev, &br, &max_level);
967974 if (result)
....@@ -1008,8 +1015,8 @@
10081015 goto out_free_levels;
10091016
10101017 ACPI_DEBUG_PRINT((ACPI_DB_INFO,
1011
- "found %d brightness levels\n",
1012
- br->count - ACPI_VIDEO_FIRST_LEVEL));
1018
+ "found %d brightness levels\n",
1019
+ br->count - ACPI_VIDEO_FIRST_LEVEL));
10131020 return 0;
10141021
10151022 out_free_levels:
....@@ -2205,7 +2212,7 @@
22052212 if (register_count) {
22062213 /*
22072214 * if the function of acpi_video_register is already called,
2208
- * don't register the acpi_vide_bus again and return no error.
2215
+ * don't register the acpi_video_bus again and return no error.
22092216 */
22102217 goto leave;
22112218 }