.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | * video.c - ACPI Video Driver |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2004 Luming Yu <luming.yu@intel.com> |
---|
5 | 6 | * Copyright (C) 2004 Bruno Ducrot <ducrot@poupinou.org> |
---|
6 | 7 | * 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 | | - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
21 | 8 | */ |
---|
22 | 9 | |
---|
23 | 10 | #include <linux/kernel.h> |
---|
.. | .. |
---|
511 | 498 | DMI_MATCH(DMI_PRODUCT_NAME, "SATELLITE R830"), |
---|
512 | 499 | }, |
---|
513 | 500 | }, |
---|
| 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 | + }, |
---|
514 | 517 | /* |
---|
515 | 518 | * Some machine's _DOD IDs don't have bit 31(Device ID Scheme) set |
---|
516 | 519 | * but the IDs actually follow the Device ID Scheme. |
---|
.. | .. |
---|
600 | 603 | ACPI_VIDEO_FIRST_LEVEL - 1 - bqc_value; |
---|
601 | 604 | |
---|
602 | 605 | level = device->brightness->levels[bqc_value + |
---|
603 | | - ACPI_VIDEO_FIRST_LEVEL]; |
---|
| 606 | + ACPI_VIDEO_FIRST_LEVEL]; |
---|
604 | 607 | } else { |
---|
605 | 608 | level = bqc_value; |
---|
606 | 609 | } |
---|
.. | .. |
---|
721 | 724 | * event notify code. |
---|
722 | 725 | * lcd_flag : |
---|
723 | 726 | * 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) |
---|
725 | 730 | * 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) |
---|
727 | 734 | * Return Value: |
---|
728 | 735 | * -EINVAL wrong arg. |
---|
729 | 736 | */ |
---|
.. | .. |
---|
961 | 968 | int i, max_level = 0; |
---|
962 | 969 | unsigned long long level, level_old; |
---|
963 | 970 | struct acpi_video_device_brightness *br = NULL; |
---|
964 | | - int result = -EINVAL; |
---|
| 971 | + int result; |
---|
965 | 972 | |
---|
966 | 973 | result = acpi_video_get_levels(device->dev, &br, &max_level); |
---|
967 | 974 | if (result) |
---|
.. | .. |
---|
1008 | 1015 | goto out_free_levels; |
---|
1009 | 1016 | |
---|
1010 | 1017 | 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)); |
---|
1013 | 1020 | return 0; |
---|
1014 | 1021 | |
---|
1015 | 1022 | out_free_levels: |
---|
.. | .. |
---|
2205 | 2212 | if (register_count) { |
---|
2206 | 2213 | /* |
---|
2207 | 2214 | * 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. |
---|
2209 | 2216 | */ |
---|
2210 | 2217 | goto leave; |
---|
2211 | 2218 | } |
---|