linux/drivers/acpi/video.c
<<
ion 2.6/spa > 2.6/form> 2.6a ion 2. href="../linux+v3.7.4/drivers/acpi/video.c">ion 2.6img src="../.static/gfx/right.png" alt=">>">io6/spa > io6spa class="lxr_search">ion ion 2.6input typionhidden" namionnavtarget" /option">ion 2.6input typiontext" namionsearch" idonsearch">ion 2.6butt13Search 2.6/form> 6/spa > io6spa class="lxr_prefs"> 2.6a href="+prefs?return=drivers/acpi/video.c"ion 2. onclick="return ajax_prefs();">ion 2.Prefs 2.6/a>io6/spa > n 2. .6/div> n 2. .6form ac ="ajax+*" method="post" onsubmit="return false;">io6input typionhidden" namionajax_lookup" idonajax_lookup" /option">in 2. .6/form> in 2. .6div class="headingbott1m">
n 2.
n 2. 2. .6div idonsearch_results" class="search_results" 2> n 2. .6/div> 6div idoncontent"> 6div idonfile_contents">
. .16/a>6spa  class="comment">/*6/spa >
. .26/a>6spa  class="comment"> *lueideo.c - ACPI Video Driver ($Revis	  :$)6/spa >
. .36/a>6spa  class="comment"> *6/spa >
. .46/a>6spa  class="comment"> *luCopyright (C) 2004 Luming Yu <luming.yu@intel.com>6/spa >
. .56/a>6spa  class="comment"> *luCopyright (C) 2004 Bruno Ducrot <ducrot@poupinou.org>6/spa >
. .66/a>6spa  class="comment"> *luCopyright (C) 2006 Thomas Tuttle <linux-kernel@ttuttle.net>6/spa >
. .76/a>6spa  class="comment"> *6/spa >
. .86/a>6spa  class="comment"> *l~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~6/spa >
. .96/a>6spa  class="comment"> *6/spa >
. valua>6spa  class="comment"> *luThis program is free software; you ca  redistribute it and/or modify6/spa >
. 116/a>6spa  class="comment"> *luit under the terms of the GNU General Public License as published by6/spa >
. 126/a>6spa  class="comment"> *luthe Free Software Founda
	  ; either vers.13<2 of the License, or (at6/spa >
. 136/a>6spa  class="comment"> *  your 3"
	  ) any later vers.13.6/spa >
. 146/a>6spa  class="comment"> *6/spa >
. 156/a>6spa  class="comment"> *luThis program is distributed in the hope thatuit will be useful, but6/spa >
. 166/a>6spa  class="comment"> *luWITHOUT ANY WARRANTY; without even the implied warranty of6/spa >
. 176/a>6spa  class="comment"> *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU6/spa >
. 186/a>6spa  class="comment"> *l General Public License for more details.6/spa >
. 196/a>6spa  class="comment"> *6/spa >
. 2alua>6spa  class="comment"> *luYou should have received a copy of the GNU General Public License along6/spa >
. 216/a>6spa  class="comment"> *luwith this program; if not, write touthe Free Software Founda
	  , Inc.,6/spa >
. 226/a>6spa  class="comment"> *lu59 Temple Place, Suite 330, Bost  , MA 02111-1307 USA.6/spa >
. 236/a>6spa  class="comment"> *6/spa >
. 246/a>6spa  class="comment"> *l~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~6/spa >
. 256/a>6spa  class="comment"> */6/spa >
. 266/a>
. 276/a>#include <linux/kernel.h6/a>>
. 286/a>#include <linux/module.h6/a>>
. 296/a>#include <linux/init.h6/a>>
. 306/a>#include <linux/typis.h6/a>>
. 316/a>#include <linux/list.h6/a>>
. 326/a>#include <linux/mutex.h6/a>>
. 336/a>#include <linux/input.h6/a>>
. 346/a>#include <linux/backlight.h6/a>>
. 356/a>#include <linux/thermal.h6/a>>
. 366/a>#include <linux/sort.h6/a>>
. 376/a>#include <linux/pci.h6/a>>
. 386/a>#include <linux/pci_ids.h6/a>>
. 396/a>#include <linux/slab.h6/a>>
. 406/a>#include <asm/uaccess.h6/a>>
. 416/a>#include <linux/dmi.h6/a>>
. 426/a>#include <acpi/acpi_bus.h6/a>>
. 436/a>#include <acpi/acpi_drivers.h6/a>>
. 446/a>#include <linux/suspend.h6/a>>
. 456/a>#include <acpi/video.h6/a>>
. 466/a>
. 476/a>#define.6a href="+code=PREFIX" class="sref">PREFIX6/a> 6spa  class="string">"ACPI: "6/spa >
. 486/a>
. 496/a>#define.6a href="+code=ACPI_VIDEO_BUS_NAME" class="sref">ACPI_VIDEO_BUS_NAME6/a>             6spa  class="string">"Video Bus"6/spa >
. 506/a>#define.6a href="+code=ACPI_VIDEO_DEVICE_NAME" class="sref">ACPI_VIDEO_DEVICE_NAME6/a>          6spa  class="string">"Video Device"6/spa >
. 516/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_SWITCH" class="sref">ACPI_VIDEO_NOTIFY_SWITCH6/a>        0x80
. 526/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_PROBE" class="sref">ACPI_VIDEO_NOTIFY_PROBE6/a>         0x81
. 536/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_CYCLE" class="sref">ACPI_VIDEO_NOTIFY_CYCLE6/a>         0x82
. 546/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_NEXT_OUTPUT" class="sref">ACPI_VIDEO_NOTIFY_NEXT_OUTPUT6/a>   0x83
. 556/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_PREV_OUTPUT" class="sref">ACPI_VIDEO_NOTIFY_PREV_OUTPUT6/a>   0x84
. 566/a>
. 576/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS6/a>      0x85
. 586/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS6/a>        0x86
. 596/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS6/a>        0x87
. 606/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS6/a>       0x88
. 616/a>#define.6a href="+code=ACPI_VIDEO_NOTIFY_DISPLAY_OFF" class="sref">ACPI_VIDEO_NOTIFY_DISPLAY_OFF6/a>           0x89
. 626/a>
. 636/a>#define.6a href="+code=MAX_NAME_LEN" class="sref">MAX_NAME_LEN6/a>    20
. 646/a>
. 656/a>#define.6a href="+code=_COMPONENT" class="sref">_COMPONENT6/a>             .6a href="+code=ACPI_VIDEO_COMPONENT" class="sref">ACPI_VIDEO_COMPONENT6/a>
. 666/a>6a href="+code=ACPI_MODULE_NAME" class="sref">ACPI_MODULE_NAME6/a>(6spa  class="string">"video"6/spa >);
. 676/a>
. 686/a>6a href="+code=MODULE_AUTHOR" class="sref">MODULE_AUTHOR6/a>(6spa  class="string">"Bruno Ducrot"6/spa >);
. 696/a>6a href="+code=MODULE_DESCRIPTION" class="sref">MODULE_DESCRIPTION6/a>(6spa  class="string">"ACPI Video Driver"6/spa >);
. 706/a>6a href="+code=MODULE_LICENSE" class="sref">MODULE_LICENSE6/a>(6spa  class="string">"GPL"6/spa >);
. 716/a>
. 726/a>static.6a href="+code=bool" class="sref">bool6/a> 6a href="+code=brightness_switch_enabled" class="sref">brightness_switch_enabled6/a> = 1;
. 736/a>6a href="+code=module_param" class="sref">module_param6/a>(6a href="+code=brightness_switch_enabled" class="sref">brightness_switch_enabled6/a>,.6a href="+code=bool" class="sref">bool6/a>, 0644);
. 746/a>
. 756/a>6spa  class="comment">/*6/spa >
. 766/a>6spa  class="comment"> *lBy default, we don't allow duplicate ACPI video bus devices6/spa >
. 776/a>6spa  class="comment"> * under the sami VGA controller6/spa >
. 786/a>6spa  class="comment"> */6/spa >
. 796/a>static.6a href="+code=bool" class="sref">bool6/a> 6a href="+code=allow_duplicates" class="sref">allow_duplicates6/a>;
. 806/a>6a href="+code=module_param" class="sref">module_param6/a>(6a href="+code=allow_duplicates" class="sref">allow_duplicates6/a>,.6a href="+code=bool" class="sref">bool6/a>, 0644);
. 816/a>
. 826/a>6spa  class="comment">/*6/spa >
. 836/a>6spa  class="comment"> * Somi BIOSes claim they use minimum backlight at boot,6/spa >
. 846/a>6spa  class="comment"> *land this may bring dimming screen after boot6/spa >
. 856/a>6spa  class="comment"> */6/spa >
. 866/a>static.6a href="+code=bool" class="sref">bool6/a> 6a href="+code=use_bios_initial_backlight" class="sref">use_bios_initial_backlight6/a> = 1;
. 876/a>6a href="+code=module_param" class="sref">module_param6/a>(6a href="+code=use_bios_initial_backlight" class="sref">use_bios_initial_backlight6/a>,.6a href="+code=bool" class="sref">bool6/a>, 0644);
. 886/a>
. 896/a>static.int.6a href="+code=register_count" class="sref">register_count6/a> = 0;
. 906/a>static.int.6a href="+code=acpi_video_bus_add" class="sref">acpi_video_bus_add6/a>(struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>);
. 916/a>static.int.6a href="+code=acpi_video_bus_remove" class="sref">acpi_video_bus_remove6/a>(struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>,.int.6a href="+code=typi" class="sref">typi6/a>);
. 926/a>static.void.6a href="+code=acpi_video_bus_notify" class="sref">acpi_video_bus_notify6/a>(struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>,.6a href="+code=u32" class="sref">u326/a>.6a href="+code=event" class="sref">event6/a>);
. 936/a>
. 946/a>static.const struct.6a href="+code=acpi_device_id" class="sref">acpi_device_id6/a>.6a href="+code=video_device_ids" class="sref">video_device_ids6/a>[] = {
. 956/a>        {6a href="+code=ACPI_VIDEO_HID" class="sref">ACPI_VIDEO_HID6/a>, 0},
. 966/a>        {6spa  class="string">""6/spa >, 0},
. 976/a>};
. 986/a>6a href="+code=MODULE_DEVICE_TABLE" class="sref">MODULE_DEVICE_TABLE6/a>(6a href="+code=acpi" class="sref">acpi6/a>,.6a href="+code=video_device_ids" class="sref">video_device_ids6/a>);
. 996/a>
.1006/a>static.struct.6a href="+code=acpi_driver" class="sref">acpi_driver6/a> 6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> = {
.1016/a>        .6a href="+code=nami" class="sref">nami6/a> = 6spa  class="string">"video"6/spa >,
.1026/a>        .6a href="+code=class" class="sref">class6/a> = 6a href="+code=ACPI_VIDEO_CLASS" class="sref">ACPI_VIDEO_CLASS6/a>,
.1036/a>        .6a href="+code=ids" class="sref">ids6/a> = 6a href="+code=video_device_ids" class="sref">video_device_ids6/a>,
.1046/a>        .6a href="+code=ops" class="sref">ops6/a> = {
.1056/a>                .6a href="+code=add" class="sref">add6/a> = 6a href="+code=acpi_video_bus_add" class="sref">acpi_video_bus_add6/a>,
.1066/a>                .6a href="+code=remove" class="sref">remove6/a> = 6a href="+code=acpi_video_bus_remove" class="sref">acpi_video_bus_remove6/a>,
.1076/a>                .6a href="+code=notify" class="sref">notify6/a> = 6a href="+code=acpi_video_bus_notify" class="sref">acpi_video_bus_notify6/a>,
.1086/a>                },
.1096/a>};
.1valua>
.1116/a>struct.6a href="+code=acpi_video_bus_flags" class="sref">acpi_video_bus_flags6/a> {
.1126/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=multihead" class="sref">multihead6/a>:1;        .6spa  class="comment">/* ca  switch video heads */6/spa >
.1136/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=rom" class="sref">rom6/a>:1;        .     .6spa  class="comment">/* ca  retrieve a video rom */6/spa >
.1146/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=post" class="sref">post6/a>:1;        .     6spa  class="comment">/* ca  configure the head tou*/6/spa >
.1156/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=reserved" class="sref">reserved6/a>:5;
.1166/a>};
.1176/a>
.1186/a>struct.6a href="+code=acpi_video_bus_cap" class="sref">acpi_video_bus_cap6/a> {
.1196/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_DOS" class="sref">_DOS6/a>:1;        .     6spa  class="comment">/*Enable/Disable output switching */6/spa >
.12alua>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_DOD" class="sref">_DOD6/a>:1;        .     6spa  class="comment">/*Enumerate all devices attached toudisplay adapter */6/spa >
.121lua>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_ROM" class="sref">_ROM6/a>:1;        .     6spa  class="comment">/*Get ROM Data */6/spa >
.1226/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_GPD" class="sref">_GPD6/a>:1;        .     6spa  class="comment">/*Get POST Device */6/spa >
.1236/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_SPD" class="sref">_SPD6/a>:1;        .     6spa  class="comment">/*Set POST Device */6/spa >
.1246/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_VPO" class="sref">_VPO6/a>:1;        .     6spa  class="comment">/*Video POST O"
	  s */6/spa >
.1256/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=reserved" class="sref">reserved6/a>:2;
.1266/a>};
.1276/a>
.1286/a>struct.6a href="+code=acpi_video_device_attrib" class="sref">acpi_video_device_attrib6/a> {
.1296/a>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=display_index" class="sref">display_index6/a>:4;    6spa  class="comment">/* A zero-based instance of the Display */6/spa >
.13alua>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=display_port_attachment" class="sref">display_port_attachment6/a>:4;  6spa  class="comment">/*This fieldudifferentiates the display typi */6/spa >
.131lua>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=display_typi" class="sref">display_typi6/a>:4;     6spa  class="comment">/*Describe the specific typi in use */6/spa >
.1326/a>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=vendor_specific" class="sref">vendor_specific6/a>:4;  6spa  class="comment">/*Chipset Vendor Specific */6/spa >
.1336/a>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=bios_ca _detect" class="sref">bios_ca _detect6/a>:1;  6spa  class="comment">/*BIOS ca  detect the device */6/spa >
.1346/a>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=depend_on_vga" class="sref">depend_on_vga6/a>:1;    6spa  class="comment">/*Non-VGA output device whose power is related tou6/spa >
.1356/a>6spa  class="comment">                                   the VGA device. */6/spa >
.1366/a>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=pipe_id" class="sref">pipe_id6/a>:3;        . 6spa  class="comment">/*For VGA multiple-head devices. */6/spa >
.1376/a>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=reserved" class="sref">reserved6/a>:10;      . 6spa  class="comment">/*Must be 0 */6/spa >
.1386/a>        6a href="+code=u32" class="sref">u326/a>.6a href="+code=device_id_schemi" class="sref">device_id_schemi6/a>:1; 6spa  class="comment">/*Device ID Schemi */6/spa >
.1396/a>};
.14alua>
.1416/a>struct.6a href="+code=acpi_video_enumerated_device" class="sref">acpi_video_enumerated_device6/a> {
.1426/a>        un.13<{
.1436/a>                6a href="+code=u32" class="sref">u326/a>.6a href="+code=int_val" class="sref">int_val6/a>;
.1446/a>                struct.6a href="+code=acpi_video_device_attrib" class="sref">acpi_video_device_attrib6/a> 6a href="+code=attrib" class="sref">attrib6/a>;
.1456/a>        }.6a href="+code=vopti" class="sref">vopti6/a>;
.1466/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=bind_info" class="sref">bind_info6/a>;
.1476/a>};
.1486/a>
.1496/a>struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> {
.1506/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>;
.151lua>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=dos_setting" class="sref">dos_setting6/a>;
.1526/a>        struct.6a href="+code=acpi_video_enumerated_device" class="sref">acpi_video_enumerated_device6/a> *6a href="+code=attached_array" class="sref">attached_array6/a>;
.1536/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=attached_count" class="sref">attached_count6/a>;
.1546/a>        struct.6a href="+code=acpi_video_bus_cap" class="sref">acpi_video_bus_cap6/a> 6a href="+code=cap" class="sref">cap6/a>;
.1556/a>        struct.6a href="+code=acpi_video_bus_flags" class="sref">acpi_video_bus_flags6/a> 6a href="+code=flags" class="sref">flags6/a>;
.1566/a>        struct.6a href="+code=list_head" class="sref">list_head6/a>.6a href="+code=video_device_list" class="sref">video_device_list6/a>;
.1576/a>        struct.6a href="+code=mutex" class="sref">mutex6/a>.6a href="+code=device_list_lock" class="sref">device_list_lock6/a>;  6spa  class="comment">/* protects video_device_list */6/spa >
.1586/a>        struct.6a href="+code=input_dev" class="sref">input_dev6/a> *6a href="+code=input" class="sref">input6/a>;
.1596/a>        char.6a href="+code=phys" class="sref">phys6/a>[32];  6spa  class="comment">/* for input device */6/spa >
.1606/a>        struct.6a href="+code=notifier_block" class="sref">notifier_block6/a>.6a href="+code=pm_nb" class="sref">pm_nb6/a>;
.1616/a>};
.1626/a>
.1636/a>struct.6a href="+code=acpi_video_device_flags" class="sref">acpi_video_device_flags6/a> {
.1646/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=crt" class="sref">crt6/a>:1;
.1656/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=lcd" class="sref">lcd6/a>:1;
.1666/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=tvout" class="sref">tvout6/a>:1;
.1676/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=dvi" class="sref">dvi6/a>:1;
.1686/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=bios" class="sref">bios6/a>:1;
.1696/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=unknown" class="sref">unknown6/a>:1;
.17alua>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=reserved" class="sref">reserved6/a>:2;
.1716/a>};
.1726/a>
.1736/a>struct.6a href="+code=acpi_video_device_cap" class="sref">acpi_video_device_cap6/a> {
.1746/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_ADR" class="sref">_ADR6/a>:1;        .     6spa  class="comment">/*Return the unique ID */6/spa >
.1756/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BCL" class="sref">_BCL6/a>:1;        .     6spa  class="comment">/*Query list of brightness control levels supported */6/spa >
.1766/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BCM" class="sref">_BCM6/a>:1;        .     6spa  class="comment">/*Set the brightness level */6/spa >
.1776/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BQC" class="sref">_BQC6/a>:1;        .     6spa  class="comment">/* Get current brightness level */6/spa >
.1786/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BCQ" class="sref">_BCQ6/a>:1;        .     6spa  class="comment">/* Somi buggy BIOS uses _BCQ instead of _BQC */6/spa >
.1796/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_DDC" class="sref">_DDC6/a>:1;        .     6spa  class="comment">/*Return the EDID for this device */6/spa >
.1806/a>};
.1816/a>
.1826/a>struct.6a href="+code=acpi_video_brightness_flags" class="sref">acpi_video_brightness_flags6/a> {
.1836/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BCL_no_ac_battery_levels" class="sref">_BCL_no_ac_battery_levels6/a>:1; 6spa  class="comment">/* no AC/Battery levels in _BCL */6/spa >
.1846/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BCL_reversed" class="sref">_BCL_reversed6/a>:1;        .    6spa  class="comment">/* _BCL package is in a reversed order*/6/spa >
.1856/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BCL_use_index" class="sref">_BCL_use_index6/a>:1;        .   6spa  class="comment">/* levels in _BCL are index voptis */6/spa >
.1866/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BCM_use_index" class="sref">_BCM_use_index6/a>:1;        .   6spa  class="comment">/* input of _BCM is a  index vopti */6/spa >
.1876/a>        6a href="+code=u8" class="sref">u86/a> 6a href="+code=_BQC_use_index" class="sref">_BQC_use_index6/a>:1;        .   6spa  class="comment">/* _BQC returns a  index vopti */6/spa >
.1886/a>};
.1896/a>
.1906/a>struct.6a href="+code=acpi_video_device_brightness" class="sref">acpi_video_device_brightness6/a> {
.191lua>        int.6a href="+code=curr" class="sref">curr6/a>;
.192lua>        int.6a href="+code=count" class="sref">count6/a>;
.193lua>        int.*6a href="+code=levels" class="sref">levels6/a>;
.1946/a>        struct.6a href="+code=acpi_video_brightness_flags" class="sref">acpi_video_brightness_flags6/a> 6a href="+code=flags" class="sref">flags6/a>;
.1956/a>};
.1966/a>
.1976/a>struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> {
.1986/a>        unsigned long.6a href="+code=device_id" class="sref">device_id6/a>;
.1996/a>        struct.6a href="+code=acpi_video_device_flags" class="sref">acpi_video_device_flags6/a> 6a href="+code=flags" class="sref">flags6/a>;
.2006/a>        struct.6a href="+code=acpi_video_device_cap" class="sref">acpi_video_device_cap6/a> 6a href="+code=cap" class="sref">cap6/a>;
.2016/a>        struct.6a href="+code=list_head" class="sref">list_head6/a>.6a href="+code=entry" class="sref">entry6/a>;
.2026/a>        struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>;
.2036/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=dev" class="sref">dev6/a>;
.2046/a>        struct.6a href="+code=acpi_video_device_brightness" class="sref">acpi_video_device_brightness6/a> *6a href="+code=brightness" class="sref">brightness6/a>;
.2056/a>        struct.6a href="+code=backlight_device" class="sref">backlight_device6/a> *6a href="+code=backlight" class="sref">backlight6/a>;
.2066/a>        struct.6a href="+code=thermal_cooling_device" class="sref">thermal_cooling_device6/a> *6a href="+code=cooling_dev" class="sref">cooling_dev6/a>;
.2076/a>};
.2086/a>
.2096/a>static.const char.6a href="+code=device_decode" class="sref">device_decode6/a>[][30] = {
.21alua>        6spa  class="string">"motherboard VGA device"6/spa >,
.211lua>        6spa  class="string">"PCI VGA device"6/spa >,
.2126/a>        6spa  class="string">"AGP VGA device"6/spa >,
.2136/a>        6spa  class="string">"UNKNOWN"6/spa >,
.2146/a>};
.2156/a>
.2166/a>static.void.6a href="+code=acpi_video_device_notify" class="sref">acpi_video_device_notify6/a>(6a href="+code=acpi_handle" class="sref">acpi_handle6/a>.6a href="+code=handle" class="sref">handle6/a>,.6a href="+code=u32" class="sref">u326/a>.6a href="+code=event" class="sref">event6/a>,.void.*6a href="+code=data" class="sref">data6/a>);
.2176/a>static.void.6a href="+code=acpi_video_device_rebind" class="sref">acpi_video_device_rebind6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>);
.2186/a>static.void.6a href="+code=acpi_video_device_bind" class="sref">acpi_video_device_bind6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>,
.2196/a>                                   struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>);
.2206/a>static.int.6a href="+code=acpi_video_device_enumerate" class="sref">acpi_video_device_enumerate6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>);
.2216/a>static.int.6a href="+code=acpi_video_device_lcd_set_level" class="sref">acpi_video_device_lcd_set_level6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>,
.2226/a>                        int.6a href="+code=level" class="sref">level6/a>);
.2236/a>static.int.6a href="+code=acpi_video_device_lcd_get_level_current" class="sref">acpi_video_device_lcd_get_level_current6/a>(
.2246/a>                        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>,
.2256/a>                        unsigned long.long.*6a href="+code=level" class="sref">level6/a>,.int.6a href="+code=init" class="sref">init6/a>);
.2266/a>static.int.6a href="+code=acpi_video_get_next_level" class="sref">acpi_video_get_next_level6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>,
.2276/a>                                     6a href="+code=u32" class="sref">u326/a>.6a href="+code=level_current" class="sref">level_current6/a>,.6a href="+code=u32" class="sref">u326/a>.6a href="+code=event" class="sref">event6/a>);
.2286/a>static.int.6a href="+code=acpi_video_switch_brightness" class="sref">acpi_video_switch_brightness6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>,
.2296/a>                                         int.6a href="+code=event" class="sref">event6/a>);
.23alua>
.231lua>6spa  class="comment">/*backlight device sysfs support*/6/spa >
.2326/a>static.int.6a href="+code=acpi_video_get_brightness" class="sref">acpi_video_get_brightness6/a>(struct.6a href="+code=backlight_device" class="sref">backlight_device6/a> *6a href="+code=bd" class="sref">bd6/a>)
.2336/a>{
.2346/a>        unsigned long.long.6a href="+code=cur_level" class="sref">cur_level6/a>;
.2356/a>        int.6a href="+code=i" class="sref">i6/a>;
.2366/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=vd" class="sref">vd6/a> =
.2376/a>                (struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *)6a href="+code=bl_get_data" class="sref">bl_get_data6/a>(6a href="+code=bd" class="sref">bd6/a>);
.2386/a>
.2396/a>        if (6a href="+code=acpi_video_device_lcd_get_level_current" class="sref">acpi_video_device_lcd_get_level_current6/a>(6a href="+code=vd" class="sref">vd6/a>, &6a href="+code=cur_level" class="sref">cur_level6/a>, 0))
.2406/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.241lua>        for (6a href="+code=i" class="sref">i6/a> = 2;.6a href="+code=i" class="sref">i6/a> <.6a href="+code=vd" class="sref">vd6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a>;.6a href="+code=i" class="sref">i6/a>++) {
.2426/a>                if (6a href="+code=vd" class="sref">vd6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a>] == 6a href="+code=cur_level" class="sref">cur_level6/a>)
.2436/a>                        6spa  class="comment">/* The first two entries are special - see page 5756/spa >
.2446/a>6spa  class="comment">                           of the ACPI spec 3.0 */6/spa >
.2456/a>                        return 6a href="+code=i" class="sref">i6/a>-2;
.2466/a>        }
.2476/a>        return 0;
.2486/a>}
.2496/a>
.2506/a>static.int.6a href="+code=acpi_video_set_brightness" class="sref">acpi_video_set_brightness6/a>(struct.6a href="+code=backlight_device" class="sref">backlight_device6/a> *6a href="+code=bd" class="sref">bd6/a>)
.251lua>{
.252lua>        int.6a href="+code=request_level" class="sref">request_level6/a> = 6a href="+code=bd" class="sref">bd6/a>->6a href="+code=props" class="sref">props6/a>.6a href="+code=brightness" class="sref">brightness6/a> + 2;
.2536/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=vd" class="sref">vd6/a> =
.2546/a>                (struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *)6a href="+code=bl_get_data" class="sref">bl_get_data6/a>(6a href="+code=bd" class="sref">bd6/a>);
.2556/a>
.2566/a>        return 6a href="+code=acpi_video_device_lcd_set_level" class="sref">acpi_video_device_lcd_set_level6/a>(6a href="+code=vd" class="sref">vd6/a>,
.2576/a>                                6a href="+code=vd" class="sref">vd6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=request_level" class="sref">request_level6/a>]);
.2586/a>}
.2596/a>
.2606/a>static.const struct.6a href="+code=backlight_ops" class="sref">backlight_ops6/a>.6a href="+code=acpi_backlight_ops" class="sref">acpi_backlight_ops6/a> = {
.2616/a>        .6a href="+code=get_brightness" class="sref">get_brightness6/a> = 6a href="+code=acpi_video_get_brightness" class="sref">acpi_video_get_brightness6/a>,
.2626/a>        .6a href="+code=update_status" class="sref">update_status6/a>  = 6a href="+code=acpi_video_set_brightness" class="sref">acpi_video_set_brightness6/a>,
.2636/a>};
.2646/a>
.2656/a>6spa  class="comment">/* thermal cooling device callbacks */6/spa >
.2666/a>static.int.6a href="+code=video_get_max_state" class="sref">video_get_max_state6/a>(struct.6a href="+code=thermal_cooling_device" class="sref">thermal_cooling_device6/a> *6a href="+code=cooling_dev" class="sref">cooling_dev6/a>, unsigned
.2676/a>                               long.*6a href="+code=state" class="sref">state6/a>)
.2686/a>{
.2696/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a> = 6a href="+code=cooling_dev" class="sref">cooling_dev6/a>->6a href="+code=devdata" class="sref">devdata6/a>;
.2706/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=video" class="sref">video6/a> = 6a href="+code=acpi_driver_data" class="sref">acpi_driver_data6/a>(6a href="+code=device" class="sref">device6/a>);
.2716/a>
.2726/a>        *6a href="+code=state" class="sref">state6/a> = 6a href="+code=video" class="sref">video6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a> - 3;
.2736/a>        return 0;
.2746/a>}
.2756/a>
.2766/a>static.int.6a href="+code=video_get_cur_state" class="sref">video_get_cur_state6/a>(struct.6a href="+code=thermal_cooling_device" class="sref">thermal_cooling_device6/a> *6a href="+code=cooling_dev" class="sref">cooling_dev6/a>, unsigned
.2776/a>                               long.*6a href="+code=state" class="sref">state6/a>)
.2786/a>{
.2796/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a> = 6a href="+code=cooling_dev" class="sref">cooling_dev6/a>->6a href="+code=devdata" class="sref">devdata6/a>;
.2806/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=video" class="sref">video6/a> = 6a href="+code=acpi_driver_data" class="sref">acpi_driver_data6/a>(6a href="+code=device" class="sref">device6/a>);
.2816/a>        unsigned long.long.6a href="+code=level" class="sref">level6/a>;
.282lua>        int.6a href="+code=offset" class="sref">offset6/a>;
.2836/a>
.2846/a>        if (6a href="+code=acpi_video_device_lcd_get_level_current" class="sref">acpi_video_device_lcd_get_level_current6/a>(6a href="+code=video" class="sref">video6/a>, &6a href="+code=level" class="sref">level6/a>,.0))
.2856/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.2866/a>        for (6a href="+code=offset" class="sref">offset6/a> = 2;.6a href="+code=offset" class="sref">offset6/a> <.6a href="+code=video" class="sref">video6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a>;.6a href="+code=offset" class="sref">offset6/a>++)
.2876/a>                if (6a href="+code=level" class="sref">level6/a> == 6a href="+code=video" class="sref">video6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=offset" class="sref">offset6/a>]) {
.2886/a>                        *6a href="+code=state" class="sref">state6/a> = 6a href="+code=video" class="sref">video6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a> - 6a href="+code=offset" class="sref">offset6/a> - 1;
.2896/a>                        return 0;
.2906/a>                }
.2916/a>
.292lua>        return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.293lua>}
.2946/a>
.2956/a>static.int
.2966/a>6a href="+code=video_set_cur_state" class="sref">video_set_cur_state6/a>(struct.6a href="+code=thermal_cooling_device" class="sref">thermal_cooling_device6/a> *6a href="+code=cooling_dev" class="sref">cooling_dev6/a>, unsigned.long.6a href="+code=state" class="sref">state6/a>)
.2976/a>{
.2986/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a> = 6a href="+code=cooling_dev" class="sref">cooling_dev6/a>->6a href="+code=devdata" class="sref">devdata6/a>;
.2996/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=video" class="sref">video6/a> = 6a href="+code=acpi_driver_data" class="sref">acpi_driver_data6/a>(6a href="+code=device" class="sref">device6/a>);
.3006/a>        int.6a href="+code=level" class="sref">level6/a>;
.3016/a>
.3026/a>        if (.6a href="+code=state" class="sref">state6/a> >= 6a href="+code=video" class="sref">video6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a> - 2)
.3036/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.3046/a>
.3056/a>        6a href="+code=state" class="sref">state6/a> = 6a href="+code=video" class="sref">video6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a> - 6a href="+code=state" class="sref">state6/a>;
.3066/a>        6a href="+code=level" class="sref">level6/a> = 6a href="+code=video" class="sref">video6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=state" class="sref">state6/a> -1];
.3076/a>        return 6a href="+code=acpi_video_device_lcd_set_level" class="sref">acpi_video_device_lcd_set_level6/a>(6a href="+code=video" class="sref">video6/a>, 6a href="+code=level" class="sref">level6/a>);
.3086/a>}
.3096/a>
.3106/a>static.const struct.6a href="+code=thermal_cooling_device_ops" class="sref">thermal_cooling_device_ops6/a> 6a href="+code=video_cooling_ops" class="sref">video_cooling_ops6/a> = {
.3116/a>        .6a href="+code=get_max_state" class="sref">get_max_state6/a> = 6a href="+code=video_get_max_state" class="sref">video_get_max_state6/a>,
.3126/a>        .6a href="+code=get_cur_state" class="sref">get_cur_state6/a> = 6a href="+code=video_get_cur_state" class="sref">video_get_cur_state6/a>,
.3136/a>        .6a href="+code=set_cur_state" class="sref">set_cur_state6/a> = 6a href="+code=video_set_cur_state" class="sref">video_set_cur_state6/a>,
.3146/a>};
.3156/a>
.3166/a>6spa  class="comment">/* --------------------------------------------------------------------------6/spa >
.3176/a>6spa  class="comment">                               Video Management6/spa >
.3186/a>6spa  class="comment">   -------------------------------------------------------------------------- */6/spa >
.3196/a>
.3206/a>static.int
.3216/a>6a href="+code=acpi_video_device_lcd_query_levels" class="sref">acpi_video_device_lcd_query_levels6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>,
.3226/a>                                   union 6a href="+code=acpi_object" class="sref">acpi_object6/a> **6a href="+code=levels" class="sref">levels6/a>)
.3236/a>{
.3246/a>        int.6a href="+code=status" class="sref">status6/a>;
.3256/a>        struct.6a href="+code=acpi_buffer" class="sref">acpi_buffer6/a> 6a href="+code=buffer" class="sref">buffer6/a> = { 6a href="+code=ACPI_ALLOCATE_BUFFER" class="sref">ACPI_ALLOCATE_BUFFER6/a>, 6a href="+code=NULL" class="sref">NULL6/a> };
.3266/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *6a href="+code=obj" class="sref">obj6/a>;
.3276/a>
.3286/a>
.3296/a>        *6a href="+code=levels" class="sref">levels6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
.33alua>
.331lua>        6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_evoptate_object" class="sref">acpi_evoptate_object6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_BCL"6/spa >, 6a href="+code=NULL" class="sref">NULL6/a>, &6a href="+code=buffer" class="sref">buffer6/a>);
.3326/a>        if (!6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=status" class="sref">status6/a>))
.3336/a>                return 6a href="+code=status" class="sref">status6/a>;
.3346/a>        6a href="+code=obj" class="sref">obj6/a> = (union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *)6a href="+code=buffer" class="sref">buffer6/a>.6a href="+code=pointer" class="sref">pointer6/a>;
.3356/a>        if (!6a href="+code=obj" class="sref">obj6/a> || (6a href="+code=obj" class="sref">obj6/a>->6a href="+code=type" class="sref">type6/a> != 6a href="+code=ACPI_TYPE_PACKAGE" class="sref">ACPI_TYPE_PACKAGE6/a>)) {
.3366/a>                6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a> 6spa  class="string">"Invopid _BCL data\n"6/spa >);
.3376/a>                6a href="+code=status" class="sref">status6/a> = -6a href="+code=EFAULT" class="sref">EFAULT6/a>;
.3386/a>                goto.6a href="+code=err" class="sref">err6/a>;
.3396/a>        }
.34alua>
.341lua>        *6a href="+code=levels" class="sref">levels6/a> = 6a href="+code=obj" class="sref">obj6/a>;
.3426/a>
.3436/a>        return 0;
.3446/a>
.3456/a>      6a href="+code=err" class="sref">err6/a>:
.3466/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=buffer" class="sref">buffer6/a>.6a href="+code=pointer" class="sref">pointer6/a>);
.3476/a>
.3486/a>        return 6a href="+code=status" class="sref">status6/a>;
.3496/a>}
.35alua>
.3516/a>static.int
.352lua>6a href="+code=acpi_video_device_lcd_set_level" class="sref">acpi_video_device_lcd_set_level6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>, int.6a href="+code=level" class="sref">level6/a>)
.3536/a>{
.3546/a>        int.6a href="+code=status" class="sref">status6/a>;
.3556/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> 6a href="+code=arg0" class="sref">arg06/a> = { 6a href="+code=ACPI_TYPE_INTEGER" class="sref">ACPI_TYPE_INTEGER6/a> };
.3566/a>        struct.6a href="+code=acpi_object_list" class="sref">acpi_object_list6/a> 6a href="+code=args" class="sref">args6/a> = { 1, &6a href="+code=arg0" class="sref">arg06/a> };
.3576/a>        int.6a href="+code=state" class="sref">state6/a>;
.3586/a>
.3596/a>        6a href="+code=arg0" class="sref">arg06/a>.6a href="+code=integer" class="sref">integer6/a>.6a href="+code=vopti" class="sref">vopti6/a> = 6a href="+code=level" class="sref">level6/a>;
.36alua>
.361lua>        6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_evoptate_object" class="sref">acpi_evoptate_object6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_BCM"6/spa >,
.3626/a>                                      &6a href="+code=args" class="sref">args6/a>, 6a href="+code=NULL" class="sref">NULL6/a>);
.363lua>        if (6a href="+code=ACPI_FAILURE" class="sref">ACPI_FAILURE6/a>(6a href="+code=status" class="sref">status6/a>)) {
.3646/a>                6a href="+code=ACPI_ERROR" class="sref">ACPI_ERROR6/a>((6a href="+code=AE_INFO" class="sref">AE_INFO6/a>,.6spa  class="string">"Evoptating _BCM failed"6/spa >));
.3656/a>                return -6a href="+code=EIO" class="sref">EIO6/a>;
.3666/a>        }
.3676/a>
.368lua>        6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=curr" class="sref">curr6/a> = 6a href="+code=level" class="sref">level6/a>;
.3696/a>        for (6a href="+code=state" class="sref">state6/a> = 2;.6a href="+code=state" class="sref">state6/a> <.6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a>;.6a href="+code=state" class="sref">state6/a>++)
.3706/a>                if (6a href="+code=level" class="sref">level6/a> == 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=state" class="sref">state6/a>]) {
.3716/a>                        if (6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a>)
.3726/a>                                6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a>->6a href="+code=props" class="sref">props6/a>.6a href="+code=brightness" class="sref">brightness6/a> = 6a href="+code=state" class="sref">state6/a> - 2;
.3736/a>                        return 0;
.3746/a>                }
.3756/a>
.3766/a>        6a href="+code=ACPI_ERROR" class="sref">ACPI_ERROR6/a>((6a href="+code=AE_INFO" class="sref">AE_INFO6/a>,.6spa  class="string">"Current brightness invopid"6/spa >));
.3776/a>        return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.3786/a>}
.3796/a>
.3806/a>6spa  class="comment">/*6/spa >
.381lua>6spa  class="comment"> * For some buggy _BQC methods, we need to add a.constant vopti to6/spa >
.382lua>6spa  class="comment"> * the _BQC return vopti to get the actual current brightness level6/spa >
.3836/a>6spa  class="comment"> */6/spa >
.3846/a>
.3856/a>static.int 6a href="+code=bqc_offset_aml_bug_workaround" class="sref">bqc_offset_aml_bug_workaround6/a>;
.3866/a>static.int.6a href="+code=__init" class="sref">__init6/a> 6a href="+code=video_set_bqc_offset" class="sref">video_set_bqc_offset6/a>(const struct.6a href="+code=dmi_system_id" class="sref">dmi_system_id6/a> *6a href="+code=d" class="sref">d6/a>)
.3876/a>{
.388lua>        6a href="+code=bqc_offset_aml_bug_workaround" class="sref">bqc_offset_aml_bug_workaround6/a> = 9;
.3896/a>        return 0;
.3906/a>}
.3916/a>
.3926/a>static.int.6a href="+code=video_ignore_initial_backlight" class="sref">video_ignore_initial_backlight6/a>(const struct.6a href="+code=dmi_system_id" class="sref">dmi_system_id6/a> *6a href="+code=d" class="sref">d6/a>)
.3936/a>{
.3946/a>        6a href="+code=use_bios_initial_backlight" class="sref">use_bios_initial_backlight6/a> = 0;
.3956/a>        return 0;
.3966/a>}
.3976/a>
.3986/a>static.struct.6a href="+code=dmi_system_id" class="sref">dmi_system_id6/a> 6a href="+code=video_dmi_table" class="sref">video_dmi_table6/a>[].6a href="+code=__initdata" class="sref">__initdata6/a> = {
.3996/a>        6spa  class="comment">/*6/spa >
.4006/a>6spa  class="comment">         * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?ido131216/spa >
.401lua>6spa  class="comment">         */6/spa >
.4026/a>        {
.4036/a>         .6a href="+code=callback" class="sref">callback6/a> = 6a href="+code=video_set_bqc_offset" class="sref">video_set_bqc_offset6/a>,
.4046/a>         .6a href="+code=ident" class="sref">ident6/a> = 6spa  class="string">"Acer Aspire 5720"6/spa >,
.4056/a>         .6a href="+code=matches" class="sref">matches6/a> = {
.4066/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_BOARD_VENDOR" class="sref">DMI_BOARD_VENDOR6/a>,.6spa  class="string">"Acer"6/spa >),
.4076/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_PRODUCT_NAME" class="sref">DMI_PRODUCT_NAME6/a>,.6spa  class="string">"Aspire 5720"6/spa >),
.4086/a>                },
.4096/a>        },
.4106/a>        {
.4116/a>         .6a href="+code=callback" class="sref">callback6/a> = 6a href="+code=video_set_bqc_offset" class="sref">video_set_bqc_offset6/a>,
.4126/a>         .6a href="+code=ident" class="sref">ident6/a> = 6spa  class="string">"Acer Aspire 5710Z"6/spa >,
.4136/a>         .6a href="+code=matches" class="sref">matches6/a> = {
.4146/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_BOARD_VENDOR" class="sref">DMI_BOARD_VENDOR6/a>,.6spa  class="string">"Acer"6/spa >),
.4156/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_PRODUCT_NAME" class="sref">DMI_PRODUCT_NAME6/a>,.6spa  class="string">"Aspire 5710Z"6/spa >),
.4166/a>                },
.4176/a>        },
.4186/a>        {
.4196/a>         .6a href="+code=callback" class="sref">callback6/a> = 6a href="+code=video_set_bqc_offset" class="sref">video_set_bqc_offset6/a>,
.4206/a>         .6a href="+code=ident" class="sref">ident6/a> = 6spa  class="string">"eMachines E510"6/spa >,
.4216/a>         .6a href="+code=matches" class="sref">matches6/a> = {
.4226/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_BOARD_VENDOR" class="sref">DMI_BOARD_VENDOR6/a>,.6spa  class="string">"EMACHINES"6/spa >),
.4236/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_PRODUCT_NAME" class="sref">DMI_PRODUCT_NAME6/a>,.6spa  class="string">"eMachines E510"6/spa >),
.4246/a>                },
.4256/a>        },
.4266/a>        {
.4276/a>         .6a href="+code=callback" class="sref">callback6/a> = 6a href="+code=video_set_bqc_offset" class="sref">video_set_bqc_offset6/a>,
.4286/a>         .6a href="+code=ident" class="sref">ident6/a> = 6spa  class="string">"Acer Aspire 5315"6/spa >,
.4296/a>         .6a href="+code=matches" class="sref">matches6/a> = {
.4306/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_BOARD_VENDOR" class="sref">DMI_BOARD_VENDOR6/a>,.6spa  class="string">"Acer"6/spa >),
.4316/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_PRODUCT_NAME" class="sref">DMI_PRODUCT_NAME6/a>,.6spa  class="string">"Aspire 5315"6/spa >),
.4326/a>                },
.4336/a>        },
.4346/a>        {
.4356/a>         .6a href="+code=callback" class="sref">callback6/a> = 6a href="+code=video_set_bqc_offset" class="sref">video_set_bqc_offset6/a>,
.4366/a>         .6a href="+code=ident" class="sref">ident6/a> = 6spa  class="string">"Acer Aspire 7720"6/spa >,
.4376/a>         .6a href="+code=matches" class="sref">matches6/a> = {
.4386/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_BOARD_VENDOR" class="sref">DMI_BOARD_VENDOR6/a>,.6spa  class="string">"Acer"6/spa >),
.4396/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_PRODUCT_NAME" class="sref">DMI_PRODUCT_NAME6/a>,.6spa  class="string">"Aspire 7720"6/spa >),
.4406/a>                },
.441lua>        },
.4426/a>        {
.4436/a>         .6a href="+code=callback" class="sref">callback6/a> = 6a href="+code=video_ignore_initial_backlight" class="sref">video_ignore_initial_backlight6/a>,
.4446/a>         .6a href="+code=ident" class="sref">ident6/a> = 6spa  class="string">"HP Folio 13-2000"6/spa >,
.4456/a>         .6a href="+code=matches" class="sref">matches6/a> = {
.4466/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_BOARD_VENDOR" class="sref">DMI_BOARD_VENDOR6/a>,.6spa  class="string">"Hewlett-Packard"6/spa >),
.4476/a>                6a href="+code=DMI_MATCH" class="sref">DMI_MATCH6/a>(6a href="+code=DMI_PRODUCT_NAME" class="sref">DMI_PRODUCT_NAME6/a>,.6spa  class="string">"HP Folio 13 - 2000 Notebook PC"6/spa >),
.4486/a>                },
.4496/a>        },
.4506/a>        {}
.4516/a>};
.4526/a>
.4536/a>static.int
.4546/a>6a href="+code=acpi_video_device_lcd_get_level_current" class="sref">acpi_video_device_lcd_get_level_current6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>,
.4556/a>                                        unsigned long.long.*6a href="+code=level" class="sref">level6/a>,.int.6a href="+code=init" class="sref">init6/a>)
.4566/a>{
.4576/a>        6a href="+code=acpi_status" class="sref">acpi_status6/a> 6a href="+code=status" class="sref">status6/a> = 6a href="+code=AE_OK" class="sref">AE_OK6/a>;
.4586/a>        int.6a href="+code=i" class="sref">i6/a>;
.4596/a>
.4606/a>        if (6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BQC" class="sref">_BQC6/a> || 6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BCQ" class="sref">_BCQ6/a>) {
.4616/a>                char.*6a href="+code=buf" class="sref">buf6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BQC" class="sref">_BQC6/a> ?.6spa  class="string">"_BQC"6/spa > :.6spa  class="string">"_BCQ"6/spa >;
.4626/a>
.4636/a>                6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_evoptate_integer" class="sref">acpi_evoptate_integer6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6a href="+code=buf" class="sref">buf6/a>,
.4646/a>                                                6a href="+code=NULL" class="sref">NULL6/a>, 6a href="+code=level" class="sref">level6/a>);
.4656/a>                if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=status" class="sref">status6/a>)) {
.4666/a>                        if (6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BQC_use_index" class="sref">_BQC_use_index6/a>) {
.4676/a>                                if (6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BCL_reversed" class="sref">_BCL_reversed6/a>)
.4686/a>                                        *6a href="+code=level" class="sref">level6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a>
.4696/a>                                                                 - 3 - (*6a href="+code=level" class="sref">level6/a>);
.4706/a>                                *6a href="+code=level" class="sref">level6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[*6a href="+code=level" class="sref">level6/a> + 2];
.4716/a>
.4726/a>                        }
.4736/a>                        *6a href="+code=level" class="sref">level6/a> += 6a href="+code=bqc_offset_aml_bug_workaround" class="sref">bqc_offset_aml_bug_workaround6/a>;
.4746/a>                        for (6a href="+code=i" class="sref">i6/a> = 2;.6a href="+code=i" class="sref">i6/a> <.6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a>;.6a href="+code=i" class="sref">i6/a>++)
.4756/a>                                if (6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a>] == *6a href="+code=level" class="sref">level6/a>) {
.4766/a>                                        6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=curr" class="sref">curr6/a> = *6a href="+code=level" class="sref">level6/a>;
.4776/a>                                        return 0;
.4786/a>                        }
.4796/a>                        if (!6a href="+code=init" class="sref">init6/a>) {
.4806/a>                                6spa  class="comment">/*6/spa >
.481lua>6spa  class="comment">                                 * BQC returned a  invopid level.6/spa >
.482lua>6spa  class="comment">                                 * Stop using it.6/spa >
.4836/a>6spa  class="comment">                                 */6/spa >
.4846/a>                                6a href="+code=ACPI_WARNING" class="sref">ACPI_WARNING6/a>((6a href="+code=AE_INFO" class="sref">AE_INFO6/a>,
.4856/a>                                              6spa  class="string">"%s returned a  invopid level"6/spa >,
.4866/a>                                              6a href="+code=buf" class="sref">buf6/a>));
.4876/a>                                6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BQC" class="sref">_BQC6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BCQ" class="sref">_BCQ6/a> = 0;
.4886/a>                        }
.4896/a>                } else {
.4906/a>                        6spa  class="comment">/* Fixme:6/spa >
.491lua>6spa  class="comment">                         * should we return a  error or ignore this failure?6/spa >
.492lua>6spa  class="comment">                         * dev->brightness->curr is a cached vopti which stores6/spa >
.4936/a>6spa  class="comment">                         * the correct current backlight level in most cases.6/spa >
.4946/a>6spa  class="comment">                         * ACPI video backlight still works w/ buggy _BQC.6/spa >
.4956/a>6spa  class="comment">                         * http://bugzilla.kernel.org/show_bug.cgi?ido122336/spa >
.4966/a>6spa  class="comment">                         */6/spa >
.4976/a>                        6a href="+code=ACPI_WARNING" class="sref">ACPI_WARNING6/a>((6a href="+code=AE_INFO" class="sref">AE_INFO6/a>,.6spa  class="string">"Evoptating %s failed"6/spa >,.6a href="+code=buf" class="sref">buf6/a>));
.4986/a>                        6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BQC" class="sref">_BQC6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BCQ" class="sref">_BCQ6/a> = 0;
.4996/a>                }
.5006/a>        }
.5016/a>
.5026/a>        *6a href="+code=level" class="sref">level6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=curr" class="sref">curr6/a>;
.5036/a>        return 0;
.5046/a>}
.5056/a>
.5066/a>static.int
.5076/a>6a href="+code=acpi_video_device_EDID" class="sref">acpi_video_device_EDID6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>,
.5086/a>                       union 6a href="+code=acpi_object" class="sref">acpi_object6/a> **6a href="+code=edid" class="sref">edid6/a>, 6a href="+code=ssize_t" class="sref">ssize_t6/a> 6a href="+code=length" class="sref">length6/a>)
.5096/a>{
.5106/a>        int.6a href="+code=status" class="sref">status6/a>;
.5116/a>        struct.6a href="+code=acpi_buffer" class="sref">acpi_buffer6/a> 6a href="+code=buffer" class="sref">buffer6/a> = { 6a href="+code=ACPI_ALLOCATE_BUFFER" class="sref">ACPI_ALLOCATE_BUFFER6/a>, 6a href="+code=NULL" class="sref">NULL6/a> };
.5126/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *6a href="+code=obj" class="sref">obj6/a>;
.5136/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> 6a href="+code=arg0" class="sref">arg06/a> = { 6a href="+code=ACPI_TYPE_INTEGER" class="sref">ACPI_TYPE_INTEGER6/a> };
.5146/a>        struct.6a href="+code=acpi_object_list" class="sref">acpi_object_list6/a> 6a href="+code=args" class="sref">args6/a> = { 1, &6a href="+code=arg0" class="sref">arg06/a> };
.5156/a>
.5166/a>
.5176/a>        *6a href="+code=edid" class="sref">edid6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
.5186/a>
.5196/a>        if (!6a href="+code=device" class="sref">device6/a>)
.5206/a>                return -6a href="+code=ENODEV" class="sref">ENODEV6/a>;
.5216/a>        if (6a href="+code=length" class="sref">length6/a> == 128)
.5226/a>                6a href="+code=arg0" class="sref">arg06/a>.6a href="+code=integer" class="sref">integer6/a>.6a href="+code=vopti" class="sref">vopti6/a> = 1;
.5236/a>        else if (6a href="+code=length" class="sref">length6/a> == 256)
.5246/a>                6a href="+code=arg0" class="sref">arg06/a>.6a href="+code=integer" class="sref">integer6/a>.6a href="+code=vopti" class="sref">vopti6/a> = 2;
.5256/a>        else
.5266/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.5276/a>
.528lua>        6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_evoptate_object" class="sref">acpi_evoptate_object6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_DDC"6/spa >,.&6a href="+code=args" class="sref">args6/a>, &6a href="+code=buffer" class="sref">buffer6/a>);
.5296/a>        if (6a href="+code=ACPI_FAILURE" class="sref">ACPI_FAILURE6/a>(6a href="+code=status" class="sref">status6/a>))
.5306/a>                return -6a href="+code=ENODEV" class="sref">ENODEV6/a>;
.5316/a>
.5326/a>        6a href="+code=obj" class="sref">obj6/a> = 6a href="+code=buffer" class="sref">buffer6/a>.6a href="+code=pointer" class="sref">pointer6/a>;
.5336/a>
.5346/a>        if (6a href="+code=obj" class="sref">obj6/a> && 6a href="+code=obj" class="sref">obj6/a>->6a href="+code=type" class="sref">type6/a> == 6a href="+code=ACPI_TYPE_BUFFER" class="sref">ACPI_TYPE_BUFFER6/a>)
.5356/a>                *6a href="+code=edid" class="sref">edid6/a> = 6a href="+code=obj" class="sref">obj6/a>;
.5366/a>        else {
.5376/a>                6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a> 6spa  class="string">"Invopid _DDC data\n"6/spa >);
.5386/a>                6a href="+code=status" class="sref">status6/a> = -6a href="+code=EFAULT" class="sref">EFAULT6/a>;
.5396/a>                6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=obj" class="sref">obj6/a>);
.5406/a>        }
.5416/a>
.5426/a>        return 6a href="+code=status" class="sref">status6/a>;
.5436/a>}
.5446/a>
.5456/a>6spa  class="comment">/* bus */6/spa >
.5466/a>
.5476/a>6spa  class="comment">/*6/spa >
.5486/a>6spa  class="comment"> *  Arg:6/spa >
.5496/a>6spa  class="comment"> *      video           : video bus device pointer6/spa >
.5506/a>6spa  class="comment"> *      bios_flag       : 6/spa >
.551lua>6spa  class="comment"> *              0.      The system BIOS should NOT automatically switch(toggle)6/spa >
.552lua>6spa  class="comment"> *                      the active display output.6/spa >
.5536/a>6spa  class="comment"> *              1.      The system BIOS should automatically switch (toggle) the6/spa >
.5546/a>6spa  class="comment"> *                      active display output. No switch event.6/spa >
.5556/a>6spa  class="comment"> *              2.      The _DGS vopti should be locked.6/spa >
.5566/a>6spa  class="comment"> *              3.      The system BIOS should not automatically switch (toggle) the6/spa >
.5576/a>6spa  class="comment"> *                      active display output, but instead generate the display switch6/spa >
.5586/a>6spa  class="comment"> *                      event notify code.6/spa >
.5596/a>6spa  class="comment"> *      lcd_flag        :6/spa >
.5606/a>6spa  class="comment"> *              0.      The system BIOS should automatically control the brightness level6/spa >
.561lua>6spa  class="comment"> *                      of the LCD when the power changes from AC to DC6/spa >
.562lua>6spa  class="comment"> *              1.      The system BIOS should NOT automatically control the brightness 6/spa >
.5636/a>6spa  class="comment"> *                      level of the LCD when the power changes from AC to DC.6/spa >
.5646/a>6spa  class="comment"> * Return Vopti:6/spa >
.5656/a>6spa  class="comment"> *              -EINVAL wrong.arg.6/spa >
.5666/a>6spa  class="comment"> */6/spa >
.5676/a>
.5686/a>static.int
.5696/a>6a href="+code=acpi_video_bus_DOS" class="sref">acpi_video_bus_DOS6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>, int 6a href="+code=bios_flag" class="sref">bios_flag6/a>, int 6a href="+code=lcd_flag" class="sref">lcd_flag6/a>)
.5706/a>{
.5716/a>        6a href="+code=acpi_status" class="sref">acpi_status6/a> 6a href="+code=status" class="sref">status6/a>;
.5726/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> 6a href="+code=arg0" class="sref">arg06/a> = { 6a href="+code=ACPI_TYPE_INTEGER" class="sref">ACPI_TYPE_INTEGER6/a> };
.5736/a>        struct.6a href="+code=acpi_object_list" class="sref">acpi_object_list6/a> 6a href="+code=args" class="sref">args6/a> = { 1, &6a href="+code=arg0" class="sref">arg06/a> };
.5746/a>
.5756/a>        if (!6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_DOS" class="sref">_DOS6/a>)
.5766/a>                return 0;
.5776/a>
.5786/a>        if (6a href="+code=bios_flag" class="sref">bios_flag6/a> <.0 || 6a href="+code=bios_flag" class="sref">bios_flag6/a> > 3 || 6a href="+code=lcd_flag" class="sref">lcd_flag6/a> <.0 || 6a href="+code=lcd_flag" class="sref">lcd_flag6/a> > 1)
.5796/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.5806/a>        6a href="+code=arg0" class="sref">arg06/a>.6a href="+code=integer" class="sref">integer6/a>.6a href="+code=vopti" class="sref">vopti6/a> = (6a href="+code=lcd_flag" class="sref">lcd_flag6/a> <<.2) | 6a href="+code=bios_flag" class="sref">bios_flag6/a>;
.5816/a>        6a href="+code=video" class="sref">video6/a>->6a href="+code=dos_setting" class="sref">dos_setting6/a> = 6a href="+code=arg0" class="sref">arg06/a>.6a href="+code=integer" class="sref">integer6/a>.6a href="+code=vopti" class="sref">vopti6/a>;
.5826/a>        6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_evoptate_object" class="sref">acpi_evoptate_object6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_DOS"6/spa >,
.5836/a>                &6a href="+code=args" class="sref">args6/a>, 6a href="+code=NULL" class="sref">NULL6/a>);
.5846/a>        if (6a href="+code=ACPI_FAILURE" class="sref">ACPI_FAILURE6/a>(6a href="+code=status" class="sref">status6/a>))
.5856/a>                return -6a href="+code=EIO" class="sref">EIO6/a>;
.5866/a>
.5876/a>        return 0;
.5886/a>}
.5896/a>
.5906/a>6spa  class="comment">/*6/spa >
.591lua>6spa  class="comment"> * Simple comparison function used to sort backlight levels.6/spa >
.592lua>6spa  class="comment"> */6/spa >
.5936/a>
.5946/a>static.int
.5956/a>6a href="+code=acpi_video_cmp_level" class="sref">acpi_video_cmp_level6/a>(const void *6a href="+code=a" class="sref">a6/a>, const void *6a href="+code=b" class="sref">b6/a>)
.5966/a>{
.5976/a>        return *(int *)6a href="+code=a" class="sref">a6/a> - *(int *)6a href="+code=b" class="sref">b6/a>;
.5986/a>}
.5996/a>
.6006/a>6spa  class="comment">/*6/spa >
.601lua>6spa  class="comment"> *  Arg:        6/spa >
.602lua>6spa  class="comment"> *      device  : video output device (LCD, CRT, ..)6/spa >
.6036/a>6spa  class="comment"> *6/spa >
.6046/a>6spa  class="comment"> *  Return Vopti:6/spa >
.6056/a>6spa  class="comment"> *      Maximum brightness level6/spa >
.6066/a>6spa  class="comment"> *6/spa >
.6076/a>6spa  class="comment"> *  Allocate and initialize device->brightness.6/spa >
.6086/a>6spa  class="comment"> */6/spa >
.6096/a>
.6106/a>static.int
.6116/a>6a href="+code=acpi_video_init_brightness" class="sref">acpi_video_init_brightness6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>)
.6126/a>{
.6136/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *6a href="+code=obj" class="sref">obj6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
.6146/a>        int.6a href="+code=i" class="sref">i6/a>, 6a href="+code=max_level" class="sref">max_level6/a> = 0, 6a href="+code=count" class="sref">count6/a> = 0, 6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a> = 0;
.6156/a>        unsigned long.long.6a href="+code=level" class="sref">level6/a>, 6a href="+code=level_old" class="sref">level_old6/a>;
.6166/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *6a href="+code=o" class="sref">o6/a>;
.6176/a>        struct.6a href="+code=acpi_video_device_brightness" class="sref">acpi_video_device_brightness6/a> *6a href="+code=br" class="sref">br6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
.6186/a>        int.6a href="+code=result" class="sref">result6/a> = -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.6196/a>
.6206/a>        if (!6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_video_device_lcd_query_levels" class="sref">acpi_video_device_lcd_query_levels6/a>(6a href="+code=device" class="sref">device6/a>, &6a href="+code=obj" class="sref">obj6/a>))) {
.6216/a>                6a href="+code=ACPI_DEBUG_PRINT" class="sref">ACPI_DEBUG_PRINT6/a>((6a href="+code=ACPI_DB_INFO" class="sref">ACPI_DB_INFO6/a>,.6spa  class="string">"Could not query available "6/spa >
.6226/a>                                                6spa  class="string">"LCD brightness level\n"6/spa >));
.6236/a>                goto 6a href="+code=out" class="sref">out6/a>;
.6246/a>        }
.6256/a>
.6266/a>        if (6a href="+code=obj" class="sref">obj6/a>->6a href="+code=package" class="sref">package6/a>.6a href="+code=count" class="sref">count6/a> <.2)
.6276/a>                goto 6a href="+code=out" class="sref">out6/a>;
.6286/a>
.6296/a>        6a href="+code=br" class="sref">br6/a> = 6a href="+code=kzalloc" class="sref">kzalloc6/a>(sizeof(*6a href="+code=br" class="sref">br6/a>), 6a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL6/a>);
.6306/a>        if (!6a href="+code=br" class="sref">br6/a>) {
.6316/a>                6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6spa  class="string">"can't allocate memory\n"6/spa >);
.6326/a>                6a href="+code=result" class="sref">result6/a> = -6a href="+code=ENOMEM" class="sref">ENOMEM6/a>;
.6336/a>                goto 6a href="+code=out" class="sref">out6/a>;
.6346/a>        }
.6356/a>
.6366/a>        6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a> = 6a href="+code=kmalloc" class="sref">kmalloc6/a>((6a href="+code=obj" class="sref">obj6/a>->6a href="+code=package" class="sref">package6/a>.6a href="+code=count" class="sref">count6/a> +.2) * sizeof *(6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>),
.6376/a>                                6a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL6/a>);
.6386/a>        if (!6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>) {
.6396/a>                6a href="+code=result" class="sref">result6/a> = -6a href="+code=ENOMEM" class="sref">ENOMEM6/a>;
.6406/a>                goto 6a href="+code=out_free" class="sref">out_free6/a>;
.6416/a>        }
.6426/a>
.6436/a>        for (6a href="+code=i" class="sref">i6/a> = 0;.6a href="+code=i" class="sref">i6/a> <.6a href="+code=obj" class="sref">obj6/a>->6a href="+code=package" class="sref">package6/a>.6a href="+code=count" class="sref">count6/a>;.6a href="+code=i" class="sref">i6/a>++) {
.6446/a>                6a href="+code=o" class="sref">o6/a> = (union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *)&6a href="+code=obj" class="sref">obj6/a>->6a href="+code=package" class="sref">package6/a>.6a href="+code=elements" class="sref">elements6/a>[6a href="+code=i" class="sref">i6/a>];
.6456/a>                if (6a href="+code=o" class="sref">o6/a>->6a href="+code=type" class="sref">type6/a> != 6a href="+code=ACPI_TYPE_INTEGER" class="sref">ACPI_TYPE_INTEGER6/a>) {
.6466/a>                        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a> 6spa  class="string">"Invopid data\n"6/spa >);
.6476/a>                        continue;
.6486/a>                }
.6496/a>                6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=count" class="sref">count6/a>] = (6a href="+code=u32" class="sref">u326/a>) 6a href="+code=o" class="sref">o6/a>->6a href="+code=integer" class="sref">integer6/a>.6a href="+code=vopti" class="sref">vopti6/a>;
.6506/a>
.6516/a>                if (6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=count" class="sref">count6/a>] > 6a href="+code=max_level" class="sref">max_level6/a>)
.6526/a>                        6a href="+code=max_level" class="sref">max_level6/a> = 6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=count" class="sref">count6/a>];
.6536/a>                6a href="+code=count" class="sref">count6/a>++;
.6546/a>        }
.6556/a>
.6566/a>        6spa  class="comment">/*6/spa >
.6576/a>6spa  class="comment">         * some buggy BIOS don't export the levels6/spa >
.6586/a>6spa  class="comment">         * when machine is on AC/Battery in _BCL package.6/spa >
.6596/a>6spa  class="comment">         * In this case, the first two elements in _BCL packages6/spa >
.6606/a>6spa  class="comment">         * are also supported brightness levels that OS should take care of.6/spa >
.661lua>6spa  class="comment">         */6/spa >
.6626/a>        for (6a href="+code=i" class="sref">i6/a> = 2;.6a href="+code=i" class="sref">i6/a> <.6a href="+code=count" class="sref">count6/a>;.6a href="+code=i" class="sref">i6/a>++) {
.6636/a>                if (6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a>] == 6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[0])
.6646/a>                        6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a>++;
.6656/a>                if (6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a>] == 6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[1])
.6666/a>                        6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a>++;
.6676/a>        }
.6686/a>
.6696/a>        if (6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a> <.2) {
.6706/a>                6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a> = 2 - 6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a>;
.6716/a>                6a href="+code=br" class="sref">br6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BCL_no_ac_battery_levels" class="sref">_BCL_no_ac_battery_levels6/a> = 1;
.6726/a>                for (6a href="+code=i" class="sref">i6/a> = (6a href="+code=count" class="sref">count6/a> - 1 + 6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a>);.6a href="+code=i" class="sref">i6/a> >= 2;.6a href="+code=i" class="sref">i6/a>--)
.6736/a>                        6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a>] = 6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a> - 6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a>];
.6746/a>                6a href="+code=count" class="sref">count6/a> += 6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a>;
.6756/a>        } else if (6a href="+code=level_ac_battery" class="sref">level_ac_battery6/a> >.2)
.6766/a>                6a href="+code=ACPI_ERROR" class="sref">ACPI_ERROR6/a>((6a href="+code=AE_INFO" class="sref">AE_INFO6/a>,.6spa  class="string">"Too many duplicates in _BCL package\n"6/spa >));
.6776/a>
.6786/a>        6spa  class="comment">/* Check if the _BCL package is in a reversed order */6/spa >
.6796/a>        if (6a href="+code=max_level" class="sref">max_level6/a> == 6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[2]) {
.6806/a>                6a href="+code=br" class="sref">br6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BCL_reversed" class="sref">_BCL_reversed6/a> = 1;
.6816/a>                6a href="+code=sort" class="sref">sort6/a>(&6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[2], 6a href="+code=count" class="sref">count6/a> - 2, sizeof(6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[2]),
.6826/a>                        6a href="+code=acpi_video_cmp_level" class="sref">acpi_video_cmp_level6/a>, 6a href="+code=NULL" class="sref">NULL6/a>);
.6836/a>        } else if (6a href="+code=max_level" class="sref">max_level6/a> != 6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=count" class="sref">count6/a> - 1])
.6846/a>                6a href="+code=ACPI_ERROR" class="sref">ACPI_ERROR6/a>((6a href="+code=AE_INFO" class="sref">AE_INFO6/a>,
.6856/a>                            6spa  class="string">"Found unordered _BCL package\n"6/spa >));
.6866/a>
.6876/a>        6a href="+code=br" class="sref">br6/a>->6a href="+code=count" class="sref">count6/a> = 6a href="+code=count" class="sref">count6/a>;
.688lua>        6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a> = 6a href="+code=br" class="sref">br6/a>;
.6896/a>
.6906/a>        6spa  class="comment">/* Check the input/output of _BQC/_BCL/_BCM */6/spa >
.6916/a>        if ((6a href="+code=max_level" class="sref">max_level6/a> <.100) && (6a href="+code=max_level" class="sref">max_level6/a> <= (6a href="+code=count" class="sref">count6/a> - 2)))
.6926/a>                6a href="+code=br" class="sref">br6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BCL_use_index" class="sref">_BCL_use_index6/a> = 1;
.6936/a>
.6946/a>        6spa  class="comment">/*6/spa >
.6956/a>6spa  class="comment">         * _BCM is always consistent with _BCL,6/spa >
.6966/a>6spa  class="comment">         * at least for all the laptops we have ever seen.6/spa >
.6976/a>6spa  class="comment">         */6/spa >
.698lua>        6a href="+code=br" class="sref">br6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BCM_use_index" class="sref">_BCM_use_index6/a> = 6a href="+code=br" class="sref">br6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BCL_use_index" class="sref">_BCL_use_index6/a>;
.6996/a>
.7006/a>        6spa  class="comment">/* _BQC uses INDEX while _BCL uses VALUE in some laptops */6/spa >
.7016/a>        6a href="+code=br" class="sref">br6/a>->6a href="+code=curr" class="sref">curr6/a> = 6a href="+code=level" class="sref">level6/a> = 6a href="+code=max_level" class="sref">max_level6/a>;
.7026/a>
.7036/a>        if (!6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BQC" class="sref">_BQC6/a>)
.7046/a>                goto 6a href="+code=set_level" class="sref">set_level6/a>;
.7056/a>
.7066/a>        6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_video_device_lcd_get_level_current" class="sref">acpi_video_device_lcd_get_level_current6/a>(6a href="+code=device" class="sref">device6/a>, &6a href="+code=level_old" class="sref">level_old6/a>, 1);
.7076/a>        if (6a href="+code=result" class="sref">result6/a>)
.7086/a>                goto 6a href="+code=out_free_levels" class="sref">out_free_levels6/a>;
.7096/a>
.7106/a>        6spa  class="comment">/*6/spa >
.711lua>6spa  class="comment">         * Set the level to maximum and check if _BQC uses indexed vopti6/spa >
.712lua>6spa  class="comment">         */6/spa >
.7136/a>        6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_video_device_lcd_set_level" class="sref">acpi_video_device_lcd_set_level6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=max_level" class="sref">max_level6/a>);
.7146/a>        if (6a href="+code=result" class="sref">result6/a>)
.7156/a>                goto 6a href="+code=out_free_levels" class="sref">out_free_levels6/a>;
.7166/a>
.7176/a>        6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_video_device_lcd_get_level_current" class="sref">acpi_video_device_lcd_get_level_current6/a>(6a href="+code=device" class="sref">device6/a>, &6a href="+code=level" class="sref">level6/a>, 0);
.7186/a>        if (6a href="+code=result" class="sref">result6/a>)
.7196/a>                goto 6a href="+code=out_free_levels" class="sref">out_free_levels6/a>;
.7206/a>
.7216/a>        6a href="+code=br" class="sref">br6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BQC_use_index" class="sref">_BQC_use_index6/a> = (6a href="+code=level" class="sref">level6/a> == 6a href="+code=max_level" class="sref">max_level6/a> ? 0 : 1);
.7226/a>
.7236/a>        if (!6a href="+code=br" class="sref">br6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BQC_use_index" class="sref">_BQC_use_index6/a>) {
.7246/a>                6spa  class="comment">/*6/spa >
.7256/a>6spa  class="comment">                 * Set the backlight to the initial state.6/spa >
.7266/a>6spa  class="comment">                 * On some buggy laptops, _BQC returns an uninitialized vopti6/spa >
.7276/a>6spa  class="comment">                 * when invoked for the first time, i.e. level_old is invopid.6/spa >
.7286/a>6spa  class="comment">                 * set the backlight to max_level in this case6/spa >
.7296/a>6spa  class="comment">                 */6/spa >
.7306/a>                if (6a href="+code=use_bios_initial_backlight" class="sref">use_bios_initial_backlight6/a>) {
.7316/a>                        for (6a href="+code=i" class="sref">i6/a> = 2;.6a href="+code=i" class="sref">i6/a> <.6a href="+code=br" class="sref">br6/a>->6a href="+code=count" class="sref">count6/a>;.6a href="+code=i" class="sref">i6/a>++)
.7326/a>                                if (6a href="+code=level_old" class="sref">level_old6/a> == 6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a>])
.7336/a>                                        6a href="+code=level" class="sref">level6/a> = 6a href="+code=level_old" class="sref">level_old6/a>;
.7346/a>                }
.7356/a>                goto 6a href="+code=set_level" class="sref">set_level6/a>;
.7366/a>        }
.7376/a>
.7386/a>        if (6a href="+code=br" class="sref">br6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=_BCL_reversed" class="sref">_BCL_reversed6/a>)
.7396/a>                6a href="+code=level_old" class="sref">level_old6/a> = (6a href="+code=br" class="sref">br6/a>->6a href="+code=count" class="sref">count6/a> - 1) - 6a href="+code=level_old" class="sref">level_old6/a>;
.7406/a>        6a href="+code=level" class="sref">level6/a> = 6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=level_old" class="sref">level_old6/a>];
.7416/a>
.7426/a>6a href="+code=set_level" class="sref">set_level6/a>:
.7436/a>        6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_video_device_lcd_set_level" class="sref">acpi_video_device_lcd_set_level6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=level" class="sref">level6/a>);
.7446/a>        if (6a href="+code=result" class="sref">result6/a>)
.7456/a>                goto 6a href="+code=out_free_levels" class="sref">out_free_levels6/a>;
.7466/a>
.7476/a>        6a href="+code=ACPI_DEBUG_PRINT" class="sref">ACPI_DEBUG_PRINT6/a>((6a href="+code=ACPI_DB_INFO" class="sref">ACPI_DB_INFO6/a>,
.7486/a>                          6spa  class="string">"found %d brightness levels\n"6/spa >, 6a href="+code=count" class="sref">count6/a> - 2));
.7496/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=obj" class="sref">obj6/a>);
.7506/a>        return 6a href="+code=result" class="sref">result6/a>;
.7516/a>
.7526/a>6a href="+code=out_free_levels" class="sref">out_free_levels6/a>:
.7536/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=br" class="sref">br6/a>->6a href="+code=levels" class="sref">levels6/a>);
.7546/a>6a href="+code=out_free" class="sref">out_free6/a>:
.7556/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=br" class="sref">br6/a>);
.7566/a>6a href="+code=out" class="sref">out6/a>:
.7576/a>        6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
.758lua>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=obj" class="sref">obj6/a>);
.7596/a>        return 6a href="+code=result" class="sref">result6/a>;
.7606/a>}
.7616/a>
.762lua>6spa  class="comment">/*6/spa >
.7636/a>6spa  class="comment"> *  Arg:6/spa >
.7646/a>6spa  class="comment"> *      device  : video output device (LCD, CRT, ..)6/spa >
.7656/a>6spa  class="comment"> *6/spa >
.7666/a>6spa  class="comment"> *  Return Vopti:6/spa >
.7676/a>6spa  class="comment"> *      None6/spa >
.7686/a>6spa  class="comment"> *6/spa >
.7696/a>6spa  class="comment"> *  Find out all required AML methods defined under the output6/spa >
.7706/a>6spa  class="comment"> *  device.6/spa >
.771lua>6spa  class="comment"> */6/spa >
.7726/a>
.7736/a>static.void 6a href="+code=acpi_video_device_find_cap" class="sref">acpi_video_device_find_cap6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>)
.7746/a>{
.7756/a>        6a href="+code=acpi_handle" class="sref">acpi_handle6/a> 6a href="+code=h_dummy1" class="sref">h_dummy16/a>;
.7766/a>
.7776/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_ADR"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.7786/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_ADR" class="sref">_ADR6/a> = 1;
.7796/a>        }
.7806/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_BCL"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.7816/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BCL" class="sref">_BCL6/a> = 1;
.7826/a>        }
.7836/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_BCM"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.7846/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BCM" class="sref">_BCM6/a> = 1;
.7856/a>        }
.7866/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,6spa  class="string">"_BQC"6/spa >,&6a href="+code=h_dummy1" class="sref">h_dummy16/a>)))
.7876/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BQC" class="sref">_BQC6/a> = 1;
.788lua>        else if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_BCQ"6/spa >,
.7896/a>                                &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.7906/a>                6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_WARNING" class="sref">KERN_WARNING6/a> 6a href="+code=FW_BUG" class="sref">FW_BUG6/a> 6spa  class="string">"_BCQ is used instead of _BQC\n"6/spa >);
.7916/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_BCQ" class="sref">_BCQ6/a> = 1;
.7926/a>        }
.7936/a>
.7946/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_DDC"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.7956/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_DDC" class="sref">_DDC6/a> = 1;
.7966/a>        }
.7976/a>
.7986/a>        if (6a href="+code=acpi_video_backlight_support" class="sref">acpi_video_backlight_support6/a>()) {
.7996/a>                struct.6a href="+code=backlight_properties" class="sref">backlight_properties6/a> 6a href="+code=props" class="sref">props6/a>;
.8006/a>                struct.6a href="+code=pci_dev" class="sref">pci_dev6/a> *6a href="+code=pdev" class="sref">pdev6/a>;
.8016/a>                6a href="+code=acpi_handle" class="sref">acpi_handle6/a> 6a href="+code=acpi_parent" class="sref">acpi_parent6/a>;
.8026/a>                struct.6a href="+code=device" class="sref">device6/a> *6a href="+code=parent" class="sref">parent6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
.8036/a>                int 6a href="+code=result" class="sref">result6/a>;
.8046/a>                static.int 6a href="+code=count" class="sref">count6/a> = 0;
.8056/a>                char *6a href="+code=nami" class="sref">nami6/a>;
.8066/a>
.8076/a>                6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_video_init_brightness" class="sref">acpi_video_init_brightness6/a>(6a href="+code=device" class="sref">device6/a>);
.8086/a>                if (6a href="+code=result" class="sref">result6/a>)
.8096/a>                        return;
.8106/a>                6a href="+code=nami" class="sref">nami6/a> = 6a href="+code=kasprintf" class="sref">kasprintf6/a>(6a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL6/a>,.6spa  class="string">"acpi_video%d"6/spa >, 6a href="+code=count" class="sref">count6/a>);
.8116/a>                if (!6a href="+code=nami" class="sref">nami6/a>)
.8126/a>                        return;
.8136/a>                6a href="+code=count" class="sref">count6/a>++;
.8146/a>
.8156/a>                6a href="+code=acpi_get_parent" class="sref">acpi_get_parent6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,.&6a href="+code=acpi_parent" class="sref">acpi_parent6/a>);
.8166/a>
.8176/a>                6a href="+code=pdev" class="sref">pdev6/a> = 6a href="+code=acpi_get_pci_dev" class="sref">acpi_get_pci_dev6/a>(6a href="+code=acpi_parent" class="sref">acpi_parent6/a>);
.8186/a>                if (6a href="+code=pdev" class="sref">pdev6/a>) {
.8196/a>                        6a href="+code=parent" class="sref">parent6/a> = &6a href="+code=pdev" class="sref">pdev6/a>->6a href="+code=dev" class="sref">dev6/a>;
.8206/a>                        6a href="+code=pci_dev_put" class="sref">pci_dev_put6/a>(6a href="+code=pdev" class="sref">pdev6/a>);
.8216/a>                }
.8226/a>
.8236/a>                6a href="+code=memset" class="sref">memset6/a>(&6a href="+code=props" class="sref">props6/a>, 0, sizeof(struct.6a href="+code=backlight_properties" class="sref">backlight_properties6/a>));
.8246/a>                6a href="+code=props" class="sref">props6/a>.6a href="+code=type" class="sref">type6/a> = 6a href="+code=BACKLIGHT_FIRMWARE" class="sref">BACKLIGHT_FIRMWARE6/a>;
.8256/a>                6a href="+code=props" class="sref">props6/a>.6a href="+code=max_brightness" class="sref">max_brightness6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a> - 3;
.8266/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a> = 6a href="+code=backlight_device_register" class="sref">backlight_device_register6/a>(6a href="+code=nami" class="sref">nami6/a>,
.8276/a>                                                              6a href="+code=parent" class="sref">parent6/a>,
.8286/a>                                                              6a href="+code=device" class="sref">device6/a>,
.8296/a>                                                              &6a href="+code=acpi_backlight_ops" class="sref">acpi_backlight_ops6/a>,
.8306/a>                                                              &6a href="+code=props" class="sref">props6/a>);
.8316/a>                6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=nami" class="sref">nami6/a>);
.8326/a>                if (6a href="+code=IS_ERR" class="sref">IS_ERR6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a>))
.8336/a>                        return;
.8346/a>
.8356/a>                6spa  class="comment">/*6/spa >
.8366/a>6spa  class="comment">                 * Save current brightness level in case we have to restore it6/spa >
.8376/a>6spa  class="comment">                 * before acpi_video_device_lcd_set_level() is called next time.6/spa >
.8386/a>6spa  class="comment">                 */6/spa >
.8396/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a>->6a href="+code=props" class="sref">props6/a>.6a href="+code=brightness" class="sref">brightness6/a> =
.8406/a>                                6a href="+code=acpi_video_get_brightness" class="sref">acpi_video_get_brightness6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a>);
.8416/a>
.8426/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a> = 6a href="+code=thermal_cooling_device_register" class="sref">thermal_cooling_device_register6/a>(6spa  class="string">"LCD"6/spa >,
.8436/a>                                        6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>,.&6a href="+code=video_cooling_ops" class="sref">video_cooling_ops6/a>);
.8446/a>                if (6a href="+code=IS_ERR" class="sref">IS_ERR6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a>)) {
.8456/a>                        6spa  class="comment">/*6/spa >
.8466/a>6spa  class="comment">                         * Set cooling_dev to NULL so we don't crash trying to6/spa >
.8476/a>6spa  class="comment">                         * free it.6/spa >
.8486/a>6spa  class="comment">                         * Also, why the hell we are returning early and6/spa >
.8496/a>6spa  class="comment">                         * not attempt to register video output if cooling6/spa >
.8506/a>6spa  class="comment">                         * device registration failed?6/spa >
.851lua>6spa  class="comment">                         * -- dtor6/spa >
.852lua>6spa  class="comment">                         */6/spa >
.8536/a>                        6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
.8546/a>                        return;
.8556/a>                }
.8566/a>
.8576/a>                6a href="+code=dev_info" class="sref">dev_info6/a>(&6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=dev" class="sref">dev6/a>,.6spa  class="string">"registered as cooling_device%d\n"6/spa >,
.8586/a>                         6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a>->6a href="+code=id" class="sref">id6/a>);
.8596/a>                6a href="+code=result" class="sref">result6/a> = 6a href="+code=sysfs_create_link" class="sref">sysfs_create_link6/a>(&6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=dev" class="sref">dev6/a>.6a href="+code=kobj" class="sref">kobj6/a>,
.8606/a>                                &6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a>->6a href="+code=device" class="sref">device6/a>.6a href="+code=kobj" class="sref">kobj6/a>,
.8616/a>                                6spa  class="string">"thermal_cooling"6/spa >);
.8626/a>                if (6a href="+code=result" class="sref">result6/a>)
.8636/a>                        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a> 6spa  class="string">"Create sysfs link\n"6/spa >);
.8646/a>                6a href="+code=result" class="sref">result6/a> = 6a href="+code=sysfs_create_link" class="sref">sysfs_create_link6/a>(&6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a>->6a href="+code=device" class="sref">device6/a>.6a href="+code=kobj" class="sref">kobj6/a>,
.8656/a>                                &6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=dev" class="sref">dev6/a>.6a href="+code=kobj" class="sref">kobj6/a>, 6spa  class="string">"device"6/spa >);
.8666/a>                if (6a href="+code=result" class="sref">result6/a>)
.8676/a>                        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a> 6spa  class="string">"Create sysfs link\n"6/spa >);
.8686/a>
.8696/a>        }
.8706/a>}
.8716/a>
.872lua>6spa  class="comment">/*6/spa >
.8736/a>6spa  class="comment"> *  Arg:        6/spa >
.8746/a>6spa  class="comment"> *      device  : video output device (VGA)6/spa >
.8756/a>6spa  class="comment"> *6/spa >
.8766/a>6spa  class="comment"> *  Return Vopti:6/spa >
.8776/a>6spa  class="comment"> *      None6/spa >
.8786/a>6spa  class="comment"> *6/spa >
.8796/a>6spa  class="comment"> *  Find out all required AML methods defined under the video bus device.6/spa >
.8806/a>6spa  class="comment"> */6/spa >
.8816/a>
.8826/a>static.void 6a href="+code=acpi_video_bus_find_cap" class="sref">acpi_video_bus_find_cap6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>)
.8836/a>{
.8846/a>        6a href="+code=acpi_handle" class="sref">acpi_handle6/a> 6a href="+code=h_dummy1" class="sref">h_dummy16/a>;
.8856/a>
.8866/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_DOS"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.8876/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_DOS" class="sref">_DOS6/a> = 1;
.888lua>        }
.8896/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_DOD"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.8906/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_DOD" class="sref">_DOD6/a> = 1;
.8916/a>        }
.8926/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_ROM"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.8936/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_ROM" class="sref">_ROM6/a> = 1;
.8946/a>        }
.8956/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_GPD"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.8966/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_GPD" class="sref">_GPD6/a> = 1;
.8976/a>        }
.8986/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_SPD"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.8996/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_SPD" class="sref">_SPD6/a> = 1;
.9006/a>        }
.9016/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=acpi_get_handle" class="sref">acpi_get_handle6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_VPO"6/spa >, &6a href="+code=h_dummy1" class="sref">h_dummy16/a>))) {
.9026/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_VPO" class="sref">_VPO6/a> = 1;
.9036/a>        }
.9046/a>}
.9056/a>
.9066/a>6spa  class="comment">/*6/spa >
.9076/a>6spa  class="comment"> * Check whether the video bus device has required AML method to6/spa >
.9086/a>6spa  class="comment"> * support the desired features6/spa >
.9096/a>6spa  class="comment"> */6/spa >
.9106/a>
.9116/a>static.int 6a href="+code=acpi_video_bus_check" class="sref">acpi_video_bus_check6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>)
.9126/a>{
.9136/a>        6a href="+code=acpi_status" class="sref">acpi_status6/a> 6a href="+code=status" class="sref">status6/a> = -6a href="+code=ENOENT" class="sref">ENOENT6/a>;
.9146/a>        struct.6a href="+code=pci_dev" class="sref">pci_dev6/a> *6a href="+code=dev" class="sref">dev6/a>;
.9156/a>
.9166/a>        if (!6a href="+code=video" class="sref">video6/a>)
.9176/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
.9186/a>
.9196/a>        6a href="+code=dev" class="sref">dev6/a> = 6a href="+code=acpi_get_pci_dev" class="sref">acpi_get_pci_dev6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>);
.9206/a>        if (!6a href="+code=dev" class="sref">dev6/a>)
.9216/a>                return -6a href="+code=ENODEV" class="sref">ENODEV6/a>;
.9226/a>        6a href="+code=pci_dev_put" class="sref">pci_dev_put6/a>(6a href="+code=dev" class="sref">dev6/a>);
.9236/a>
.9246/a>        6spa  class="comment">/* Since there is no HID, CID and so on for VGA driver, we have6/spa >
.9256/a>6spa  class="comment">         * to check well known required nodes.6/spa >
.9266/a>6spa  class="comment">         */6/spa >
.9276/a>
.9286/a>        6spa  class="comment">/* Does this device support video switching? */6/spa >
.9296/a>        if (6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_DOS" class="sref">_DOS6/a> || 6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_DOD" class="sref">_DOD6/a>) {
.9306/a>                if (!6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_DOS" class="sref">_DOS6/a>) {
.9316/a>                        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_WARNING" class="sref">KERN_WARNING6/a> 6a href="+code=FW_BUG" class="sref">FW_BUG6/a>
.9326/a>                                6spa  class="string">"ACPI(%s) defines _DOD but not _DOS\n"6/spa >,
.9336/a>                                6a href="+code=acpi_device_bid" class="sref">acpi_device_bid6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>));
.9346/a>                }
.9356/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=multihead" class="sref">multihead6/a> = 1;
.9366/a>                6a href="+code=status" class="sref">status6/a> = 0;
.9376/a>        }
.9386/a>
.9396/a>        6spa  class="comment">/* Does this device support retrieving a video ROM? */6/spa >
.9406/a>        if (6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_ROM" class="sref">_ROM6/a>) {
.9416/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=rom" class="sref">rom6/a> = 1;
.9426/a>                6a href="+code=status" class="sref">status6/a> = 0;
.9436/a>        }
.9446/a>
.9456/a>        6spa  class="comment">/* Does this device support configuring which video device to POST? */6/spa >
.9466/a>        if (6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_GPD" class="sref">_GPD6/a> && 6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_SPD" class="sref">_SPD6/a> && 6a href="+code=video" class="sref">video6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_VPO" class="sref">_VPO6/a>) {
.9476/a>                6a href="+code=video" class="sref">video6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=post" class="sref">post6/a> = 1;
.9486/a>                6a href="+code=status" class="sref">status6/a> = 0;
.9496/a>        }
.9506/a>
.9516/a>        return 6a href="+code=status" class="sref">status6/a>;
.952lua>}
.9536/a>
.9546/a>6spa  class="comment">/* --------------------------------------------------------------------------6/spa >
.9556/a>6spa  class="comment">                                 Driver Interface6/spa >
.9566/a>6spa  class="comment">   -------------------------------------------------------------------------- */6/spa >
.9576/a>
.9586/a>6spa  class="comment">/* device interface */6/spa >
.9596/a>static.struct.6a href="+code=acpi_video_device_attrib" class="sref">acpi_video_device_attrib6/a>*
.9606/a>6a href="+code=acpi_video_get_device_attr" class="sref">acpi_video_get_device_attr6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>, unsigned long 6a href="+code=device_id" class="sref">device_id6/a>)
.9616/a>{
.9626/a>        struct.6a href="+code=acpi_video_enumerated_device" class="sref">acpi_video_enumerated_device6/a> *6a href="+code=ids" class="sref">ids6/a>;
.9636/a>        int 6a href="+code=i" class="sref">i6/a>;
.9646/a>
.9656/a>        for (6a href="+code=i" class="sref">i6/a> = 0; 6a href="+code=i" class="sref">i6/a> < 6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_count" class="sref">attached_count6/a>; 6a href="+code=i" class="sref">i6/a>++) {
.9666/a>                6a href="+code=ids" class="sref">ids6/a> = &6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a>[6a href="+code=i" class="sref">i6/a>];
.9676/a>                if ((6a href="+code=ids" class="sref">ids6/a>->6a href="+code=vopti" class="sref">vopti6/a>.6a href="+code=int_vop" class="sref">int_vop6/a> & 0xffff) == 6a href="+code=device_id" class="sref">device_id6/a>)
.9686/a>                        return &6a href="+code=ids" class="sref">ids6/a>->6a href="+code=vopti" class="sref">vopti6/a>.6a href="+code=attrib" class="sref">attrib6/a>;
.9696/a>        }
.9706/a>
.9716/a>        return 6a href="+code=NULL" class="sref">NULL6/a>;
.972lua>}
.9736/a>
.9746/a>static.int
.9756/a>6a href="+code=acpi_video_get_device_type" class="sref">acpi_video_get_device_type6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>,
.9766/a>                           unsigned long 6a href="+code=device_id" class="sref">device_id6/a>)
.9776/a>{
.9786/a>        struct.6a href="+code=acpi_video_enumerated_device" class="sref">acpi_video_enumerated_device6/a> *6a href="+code=ids" class="sref">ids6/a>;
.9796/a>        int 6a href="+code=i" class="sref">i6/a>;
.9806/a>
.9816/a>        for (6a href="+code=i" class="sref">i6/a> = 0; 6a href="+code=i" class="sref">i6/a> < 6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_count" class="sref">attached_count6/a>; 6a href="+code=i" class="sref">i6/a>++) {
.9826/a>                6a href="+code=ids" class="sref">ids6/a> = &6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a>[6a href="+code=i" class="sref">i6/a>];
.9836/a>                if ((6a href="+code=ids" class="sref">ids6/a>->6a href="+code=vopti" class="sref">vopti6/a>.6a href="+code=int_vop" class="sref">int_vop6/a> & 0xffff) == 6a href="+code=device_id" class="sref">device_id6/a>)
.9846/a>                        return 6a href="+code=ids" class="sref">ids6/a>->6a href="+code=vopti" class="sref">vopti6/a>.6a href="+code=int_vop" class="sref">int_vop6/a>;
.9856/a>        }
.9866/a>
.9876/a>        return 0;
.988lua>}
.9896/a>
.9906/a>static.int
.9916/a>6a href="+code=acpi_video_bus_get_one_device" class="sref">acpi_video_bus_get_one_device6/a>(struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>,
.9926/a>                              struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>)
.9936/a>{
.9946/a>        unsigned long long 6a href="+code=device_id" class="sref">device_id6/a>;
.9956/a>        int 6a href="+code=status" class="sref">status6/a>, 6a href="+code=device_type" class="sref">device_type6/a>;
.9966/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=data" class="sref">data6/a>;
.9976/a>        struct.6a href="+code=acpi_video_device_attrib" class="sref">acpi_video_device_attrib6/a>*.6a href="+code=attribute" class="sref">attribute6/a>;
.9986/a>
.9996/a>        if (!6a href="+code=device" class="sref">device6/a> || !6a href="+code=video" class="sref">video6/a>)
10006/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
10016/a>
10026/a>        6a href="+code=status" class="sref">status6/a> =
10036/a>            6a href="+code=acpi_evoptate_integer" class="sref">acpi_evoptate_integer6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_ADR"6/spa >, 6a href="+code=NULL" class="sref">NULL6/a>, &6a href="+code=device_id" class="sref">device_id6/a>);
10046/a>        if (6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=status" class="sref">status6/a>)) {
10056/a>
10066/a>                6a href="+code=data" class="sref">data6/a> = 6a href="+code=kzalloc" class="sref">kzalloc6/a>(sizeof(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a>), 6a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL6/a>);
10076/a>                if (!6a href="+code=data" class="sref">data6/a>)
10086/a>                        return -6a href="+code=ENOMEM" class="sref">ENOMEM6/a>;
10096/a>
10106/a>                6a href="+code=strcpy" class="sref">strcpy6/a>(6a href="+code=acpi_device_nami" class="sref">acpi_device_nami6/a>(6a href="+code=device" class="sref">device6/a>), 6a href="+code=ACPI_VIDEO_DEVICE_NAME" class="sref">ACPI_VIDEO_DEVICE_NAME6/a>);
10116/a>                6a href="+code=strcpy" class="sref">strcpy6/a>(6a href="+code=acpi_device_class" class="sref">acpi_device_class6/a>(6a href="+code=device" class="sref">device6/a>), 6a href="+code=ACPI_VIDEO_CLASS" class="sref">ACPI_VIDEO_CLASS6/a>);
10126/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=driver_data" class="sref">driver_data6/a> = 6a href="+code=data" class="sref">data6/a>;
10136/a>
10146/a>                6a href="+code=data" class="sref">data6/a>->6a href="+code=device_id" class="sref">device_id6/a> = 6a href="+code=device_id" class="sref">device_id6/a>;
10156/a>                6a href="+code=data" class="sref">data6/a>->6a href="+code=video" class="sref">video6/a> = 6a href="+code=video" class="sref">video6/a>;
10166/a>                6a href="+code=data" class="sref">data6/a>->6a href="+code=dev" class="sref">dev6/a> = 6a href="+code=device" class="sref">device6/a>;
10176/a>
10186/a>                6a href="+code=attribute" class="sref">attribute6/a> = 6a href="+code=acpi_video_get_device_attr" class="sref">acpi_video_get_device_attr6/a>(6a href="+code=video" class="sref">video6/a>, 6a href="+code=device_id" class="sref">device_id6/a>);
10196/a>
10206/a>                if((6a href="+code=attribute" class="sref">attribute6/a> != 6a href="+code=NULL" class="sref">NULL6/a>) && 6a href="+code=attribute" class="sref">attribute6/a>->6a href="+code=device_id_schemi" class="sref">device_id_schemi6/a>) {
10216/a>                        switch (6a href="+code=attribute" class="sref">attribute6/a>->6a href="+code=display_type" class="sref">display_type6/a>) {
10226/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_CRT" class="sref">ACPI_VIDEO_DISPLAY_CRT6/a>:
10236/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=crt" class="sref">crt6/a> = 1;
10246/a>                                break;
10256/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_TV" class="sref">ACPI_VIDEO_DISPLAY_TV6/a>:
10266/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=tvout" class="sref">tvout6/a> = 1;
10276/a>                                break;
10286/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_DVI" class="sref">ACPI_VIDEO_DISPLAY_DVI6/a>:
10296/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=dvi" class="sref">dvi6/a> = 1;
10306/a>                                break;
10316/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_LCD" class="sref">ACPI_VIDEO_DISPLAY_LCD6/a>:
10326/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=lcd" class="sref">lcd6/a> = 1;
10336/a>                                break;
10346/a>                        default:
10356/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=unknown" class="sref">unknown6/a> = 1;
10366/a>                                break;
10376/a>                        }
10386/a>                        if(6a href="+code=attribute" class="sref">attribute6/a>->6a href="+code=bios_can_detect" class="sref">bios_can_detect6/a>)
10396/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=bios" class="sref">bios6/a> = 1;
10406/a>                } else {
10416/a>                        6spa  class="comment">/* Check for legacy IDs */6/spa >
10426/a>                        6a href="+code=device_type" class="sref">device_type6/a> = 6a href="+code=acpi_video_get_device_type" class="sref">acpi_video_get_device_type6/a>(6a href="+code=video" class="sref">video6/a>,
10436/a>                                                                 6a href="+code=device_id" class="sref">device_id6/a>);
10446/a>                        6spa  class="comment">/* Ignore bits 16 and 18-20 */6/spa >
10456/a>                        switch (6a href="+code=device_type" class="sref">device_type6/a> & 0xffe2ffff) {
10466/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_LEGACY_MONITOR" class="sref">ACPI_VIDEO_DISPLAY_LEGACY_MONITOR6/a>:
10476/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=crt" class="sref">crt6/a> = 1;
10486/a>                                break;
10496/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_LEGACY_PANEL" class="sref">ACPI_VIDEO_DISPLAY_LEGACY_PANEL6/a>:
10506/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=lcd" class="sref">lcd6/a> = 1;
10516/a>                                break;
10526/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_LEGACY_TV" class="sref">ACPI_VIDEO_DISPLAY_LEGACY_TV6/a>:
10536/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=tvout" class="sref">tvout6/a> = 1;
10546/a>                                break;
10556/a>                        default:
10566/a>                                6a href="+code=data" class="sref">data6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=unknown" class="sref">unknown6/a> = 1;
10576/a>                        }
10586/a>                }
10596/a>
10606/a>                6a href="+code=acpi_video_device_bind" class="sref">acpi_video_device_bind6/a>(6a href="+code=video" class="sref">video6/a>, 6a href="+code=data" class="sref">data6/a>);
10616/a>                6a href="+code=acpi_video_device_find_cap" class="sref">acpi_video_device_find_cap6/a>(6a href="+code=data" class="sref">data6/a>);
10626/a>
10636/a>                6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_install_notify_handler" class="sref">acpi_install_notify_handler6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,
10646/a>                                                     6a href="+code=ACPI_DEVICE_NOTIFY" class="sref">ACPI_DEVICE_NOTIFY6/a>,
10656/a>                                                     6a href="+code=acpi_video_device_notify" class="sref">acpi_video_device_notify6/a>,
10666/a>                                                     6a href="+code=data" class="sref">data6/a>);
10676/a>                if (6a href="+code=ACPI_FAILURE" class="sref">ACPI_FAILURE6/a>(6a href="+code=status" class="sref">status6/a>)) {
10686/a>                        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a>
10696/a>                                          6spa  class="string">"Error installing notify handler\n"6/spa >);
10706/a>                        if(6a href="+code=data" class="sref">data6/a>->6a href="+code=brightness" class="sref">brightness6/a>)
10716/a>                                6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=data" class="sref">data6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>);
10726/a>                        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=data" class="sref">data6/a>->6a href="+code=brightness" class="sref">brightness6/a>);
10736/a>                        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=data" class="sref">data6/a>);
10746/a>                        return -6a href="+code=ENODEV" class="sref">ENODEV6/a>;
10756/a>                }
10766/a>
10776/a>                6a href="+code=mutex_lock" class="sref">mutex_lock6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=device_list_lock" class="sref">device_list_lock6/a>);
10786/a>                6a href="+code=list_add_taip" class="sref">list_add_taip6/a>(&6a href="+code=data" class="sref">data6/a>->6a href="+code=entry" class="sref">entry6/a>, &6a href="+code=video" class="sref">video6/a>->6a href="+code=video_device_list" class="sref">video_device_list6/a>);
10796/a>                6a href="+code=mutex_unlock" class="sref">mutex_unlock6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=device_list_lock" class="sref">device_list_lock6/a>);
10806/a>
10816/a>                return 0;
10826/a>        }
10836/a>
10846/a>        return -6a href="+code=ENOENT" class="sref">ENOENT6/a>;
10856/a>}
10866/a>
10876/a>6spa  class="comment">/*6/spa >
10886/a>6spa  class="comment"> *  Arg:6/spa >
10896/a>6spa  class="comment"> *      video   : video bus device 6/spa >
10906/a>6spa  class="comment"> *6/spa >
10916/a>6spa  class="comment"> *  Return:6/spa >
10926/a>6spa  class="comment"> *      none6/spa >
10936/a>6spa  class="comment"> *  6/spa >
10946/a>6spa  class="comment"> *  Enumerate the video device list of the video bus, 6/spa >
10956/a>6spa  class="comment"> *  bind the ids with the corresponding video devices6/spa >
10966/a>6spa  class="comment"> *  under the video bus.6/spa >
10976/a>6spa  class="comment"> */6/spa >
10986/a>
10996/a>static.void 6a href="+code=acpi_video_device_rebind" class="sref">acpi_video_device_rebind6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>)
11006/a>{
11016/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=dev" class="sref">dev6/a>;
11026/a>
11036/a>        6a href="+code=mutex_lock" class="sref">mutex_lock6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=device_list_lock" class="sref">device_list_lock6/a>);
11046/a>
11056/a>        6a href="+code=list_for_each_entry" class="sref">list_for_each_entry6/a>(6a href="+code=dev" class="sref">dev6/a>, &6a href="+code=video" class="sref">video6/a>->6a href="+code=video_device_list" class="sref">video_device_list6/a>, 6a href="+code=entry" class="sref">entry6/a>)
11066/a>                6a href="+code=acpi_video_device_bind" class="sref">acpi_video_device_bind6/a>(6a href="+code=video" class="sref">video6/a>, 6a href="+code=dev" class="sref">dev6/a>);
11076/a>
11086/a>        6a href="+code=mutex_unlock" class="sref">mutex_unlock6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=device_list_lock" class="sref">device_list_lock6/a>);
11096/a>}
11106/a>
11116/a>6spa  class="comment">/*6/spa >
11126/a>6spa  class="comment"> *  Arg:6/spa >
11136/a>6spa  class="comment"> *      video   : video bus device 6/spa >
11146/a>6spa  class="comment"> *      device  : video output device under the video 6/spa >
11156/a>6spa  class="comment"> *              bus6/spa >
11166/a>6spa  class="comment"> *6/spa >
11176/a>6spa  class="comment"> *  Return:6/spa >
11186/a>6spa  class="comment"> *      none6/spa >
11196/a>6spa  class="comment"> *  6/spa >
11206/a>6spa  class="comment"> *  Bind the ids with the corresponding video devices6/spa >
11216/a>6spa  class="comment"> *  under the video bus.6/spa >
11226/a>6spa  class="comment"> */6/spa >
11236/a>
11246/a>static.void
11256/a>6a href="+code=acpi_video_device_bind" class="sref">acpi_video_device_bind6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>,
11266/a>                       struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>)
11276/a>{
11286/a>        struct.6a href="+code=acpi_video_enumerated_device" class="sref">acpi_video_enumerated_device6/a> *6a href="+code=ids" class="sref">ids6/a>;
11296/a>        int 6a href="+code=i" class="sref">i6/a>;
11306/a>
11316/a>        for (6a href="+code=i" class="sref">i6/a> = 0; 6a href="+code=i" class="sref">i6/a> < 6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_count" class="sref">attached_count6/a>; 6a href="+code=i" class="sref">i6/a>++) {
11326/a>                6a href="+code=ids" class="sref">ids6/a> = &6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a>[6a href="+code=i" class="sref">i6/a>];
11336/a>                if (6a href="+code=device" class="sref">device6/a>->6a href="+code=device_id" class="sref">device_id6/a> == (6a href="+code=ids" class="sref">ids6/a>->6a href="+code=vopti" class="sref">vopti6/a>.6a href="+code=int_vop" class="sref">int_vop6/a> & 0xffff)) {
11346/a>                        6a href="+code=ids" class="sref">ids6/a>->6a href="+code=bind_info" class="sref">bind_info6/a> = 6a href="+code=device" class="sref">device6/a>;
11356/a>                        6a href="+code=ACPI_DEBUG_PRINT" class="sref">ACPI_DEBUG_PRINT6/a>((6a href="+code=ACPI_DB_INFO" class="sref">ACPI_DB_INFO6/a>, 6spa  class="string">"device_bind %d\n"6/spa >, 6a href="+code=i" class="sref">i6/a>));
11366/a>                }
11376/a>        }
1138lua>}
11396/a>
11406/a>6spa  class="comment">/*6/spa >
11416/a>6spa  class="comment"> *  Arg:6/spa >
11426/a>6spa  class="comment"> *      video   : video bus device 6/spa >
11436/a>6spa  class="comment"> *6/spa >
11446/a>6spa  class="comment"> *  Return:6/spa >
11456/a>6spa  class="comment"> *      < 0     : error6/spa >
11466/a>6spa  class="comment"> *  6/spa >
11476/a>6spa  class="comment"> *  Call _DOD to enumerate all devices attached to display adapter6/spa >
11486/a>6spa  class="comment"> *6/spa >
11496/a>6spa  class="comment"> */6/spa >
11506/a>
11516/a>static.int 6a href="+code=acpi_video_device_enumerate" class="sref">acpi_video_device_enumerate6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>)
11526/a>{
11536/a>        int 6a href="+code=status" class="sref">status6/a>;
11546/a>        int 6a href="+code=count" class="sref">count6/a>;
11556/a>        int 6a href="+code=i" class="sref">i6/a>;
11566/a>        struct.6a href="+code=acpi_video_enumerated_device" class="sref">acpi_video_enumerated_device6/a> *6a href="+code=active_list" class="sref">active_list6/a>;
11576/a>        struct.6a href="+code=acpi_buffer" class="sref">acpi_buffer6/a> 6a href="+code=buffer" class="sref">buffer6/a> = { 6a href="+code=ACPI_ALLOCATE_BUFFER" class="sref">ACPI_ALLOCATE_BUFFER6/a>, 6a href="+code=NULL" class="sref">NULL6/a> };
11586/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *6a href="+code=dod" class="sref">dod6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
11596/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *6a href="+code=obj" class="sref">obj6/a>;
11606/a>
11616/a>        6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_evoptate_object" class="sref">acpi_evoptate_object6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>,.6spa  class="string">"_DOD"6/spa >, 6a href="+code=NULL" class="sref">NULL6/a>, &6a href="+code=buffer" class="sref">buffer6/a>);
11626/a>        if (!6a href="+code=ACPI_SUCCESS" class="sref">ACPI_SUCCESS6/a>(6a href="+code=status" class="sref">status6/a>)) {
11636/a>                6a href="+code=ACPI_EXCEPTION" class="sref">ACPI_EXCEPTION6/a>((6a href="+code=AE_INFO" class="sref">AE_INFO6/a>, 6a href="+code=status" class="sref">status6/a>,.6spa  class="string">"Evoptating _DOD"6/spa >));
11646/a>                return 6a href="+code=status" class="sref">status6/a>;
11656/a>        }
11666/a>
11676/a>        6a href="+code=dod" class="sref">dod6/a> = 6a href="+code=buffer" class="sref">buffer6/a>.6a href="+code=pointer" class="sref">pointer6/a>;
11686/a>        if (!6a href="+code=dod" class="sref">dod6/a> || (6a href="+code=dod" class="sref">dod6/a>->6a href="+code=type" class="sref">type6/a> != 6a href="+code=ACPI_TYPE_PACKAGE" class="sref">ACPI_TYPE_PACKAGE6/a>)) {
11696/a>                6a href="+code=ACPI_EXCEPTION" class="sref">ACPI_EXCEPTION6/a>((6a href="+code=AE_INFO" class="sref">AE_INFO6/a>, 6a href="+code=status" class="sref">status6/a>,.6spa  class="string">"Invopid _DOD data"6/spa >));
11706/a>                6a href="+code=status" class="sref">status6/a> = -6a href="+code=EFAULT" class="sref">EFAULT6/a>;
11716/a>                goto 6a href="+code=out" class="sref">out6/a>;
11726/a>        }
11736/a>
11746/a>        6a href="+code=ACPI_DEBUG_PRINT" class="sref">ACPI_DEBUG_PRINT6/a>((6a href="+code=ACPI_DB_INFO" class="sref">ACPI_DB_INFO6/a>, 6spa  class="string">"Found %d video heads in _DOD\n"6/spa >,
11756/a>                          6a href="+code=dod" class="sref">dod6/a>->6a href="+code=package" class="sref">package6/a>.6a href="+code=count" class="sref">count6/a>));
11766/a>
11776/a>        6a href="+code=active_list" class="sref">active_list6/a> = 6a href="+code=kcalloc" class="sref">kcalloc6/a>(1 + 6a href="+code=dod" class="sref">dod6/a>->6a href="+code=package" class="sref">package6/a>.6a href="+code=count" class="sref">count6/a>,
11786/a>                              sizeof(struct.6a href="+code=acpi_video_enumerated_device" class="sref">acpi_video_enumerated_device6/a>),
11796/a>                              6a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL6/a>);
11806/a>        if (!6a href="+code=active_list" class="sref">active_list6/a>) {
11816/a>                6a href="+code=status" class="sref">status6/a> = -6a href="+code=ENOMEM" class="sref">ENOMEM6/a>;
11826/a>                goto 6a href="+code=out" class="sref">out6/a>;
11836/a>        }
11846/a>
11856/a>        6a href="+code=count" class="sref">count6/a> = 0;
11866/a>        for (6a href="+code=i" class="sref">i6/a> = 0; 6a href="+code=i" class="sref">i6/a> < 6a href="+code=dod" class="sref">dod6/a>->6a href="+code=package" class="sref">package6/a>.6a href="+code=count" class="sref">count6/a>; 6a href="+code=i" class="sref">i6/a>++) {
11876/a>                6a href="+code=obj" class="sref">obj6/a> = &6a href="+code=dod" class="sref">dod6/a>->6a href="+code=package" class="sref">package6/a>.6a href="+code=elements" class="sref">elements6/a>[6a href="+code=i" class="sref">i6/a>];
11886/a>
11896/a>                if (6a href="+code=obj" class="sref">obj6/a>->6a href="+code=type" class="sref">type6/a> != 6a href="+code=ACPI_TYPE_INTEGER" class="sref">ACPI_TYPE_INTEGER6/a>) {
11906/a>                        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a>
11916/a>                                6spa  class="string">"Invopid _DOD data in element %d\n"6/spa >, 6a href="+code=i" class="sref">i6/a>);
11926/a>                        continue;
11936/a>                }
11946/a>
11956/a>                6a href="+code=active_list" class="sref">active_list6/a>[6a href="+code=count" class="sref">count6/a>].6a href="+code=vopti" class="sref">vopti6/a>.6a href="+code=int_vop" class="sref">int_vop6/a> = 6a href="+code=obj" class="sref">obj6/a>->6a href="+code=integer" class="sref">integer6/a>.6a href="+code=vopti" class="sref">vopti6/a>;
11966/a>                6a href="+code=active_list" class="sref">active_list6/a>[6a href="+code=count" class="sref">count6/a>].6a href="+code=bind_info" class="sref">bind_info6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
11976/a>                6a href="+code=ACPI_DEBUG_PRINT" class="sref">ACPI_DEBUG_PRINT6/a>((6a href="+code=ACPI_DB_INFO" class="sref">ACPI_DB_INFO6/a>, 6spa  class="string">"dod element[%d] = %d\n"6/spa >, 6a href="+code=i" class="sref">i6/a>,
11986/a>                                  (int)6a href="+code=obj" class="sref">obj6/a>->6a href="+code=integer" class="sref">integer6/a>.6a href="+code=vopti" class="sref">vopti6/a>));
11996/a>                6a href="+code=count" class="sref">count6/a>++;
12006/a>        }
12016/a>
12026/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a>);
12036/a>
12046/a>        6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a> = 6a href="+code=active_list" class="sref">active_list6/a>;
12056/a>        6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_count" class="sref">attached_count6/a> = 6a href="+code=count" class="sref">count6/a>;
12066/a>
12076/a> 6a href="+code=out" class="sref">out6/a>:
12086/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=buffer" class="sref">buffer6/a>.6a href="+code=pointer" class="sref">pointer6/a>);
12096/a>        return 6a href="+code=status" class="sref">status6/a>;
12106/a>}
12116/a>
12126/a>static.int
12136/a>6a href="+code=acpi_video_get_next_level" class="sref">acpi_video_get_next_level6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>,
12146/a>                          6a href="+code=u32" class="sref">u326/a> 6a href="+code=level_current" class="sref">level_current6/a>, 6a href="+code=u32" class="sref">u326/a> 6a href="+code=event" class="sref">event6/a>)
12156/a>{
12166/a>        int 6a href="+code=min" class="sref">min6/a>, 6a href="+code=max" class="sref">max6/a>, 6a href="+code=min_above" class="sref">min_above6/a>, 6a href="+code=max_below" class="sref">max_below6/a>, 6a href="+code=i" class="sref">i6/a>, 6a href="+code=l" class="sref">l6/a>, 6a href="+code=delta" class="sref">delta6/a> = 255;
12176/a>        6a href="+code=max" class="sref">max6/a> = 6a href="+code=max_below" class="sref">max_below6/a> = 0;
12186/a>        6a href="+code=min" class="sref">min6/a> = 6a href="+code=min_above" class="sref">min_above6/a> = 255;
12196/a>        6spa  class="comment">/* Find closest level to level_current */6/spa >
12206/a>        for (6a href="+code=i" class="sref">i6/a> = 2; 6a href="+code=i" class="sref">i6/a> < 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a>; 6a href="+code=i" class="sref">i6/a>++) {
12216/a>                6a href="+code=l" class="sref">l6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a>];
12226/a>                if (6a href="+code=abs" class="sref">abs6/a>(6a href="+code=l" class="sref">l6/a> - 6a href="+code=level_current" class="sref">level_current6/a>) < 6a href="+code=abs" class="sref">abs6/a>(6a href="+code=delta" class="sref">delta6/a>)) {
12236/a>                        6a href="+code=delta" class="sref">delta6/a> = 6a href="+code=l" class="sref">l6/a> - 6a href="+code=level_current" class="sref">level_current6/a>;
12246/a>                        if (!6a href="+code=delta" class="sref">delta6/a>)
12256/a>                                break;
12266/a>                }
12276/a>        }
12286/a>        6spa  class="comment">/* Ajust level_current to closest available level */6/spa >
12296/a>        6a href="+code=level_current" class="sref">level_current6/a> += 6a href="+code=delta" class="sref">delta6/a>;
12306/a>        for (6a href="+code=i" class="sref">i6/a> = 2; 6a href="+code=i" class="sref">i6/a> < 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=count" class="sref">count6/a>; 6a href="+code=i" class="sref">i6/a>++) {
12316/a>                6a href="+code=l" class="sref">l6/a> = 6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>[6a href="+code=i" class="sref">i6/a>];
12326/a>                if (6a href="+code=l" class="sref">l6/a> < 6a href="+code=min" class="sref">min6/a>)
12336/a>                        6a href="+code=min" class="sref">min6/a> = 6a href="+code=l" class="sref">l6/a>;
12346/a>                if (6a href="+code=l" class="sref">l6/a> > 6a href="+code=max" class="sref">max6/a>)
12356/a>                        6a href="+code=max" class="sref">max6/a> = 6a href="+code=l" class="sref">l6/a>;
12366/a>                if (6a href="+code=l" class="sref">l6/a> < 6a href="+code=min_above" class="sref">min_above6/a> && 6a href="+code=l" class="sref">l6/a> > 6a href="+code=level_current" class="sref">level_current6/a>)
12376/a>                        6a href="+code=min_above" class="sref">min_above6/a> = 6a href="+code=l" class="sref">l6/a>;
12386/a>                if (6a href="+code=l" class="sref">l6/a> > 6a href="+code=max_below" class="sref">max_below6/a> && 6a href="+code=l" class="sref">l6/a> < 6a href="+code=level_current" class="sref">level_current6/a>)
12396/a>                        6a href="+code=max_below" class="sref">max_below6/a> = 6a href="+code=l" class="sref">l6/a>;
12406/a>        }
12416/a>
12426/a>        switch (6a href="+code=event" class="sref">event6/a>) {
12436/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS6/a>:
12446/a>                return (6a href="+code=level_current" class="sref">level_current6/a> < 6a href="+code=max" class="sref">max6/a>) ? 6a href="+code=min_above" class="sref">min_above6/a> : 6a href="+code=min" class="sref">min6/a>;
12456/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS6/a>:
12466/a>                return (6a href="+code=level_current" class="sref">level_current6/a> < 6a href="+code=max" class="sref">max6/a>) ? 6a href="+code=min_above" class="sref">min_above6/a> : 6a href="+code=max" class="sref">max6/a>;
12476/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS6/a>:
12486/a>                return (6a href="+code=level_current" class="sref">level_current6/a> > 6a href="+code=min" class="sref">min6/a>) ? 6a href="+code=max_below" class="sref">max_below6/a> : 6a href="+code=min" class="sref">min6/a>;
12496/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS6/a>:
12506/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_DISPLAY_OFF" class="sref">ACPI_VIDEO_NOTIFY_DISPLAY_OFF6/a>:
12516/a>                return 0;
12526/a>        default:
12536/a>                return 6a href="+code=level_current" class="sref">level_current6/a>;
12546/a>        }
12556/a>}
12566/a>
12576/a>static.int
12586/a>6a href="+code=acpi_video_switch_brightness" class="sref">acpi_video_switch_brightness6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>, int 6a href="+code=event" class="sref">event6/a>)
12596/a>{
12606/a>        unsigned long long 6a href="+code=level_current" class="sref">level_current6/a>, 6a href="+code=level_next" class="sref">level_next6/a>;
12616/a>        int 6a href="+code=result" class="sref">result6/a> = -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
12626/a>
12636/a>        6spa  class="comment">/* no warning message if acpi_backlight=vendor is used */6/spa >
12646/a>        if (!6a href="+code=acpi_video_backlight_support" class="sref">acpi_video_backlight_support6/a>())
12656/a>                return 0;
12666/a>
12676/a>        if (!6a href="+code=device" class="sref">device6/a>->6a href="+code=brightness" class="sref">brightness6/a>)
12686/a>                goto 6a href="+code=out" class="sref">out6/a>;
12696/a>
12706/a>        6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_video_device_lcd_get_level_current" class="sref">acpi_video_device_lcd_get_level_current6/a>(6a href="+code=device" class="sref">device6/a>,
12716/a>                                                         &6a href="+code=level_current" class="sref">level_current6/a>, 0);
12726/a>        if (6a href="+code=result" class="sref">result6/a>)
12736/a>                goto 6a href="+code=out" class="sref">out6/a>;
12746/a>
12756/a>        6a href="+code=level_next" class="sref">level_next6/a> = 6a href="+code=acpi_video_get_next_level" class="sref">acpi_video_get_next_level6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=level_current" class="sref">level_current6/a>, 6a href="+code=event" class="sref">event6/a>);
12766/a>
12776/a>        6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_video_device_lcd_set_level" class="sref">acpi_video_device_lcd_set_level6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=level_next" class="sref">level_next6/a>);
12786/a>
12796/a>        if (!6a href="+code=result" class="sref">result6/a>)
12806/a>                6a href="+code=backlight_force_update" class="sref">backlight_force_update6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a>,
12816/a>                                       6a href="+code=BACKLIGHT_UPDATE_HOTKEY" class="sref">BACKLIGHT_UPDATE_HOTKEY6/a>);
12826/a>
12836/a>6a href="+code=out" class="sref">out6/a>:
12846/a>        if (6a href="+code=result" class="sref">result6/a>)
12856/a>                6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_ERR" class="sref">KERN_ERR6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a> 6spa  class="string">"Failed to switch the brightness\n"6/spa >);
12866/a>
12876/a>        return 6a href="+code=result" class="sref">result6/a>;
1288lua>}
12896/a>
12906/a>int 6a href="+code=acpi_video_get_edid" class="sref">acpi_video_get_edid6/a>(struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>, int 6a href="+code=type" class="sref">type6/a>, int 6a href="+code=device_id" class="sref">device_id6/a>,
12916/a>                        void **6a href="+code=edid" class="sref">edid6/a>)
12926/a>{
12936/a>        struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>;
12946/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=video_device" class="sref">video_device6/a>;
12956/a>        union 6a href="+code=acpi_object" class="sref">acpi_object6/a> *6a href="+code=buffer" class="sref">buffer6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
12966/a>        6a href="+code=acpi_status" class="sref">acpi_status6/a> 6a href="+code=status" class="sref">status6/a>;
12976/a>        int 6a href="+code=i" class="sref">i6/a>, 6a href="+code=length" class="sref">length6/a>;
12986/a>
12996/a>        if (!6a href="+code=device" class="sref">device6/a> || !6a href="+code=acpi_driver_data" class="sref">acpi_driver_data6/a>(6a href="+code=device" class="sref">device6/a>))
13006/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
13016/a>
13026/a>        6a href="+code=video" class="sref">video6/a> = 6a href="+code=acpi_driver_data" class="sref">acpi_driver_data6/a>(6a href="+code=device" class="sref">device6/a>);
13036/a>
13046/a>        for (6a href="+code=i" class="sref">i6/a> = 0; 6a href="+code=i" class="sref">i6/a> < 6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_count" class="sref">attached_count6/a>; 6a href="+code=i" class="sref">i6/a>++) {
13056/a>                6a href="+code=video_device" class="sref">video_device6/a> = 6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a>[6a href="+code=i" class="sref">i6/a>].6a href="+code=bind_info" class="sref">bind_info6/a>;
13066/a>                6a href="+code=length" class="sref">length6/a> = 256;
13076/a>
13086/a>                if (!6a href="+code=video_device" class="sref">video_device6/a>)
13096/a>                        continue;
13106/a>
13116/a>                if (!6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=cap" class="sref">cap6/a>.6a href="+code=_DDC" class="sref">_DDC6/a>)
13126/a>                        continue;
13136/a>
13146/a>                if (6a href="+code=type" class="sref">type6/a>) {
13156/a>                        switch (6a href="+code=type" class="sref">type6/a>) {
13166/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_CRT" class="sref">ACPI_VIDEO_DISPLAY_CRT6/a>:
13176/a>                                if (!6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=crt" class="sref">crt6/a>)
13186/a>                                        continue;
13196/a>                                break;
13206/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_TV" class="sref">ACPI_VIDEO_DISPLAY_TV6/a>:
13216/a>                                if (!6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=tvout" class="sref">tvout6/a>)
13226/a>                                        continue;
13236/a>                                break;
13246/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_DVI" class="sref">ACPI_VIDEO_DISPLAY_DVI6/a>:
13256/a>                                if (!6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=dvi" class="sref">dvi6/a>)
13266/a>                                        continue;
13276/a>                                break;
13286/a>                        case 6a href="+code=ACPI_VIDEO_DISPLAY_LCD" class="sref">ACPI_VIDEO_DISPLAY_LCD6/a>:
13296/a>                                if (!6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=lcd" class="sref">lcd6/a>)
13306/a>                                        continue;
13316/a>                                break;
13326/a>                        }
13336/a>                } else if (6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=device_id" class="sref">device_id6/a> != 6a href="+code=device_id" class="sref">device_id6/a>) {
13346/a>                        continue;
13356/a>                }
13366/a>
13376/a>                6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_video_device_EDID" class="sref">acpi_video_device_EDID6/a>(6a href="+code=video_device" class="sref">video_device6/a>, &6a href="+code=buffer" class="sref">buffer6/a>, 6a href="+code=length" class="sref">length6/a>);
13386/a>
13396/a>                if (6a href="+code=ACPI_FAILURE" class="sref">ACPI_FAILURE6/a>(6a href="+code=status" class="sref">status6/a>) || !6a href="+code=buffer" class="sref">buffer6/a> ||
13406/a>                    6a href="+code=buffer" class="sref">buffer6/a>->6a href="+code=type" class="sref">type6/a> != 6a href="+code=ACPI_TYPE_BUFFER" class="sref">ACPI_TYPE_BUFFER6/a>) {
13416/a>                        6a href="+code=length" class="sref">length6/a> = 128;
13426/a>                        6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_video_device_EDID" class="sref">acpi_video_device_EDID6/a>(6a href="+code=video_device" class="sref">video_device6/a>, &6a href="+code=buffer" class="sref">buffer6/a>,
13436/a>                                                        6a href="+code=length" class="sref">length6/a>);
13446/a>                        if (6a href="+code=ACPI_FAILURE" class="sref">ACPI_FAILURE6/a>(6a href="+code=status" class="sref">status6/a>) || !6a href="+code=buffer" class="sref">buffer6/a> ||
13456/a>                            6a href="+code=buffer" class="sref">buffer6/a>->6a href="+code=type" class="sref">type6/a> != 6a href="+code=ACPI_TYPE_BUFFER" class="sref">ACPI_TYPE_BUFFER6/a>) {
13466/a>                                continue;
13476/a>                        }
13486/a>                }
13496/a>
13506/a>                *6a href="+code=edid" class="sref">edid6/a> = 6a href="+code=buffer" class="sref">buffer6/a>->6a href="+code=buffer" class="sref">buffer6/a>.6a href="+code=pointer" class="sref">pointer6/a>;
13516/a>                return 6a href="+code=length" class="sref">length6/a>;
13526/a>        }
13536/a>
13546/a>        return -6a href="+code=ENODEV" class="sref">ENODEV6/a>;
13556/a>}
13566/a>6a href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL6/a>(6a href="+code=acpi_video_get_edid" class="sref">acpi_video_get_edid6/a>);
13576/a>
13586/a>static.int
13596/a>6a href="+code=acpi_video_bus_get_devices" class="sref">acpi_video_bus_get_devices6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>,
13606/a>                           struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>)
13616/a>{
13626/a>        int 6a href="+code=status" class="sref">status6/a> = 0;
13636/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=dev" class="sref">dev6/a>;
13646/a>
13656/a>        6spa  class="comment">/*6/spa >
13666/a>6spa  class="comment">         * There are systems where video module known to work fine regardless6/spa >
13676/a>6spa  class="comment">         * of broken _DOD and ignoring returned vopti here doesn't cause6/spa >
13686/a>6spa  class="comment">         * any issues later.6/spa >
13696/a>6spa  class="comment">         */6/spa >
13706/a>        6a href="+code=acpi_video_device_enumerate" class="sref">acpi_video_device_enumerate6/a>(6a href="+code=video" class="sref">video6/a>);
13716/a>
13726/a>        6a href="+code=list_for_each_entry" class="sref">list_for_each_entry6/a>(6a href="+code=dev" class="sref">dev6/a>, &6a href="+code=device" class="sref">device6/a>->6a href="+code=children" class="sref">children6/a>, 6a href="+code=node" class="sref">node6/a>) {
13736/a>
13746/a>                6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_video_bus_get_one_device" class="sref">acpi_video_bus_get_one_device6/a>(6a href="+code=dev" class="sref">dev6/a>, 6a href="+code=video" class="sref">video6/a>);
13756/a>                if (6a href="+code=status" class="sref">status6/a>) {
13766/a>                        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_WARNING" class="sref">KERN_WARNING6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a>
13776/a>                                        6spa  class="string">"Can't attach device\n"6/spa >);
13786/a>                        continue;
13796/a>                }
13806/a>        }
13816/a>        return 6a href="+code=status" class="sref">status6/a>;
13826/a>}
13836/a>
13846/a>static.int 6a href="+code=acpi_video_bus_put_one_device" class="sref">acpi_video_bus_put_one_device6/a>(struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=device" class="sref">device6/a>)
13856/a>{
13866/a>        6a href="+code=acpi_status" class="sref">acpi_status6/a> 6a href="+code=status" class="sref">status6/a>;
13876/a>
13886/a>        if (!6a href="+code=device" class="sref">device6/a> || !6a href="+code=device" class="sref">device6/a>->6a href="+code=video" class="sref">video6/a>)
13896/a>                return -6a href="+code=ENOENT" class="sref">ENOENT6/a>;
13906/a>
13916/a>        6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_remove_notify_handler" class="sref">acpi_remove_notify_handler6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=handle" class="sref">handle6/a>,
13926/a>                                            6a href="+code=ACPI_DEVICE_NOTIFY" class="sref">ACPI_DEVICE_NOTIFY6/a>,
13936/a>                                            6a href="+code=acpi_video_device_notify" class="sref">acpi_video_device_notify6/a>);
13946/a>        if (6a href="+code=ACPI_FAILURE" class="sref">ACPI_FAILURE6/a>(6a href="+code=status" class="sref">status6/a>)) {
13956/a>                6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_WARNING" class="sref">KERN_WARNING6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a>
13966/a>                       6spa  class="string">"Can't remove video notify handler\n"6/spa >);
13976/a>        }
13986/a>        if (6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a>) {
13996/a>                6a href="+code=backlight_device_unregister" class="sref">backlight_device_unregister6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a>);
14006/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=backlight" class="sref">backlight6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
14016/a>        }
14026/a>        if (6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a>) {
14036/a>                6a href="+code=sysfs_remove_link" class="sref">sysfs_remove_link6/a>(&6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>->6a href="+code=dev" class="sref">dev6/a>.6a href="+code=kobj" class="sref">kobj6/a>,
14046/a>                                  6spa  class="string">"thermal_cooling"6/spa >);
14056/a>                6a href="+code=sysfs_remove_link" class="sref">sysfs_remove_link6/a>(&6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a>->6a href="+code=device" class="sref">device6/a>.6a href="+code=kobj" class="sref">kobj6/a>,
14066/a>                                  6spa  class="string">"device"6/spa >);
14076/a>                6a href="+code=thermal_cooling_device_unregister" class="sref">thermal_cooling_device_unregister6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a>);
14086/a>                6a href="+code=device" class="sref">device6/a>->6a href="+code=cooling_dev" class="sref">cooling_dev6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
14096/a>        }
14106/a>
14116/a>        return 0;
14126/a>}
14136/a>
14146/a>static.int 6a href="+code=acpi_video_bus_put_devices" class="sref">acpi_video_bus_put_devices6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>)
14156/a>{
14166/a>        int 6a href="+code=status" class="sref">status6/a>;
14176/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=dev" class="sref">dev6/a>, *6a href="+code=next" class="sref">next6/a>;
14186/a>
14196/a>        6a href="+code=mutex_lock" class="sref">mutex_lock6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=device_list_lock" class="sref">device_list_lock6/a>);
14206/a>
14216/a>        6a href="+code=list_for_each_entry_safe" class="sref">list_for_each_entry_safe6/a>(6a href="+code=dev" class="sref">dev6/a>, 6a href="+code=next" class="sref">next6/a>, &6a href="+code=video" class="sref">video6/a>->6a href="+code=video_device_list" class="sref">video_device_list6/a>, 6a href="+code=entry" class="sref">entry6/a>) {
14226/a>
14236/a>                6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_video_bus_put_one_device" class="sref">acpi_video_bus_put_one_device6/a>(6a href="+code=dev" class="sref">dev6/a>);
14246/a>                if (6a href="+code=ACPI_FAILURE" class="sref">ACPI_FAILURE6/a>(6a href="+code=status" class="sref">status6/a>))
14256/a>                        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_WARNING" class="sref">KERN_WARNING6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a>
14266/a>                               6spa  class="string">"hhuuhhuu bug in acpi video driver.\n"6/spa >);
14276/a>
14286/a>                if (6a href="+code=dev" class="sref">dev6/a>->6a href="+code=brightness" class="sref">brightness6/a>) {
14296/a>                        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=dev" class="sref">dev6/a>->6a href="+code=brightness" class="sref">brightness6/a>->6a href="+code=levels" class="sref">levels6/a>);
14306/a>                        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=dev" class="sref">dev6/a>->6a href="+code=brightness" class="sref">brightness6/a>);
14316/a>                }
14326/a>                6a href="+code=list_del" class="sref">list_del6/a>(&6a href="+code=dev" class="sref">dev6/a>->6a href="+code=entry" class="sref">entry6/a>);
14336/a>                6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=dev" class="sref">dev6/a>);
14346/a>        }
14356/a>
14366/a>        6a href="+code=mutex_unlock" class="sref">mutex_unlock6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=device_list_lock" class="sref">device_list_lock6/a>);
14376/a>
14386/a>        return 0;
14396/a>}
14406/a>
14416/a>6spa  class="comment">/* acpi_video interface */6/spa >
14426/a>
14436/a>static.int 6a href="+code=acpi_video_bus_start_devices" class="sref">acpi_video_bus_start_devices6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>)
14446/a>{
14456/a>        return 6a href="+code=acpi_video_bus_DOS" class="sref">acpi_video_bus_DOS6/a>(6a href="+code=video" class="sref">video6/a>, 0, 0);
14466/a>}
14476/a>
14486/a>static.int 6a href="+code=acpi_video_bus_stop_devices" class="sref">acpi_video_bus_stop_devices6/a>(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>)
14496/a>{
14506/a>        return 6a href="+code=acpi_video_bus_DOS" class="sref">acpi_video_bus_DOS6/a>(6a href="+code=video" class="sref">video6/a>, 0, 1);
14516/a>}
14526/a>
14536/a>static.void 6a href="+code=acpi_video_bus_notify" class="sref">acpi_video_bus_notify6/a>(struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>, 6a href="+code=u32" class="sref">u326/a> 6a href="+code=event" class="sref">event6/a>)
14546/a>{
14556/a>        struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a> = 6a href="+code=acpi_driver_data" class="sref">acpi_driver_data6/a>(6a href="+code=device" class="sref">device6/a>);
14566/a>        struct.6a href="+code=input_dev" class="sref">input_dev6/a> *6a href="+code=input" class="sref">input6/a>;
14576/a>        int 6a href="+code=keycode" class="sref">keycode6/a> = 0;
14586/a>
14596/a>        if (!6a href="+code=video" class="sref">video6/a>)
14606/a>                return;
14616/a>
14626/a>        6a href="+code=input" class="sref">input6/a> = 6a href="+code=video" class="sref">video6/a>->6a href="+code=input" class="sref">input6/a>;
14636/a>
14646/a>        switch (6a href="+code=event" class="sref">event6/a>) {
14656/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_SWITCH" class="sref">ACPI_VIDEO_NOTIFY_SWITCH6/a>:  6spa  class="comment">/* User requested a switch,6/spa >
14666/a>6spa  class="comment">                                         * most likely via hotkey. */6/spa >
14676/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
14686/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_SWITCHVIDEOMODE" class="sref">KEY_SWITCHVIDEOMODE6/a>;
14696/a>                break;
14706/a>
14716/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_PROBE" class="sref">ACPI_VIDEO_NOTIFY_PROBE6/a>:   6spa  class="comment">/* User plugged in or removed a video6/spa >
14726/a>6spa  class="comment">                                         * connector. */6/spa >
14736/a>                6a href="+code=acpi_video_device_enumerate" class="sref">acpi_video_device_enumerate6/a>(6a href="+code=video" class="sref">video6/a>);
14746/a>                6a href="+code=acpi_video_device_rebind" class="sref">acpi_video_device_rebind6/a>(6a href="+code=video" class="sref">video6/a>);
14756/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
14766/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_SWITCHVIDEOMODE" class="sref">KEY_SWITCHVIDEOMODE6/a>;
14776/a>                break;
14786/a>
14796/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_CYCLE" class="sref">ACPI_VIDEO_NOTIFY_CYCLE6/a>:   6spa  class="comment">/* Cycle Display output hotkey pressed. */6/spa >
14806/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
14816/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_SWITCHVIDEOMODE" class="sref">KEY_SWITCHVIDEOMODE6/a>;
14826/a>                break;
14836/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_NEXT_OUTPUT" class="sref">ACPI_VIDEO_NOTIFY_NEXT_OUTPUT6/a>:     6spa  class="comment">/* Next Display output hotkey pressed. */6/spa >
14846/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
14856/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_VIDEO_NEXT" class="sref">KEY_VIDEO_NEXT6/a>;
14866/a>                break;
14876/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_PREV_OUTPUT" class="sref">ACPI_VIDEO_NOTIFY_PREV_OUTPUT6/a>:     6spa  class="comment">/* previous Display output hotkey pressed. */6/spa >
14886/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
14896/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_VIDEO_PREV" class="sref">KEY_VIDEO_PREV6/a>;
14906/a>                break;
14916/a>
14926/a>        default:
14936/a>                6a href="+code=ACPI_DEBUG_PRINT" class="sref">ACPI_DEBUG_PRINT6/a>((6a href="+code=ACPI_DB_INFO" class="sref">ACPI_DB_INFO6/a>,
14946/a>                                  6spa  class="string">"Unsupported event [0x%x]\n"6/spa >, 6a href="+code=event" class="sref">event6/a>));
14956/a>                break;
14966/a>        }
14976/a>
14986/a>        if (6a href="+code=acpi_notifier_call_chain" class="sref">acpi_notifier_call_chain6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0))
14996/a>                6spa  class="comment">/* Something vetoed the keypress. */6/spa >
15006/a>                6a href="+code=keycode" class="sref">keycode6/a> = 0;
15016/a>
15026/a>        if (6a href="+code=keycode" class="sref">keycode6/a>) {
15036/a>                6a href="+code=input_report_key" class="sref">input_report_key6/a>(6a href="+code=input" class="sref">input6/a>, 6a href="+code=keycode" class="sref">keycode6/a>, 1);
15046/a>                6a href="+code=input_sync" class="sref">input_sync6/a>(6a href="+code=input" class="sref">input6/a>);
15056/a>                6a href="+code=input_report_key" class="sref">input_report_key6/a>(6a href="+code=input" class="sref">input6/a>, 6a href="+code=keycode" class="sref">keycode6/a>, 0);
15066/a>                6a href="+code=input_sync" class="sref">input_sync6/a>(6a href="+code=input" class="sref">input6/a>);
15076/a>        }
15086/a>
15096/a>        return;
15106/a>}
15116/a>
15126/a>static.void 6a href="+code=acpi_video_device_notify" class="sref">acpi_video_device_notify6/a>(6a href="+code=acpi_handle" class="sref">acpi_handle6/a> 6a href="+code=handle" class="sref">handle6/a>, 6a href="+code=u32" class="sref">u326/a> 6a href="+code=event" class="sref">event6/a>,.void *6a href="+code=data" class="sref">data6/a>)
15136/a>{
15146/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=video_device" class="sref">video_device6/a> = 6a href="+code=data" class="sref">data6/a>;
15156/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
15166/a>        struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=bus" class="sref">bus6/a>;
15176/a>        struct.6a href="+code=input_dev" class="sref">input_dev6/a> *6a href="+code=input" class="sref">input6/a>;
15186/a>        int 6a href="+code=keycode" class="sref">keycode6/a> = 0;
15196/a>
15206/a>        if (!6a href="+code=video_device" class="sref">video_device6/a>)
15216/a>                return;
15226/a>
15236/a>        6a href="+code=device" class="sref">device6/a> = 6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=dev" class="sref">dev6/a>;
15246/a>        6a href="+code=bus" class="sref">bus6/a> = 6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=video" class="sref">video6/a>;
15256/a>        6a href="+code=input" class="sref">input6/a> = 6a href="+code=bus" class="sref">bus6/a>->6a href="+code=input" class="sref">input6/a>;
15266/a>
15276/a>        switch (6a href="+code=event" class="sref">event6/a>) {
15286/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_CYCLE_BRIGHTNESS6/a>:        6spa  class="comment">/* Cycle brightness */6/spa >
15296/a>                if (6a href="+code=brightness_switch_enabled" class="sref">brightness_switch_enabled6/a>)
15306/a>                        6a href="+code=acpi_video_switch_brightness" class="sref">acpi_video_switch_brightness6/a>(6a href="+code=video_device" class="sref">video_device6/a>, 6a href="+code=event" class="sref">event6/a>);
15316/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
15326/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_BRIGHTNESS_CYCLE" class="sref">KEY_BRIGHTNESS_CYCLE6/a>;
15336/a>                break;
15346/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_INC_BRIGHTNESS6/a>:  6spa  class="comment">/* Increase brightness */6/spa >
15356/a>                if (6a href="+code=brightness_switch_enabled" class="sref">brightness_switch_enabled6/a>)
15366/a>                        6a href="+code=acpi_video_switch_brightness" class="sref">acpi_video_switch_brightness6/a>(6a href="+code=video_device" class="sref">video_device6/a>, 6a href="+code=event" class="sref">event6/a>);
15376/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
15386/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_BRIGHTNESSUP" class="sref">KEY_BRIGHTNESSUP6/a>;
15396/a>                break;
15406/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_DEC_BRIGHTNESS6/a>:  6spa  class="comment">/* Decrease brightness */6/spa >
15416/a>                if (6a href="+code=brightness_switch_enabled" class="sref">brightness_switch_enabled6/a>)
15426/a>                        6a href="+code=acpi_video_switch_brightness" class="sref">acpi_video_switch_brightness6/a>(6a href="+code=video_device" class="sref">video_device6/a>, 6a href="+code=event" class="sref">event6/a>);
15436/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
15446/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_BRIGHTNESSDOWN" class="sref">KEY_BRIGHTNESSDOWN6/a>;
15456/a>                break;
15466/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS" class="sref">ACPI_VIDEO_NOTIFY_ZERO_BRIGHTNESS6/a>: 6spa  class="comment">/* zero brightness */6/spa >
15476/a>                if (6a href="+code=brightness_switch_enabled" class="sref">brightness_switch_enabled6/a>)
15486/a>                        6a href="+code=acpi_video_switch_brightness" class="sref">acpi_video_switch_brightness6/a>(6a href="+code=video_device" class="sref">video_device6/a>, 6a href="+code=event" class="sref">event6/a>);
15496/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
15506/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_BRIGHTNESS_ZERO" class="sref">KEY_BRIGHTNESS_ZERO6/a>;
15516/a>                break;
15526/a>        case 6a href="+code=ACPI_VIDEO_NOTIFY_DISPLAY_OFF" class="sref">ACPI_VIDEO_NOTIFY_DISPLAY_OFF6/a>:     6spa  class="comment">/* display device off */6/spa >
15536/a>                if (6a href="+code=brightness_switch_enabled" class="sref">brightness_switch_enabled6/a>)
15546/a>                        6a href="+code=acpi_video_switch_brightness" class="sref">acpi_video_switch_brightness6/a>(6a href="+code=video_device" class="sref">video_device6/a>, 6a href="+code=event" class="sref">event6/a>);
15556/a>                6a href="+code=acpi_bus_generate_proc_event" class="sref">acpi_bus_generate_proc_event6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
15566/a>                6a href="+code=keycode" class="sref">keycode6/a> = 6a href="+code=KEY_DISPLAY_OFF" class="sref">KEY_DISPLAY_OFF6/a>;
15576/a>                break;
15586/a>        default:
15596/a>                6a href="+code=ACPI_DEBUG_PRINT" class="sref">ACPI_DEBUG_PRINT6/a>((6a href="+code=ACPI_DB_INFO" class="sref">ACPI_DB_INFO6/a>,
15606/a>                                  6spa  class="string">"Unsupported event [0x%x]\n"6/spa >, 6a href="+code=event" class="sref">event6/a>));
15616/a>                break;
15626/a>        }
15636/a>
15646/a>        6a href="+code=acpi_notifier_call_chain" class="sref">acpi_notifier_call_chain6/a>(6a href="+code=device" class="sref">device6/a>, 6a href="+code=event" class="sref">event6/a>, 0);
15656/a>
15666/a>        if (6a href="+code=keycode" class="sref">keycode6/a>) {
15676/a>                6a href="+code=input_report_key" class="sref">input_report_key6/a>(6a href="+code=input" class="sref">input6/a>, 6a href="+code=keycode" class="sref">keycode6/a>, 1);
15686/a>                6a href="+code=input_sync" class="sref">input_sync6/a>(6a href="+code=input" class="sref">input6/a>);
15696/a>                6a href="+code=input_report_key" class="sref">input_report_key6/a>(6a href="+code=input" class="sref">input6/a>, 6a href="+code=keycode" class="sref">keycode6/a>, 0);
15706/a>                6a href="+code=input_sync" class="sref">input_sync6/a>(6a href="+code=input" class="sref">input6/a>);
15716/a>        }
15726/a>
15736/a>        return;
15746/a>}
15756/a>
15766/a>static.int 6a href="+code=acpi_video_resume" class="sref">acpi_video_resume6/a>(struct.6a href="+code=notifier_block" class="sref">notifier_block6/a> *6a href="+code=nb" class="sref">nb6/a>,
15776/a>                                unsigned long 6a href="+code=val" class="sref">val6/a>, void *6a href="+code=ign" class="sref">ign6/a>)
15786/a>{
15796/a>        struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>;
15806/a>        struct.6a href="+code=acpi_video_device" class="sref">acpi_video_device6/a> *6a href="+code=video_device" class="sref">video_device6/a>;
15816/a>        int 6a href="+code=i" class="sref">i6/a>;
15826/a>
15836/a>        switch (6a href="+code=val" class="sref">val6/a>) {
15846/a>        case 6a href="+code=PM_HIBERNATION_PREPARE" class="sref">PM_HIBERNATION_PREPARE6/a>:
15856/a>        case 6a href="+code=PM_SUSPEND_PREPARE" class="sref">PM_SUSPEND_PREPARE6/a>:
15866/a>        case 6a href="+code=PM_RESTORE_PREPARE" class="sref">PM_RESTORE_PREPARE6/a>:
15876/a>                return 6a href="+code=NOTIFY_DONE" class="sref">NOTIFY_DONE6/a>;
15886/a>        }
15896/a>
15906/a>        6a href="+code=video" class="sref">video6/a> = 6a href="+code=container_of" class="sref">container_of6/a>(6a href="+code=nb" class="sref">nb6/a>, struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a>, 6a href="+code=pm_nb" class="sref">pm_nb6/a>);
15916/a>
15926/a>        6a href="+code=dev_info" class="sref">dev_info6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>, 6spa  class="string">"Restoring backlight state\n"6/spa >);
15936/a>
15946/a>        for (6a href="+code=i" class="sref">i6/a> = 0; 6a href="+code=i" class="sref">i6/a> < 6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_count" class="sref">attached_count6/a>; 6a href="+code=i" class="sref">i6/a>++) {
15956/a>                6a href="+code=video_device" class="sref">video_device6/a> = 6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a>[6a href="+code=i" class="sref">i6/a>].6a href="+code=bind_info" class="sref">bind_info6/a>;
15966/a>                if (6a href="+code=video_device" class="sref">video_device6/a> && 6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=backlight" class="sref">backlight6/a>)
15976/a>                        6a href="+code=acpi_video_set_brightness" class="sref">acpi_video_set_brightness6/a>(6a href="+code=video_device" class="sref">video_device6/a>->6a href="+code=backlight" class="sref">backlight6/a>);
15986/a>        }
15996/a>
16006/a>        return 6a href="+code=NOTIFY_OK" class="sref">NOTIFY_OK6/a>;
16016/a>}
16026/a>
16036/a>static.6a href="+code=acpi_status" class="sref">acpi_status6/a>
16046/a>6a href="+code=acpi_video_bus_match" class="sref">acpi_video_bus_match6/a>(6a href="+code=acpi_handle" class="sref">acpi_handle6/a> 6a href="+code=handle" class="sref">handle6/a>, 6a href="+code=u32" class="sref">u326/a> 6a href="+code=level" class="sref">level6/a>, void *6a href="+code=context" class="sref">context6/a>,
16056/a>                        void **6a href="+code=return_value" class="sref">return_value6/a>)
16066/a>{
16076/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a> = 6a href="+code=context" class="sref">context6/a>;
16086/a>        struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=sibling" class="sref">sibling6/a>;
16096/a>        int 6a href="+code=result" class="sref">result6/a>;
16106/a>
16116/a>        if (6a href="+code=handle" class="sref">handle6/a> == 6a href="+code=device" class="sref">device6/a>->6a href="+code=handle" class="sref">handle6/a>)
16126/a>                return 6a href="+code=AE_CTRL_TERMINATE" class="sref">AE_CTRL_TERMINATE6/a>;
16136/a>
16146/a>        6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_bus_get_device" class="sref">acpi_bus_get_device6/a>(6a href="+code=handle" class="sref">handle6/a>, &6a href="+code=sibling" class="sref">sibling6/a>);
16156/a>        if (6a href="+code=result" class="sref">result6/a>)
16166/a>                return 6a href="+code=AE_OK" class="sref">AE_OK6/a>;
16176/a>
16186/a>        if (!6a href="+code=strcmp" class="sref">strcmp6/a>(6a href="+code=acpi_device_name" class="sref">acpi_device_name6/a>(6a href="+code=sibling" class="sref">sibling6/a>), 6a href="+code=ACPI_VIDEO_BUS_NAME" class="sref">ACPI_VIDEO_BUS_NAME6/a>))
16196/a>                        return 6a href="+code=AE_ALREADY_EXISTS" class="sref">AE_ALREADY_EXISTS6/a>;
16206/a>
16216/a>        return 6a href="+code=AE_OK" class="sref">AE_OK6/a>;
16226/a>}
16236/a>
16246/a>static.int 6a href="+code=instance" class="sref">instance6/a>;
16256/a>
16266/a>static.int 6a href="+code=acpi_video_bus_add" class="sref">acpi_video_bus_add6/a>(struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>)
16276/a>{
16286/a>        struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a>;
16296/a>        struct.6a href="+code=input_dev" class="sref">input_dev6/a> *6a href="+code=input" class="sref">input6/a>;
16306/a>        int 6a href="+code=error" class="sref">error6/a>;
16316/a>        6a href="+code=acpi_status" class="sref">acpi_status6/a> 6a href="+code=status" class="sref">status6/a>;
16326/a>
16336/a>        6a href="+code=status" class="sref">status6/a> = 6a href="+code=acpi_walk_namespace" class="sref">acpi_walk_namespace6/a>(6a href="+code=ACPI_TYPE_DEVICE" class="sref">ACPI_TYPE_DEVICE6/a>,
16346/a>                                6a href="+code=device" class="sref">device6/a>->6a href="+code=parent" class="sref">parent6/a>->6a href="+code=handle" class="sref">handle6/a>, 1,
16356/a>                                6a href="+code=acpi_video_bus_match" class="sref">acpi_video_bus_match6/a>, 6a href="+code=NULL" class="sref">NULL6/a>,
16366/a>                                6a href="+code=device" class="sref">device6/a>, 6a href="+code=NULL" class="sref">NULL6/a>);
16376/a>        if (6a href="+code=status" class="sref">status6/a> == 6a href="+code=AE_ALREADY_EXISTS" class="sref">AE_ALREADY_EXISTS6/a>) {
16386/a>                6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_WARNING" class="sref">KERN_WARNING6/a> 6a href="+code=FW_BUG" class="sref">FW_BUG6/a>
16396/a>                        6spa  class="string">"Duplicate ACPI video bus devices for the"6/spa >
16406/a>                        6spa  class="string">" sami VGA controller, please try module "6/spa >
16416/a>                        6spa  class="string">"paramiter \"video.allow_duplicates=1\""6/spa >
16426/a>                        6spa  class="string">"if the current driver doesn't work.\n"6/spa >);
16436/a>                if (!6a href="+code=allow_duplicates" class="sref">allow_duplicates6/a>)
16446/a>                        return -6a href="+code=ENODEV" class="sref">ENODEV6/a>;
16456/a>        }
16466/a>
16476/a>        6a href="+code=video" class="sref">video6/a> = 6a href="+code=kzalloc" class="sref">kzalloc6/a>(sizeof(struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a>), 6a href="+code=GFP_KERNEL" class="sref">GFP_KERNEL6/a>);
16486/a>        if (!6a href="+code=video" class="sref">video6/a>)
16496/a>                return -6a href="+code=ENOMEM" class="sref">ENOMEM6/a>;
16506/a>
16516/a>        6spa  class="comment">/* a hack to fix the duplicate nami "VID" problem on T61 */6/spa >
16526/a>        if (!6a href="+code=strcmp" class="sref">strcmp6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=pnp" class="sref">pnp6/a>.6a href="+code=bus_id" class="sref">bus_id6/a>, 6spa  class="string">"VID"6/spa >)) {
16536/a>                if (6a href="+code=instance" class="sref">instance6/a>)
16546/a>                        6a href="+code=device" class="sref">device6/a>->6a href="+code=pnp" class="sref">pnp6/a>.6a href="+code=bus_id" class="sref">bus_id6/a>[3] = 6spa  class="string">'0'6/spa > + 6a href="+code=instance" class="sref">instance6/a>;
16556/a>                6a href="+code=instance" class="sref">instance6/a> ++;
16566/a>        }
16576/a>        6spa  class="comment">/* a hack to fix the duplicate nami "VGA" problem on Pa 3553 */6/spa >
16586/a>        if (!6a href="+code=strcmp" class="sref">strcmp6/a>(6a href="+code=device" class="sref">device6/a>->6a href="+code=pnp" class="sref">pnp6/a>.6a href="+code=bus_id" class="sref">bus_id6/a>, 6spa  class="string">"VGA"6/spa >)) {
16596/a>                if (6a href="+code=instance" class="sref">instance6/a>)
16606/a>                        6a href="+code=device" class="sref">device6/a>->6a href="+code=pnp" class="sref">pnp6/a>.6a href="+code=bus_id" class="sref">bus_id6/a>[3] = 6spa  class="string">'0'6/spa > + 6a href="+code=instance" class="sref">instance6/a>;
16616/a>                6a href="+code=instance" class="sref">instance6/a>++;
16626/a>        }
16636/a>
16646/a>        6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a> = 6a href="+code=device" class="sref">device6/a>;
16656/a>        6a href="+code=strcpy" class="sref">strcpy6/a>(6a href="+code=acpi_device_name" class="sref">acpi_device_name6/a>(6a href="+code=device" class="sref">device6/a>), 6a href="+code=ACPI_VIDEO_BUS_NAME" class="sref">ACPI_VIDEO_BUS_NAME6/a>);
16666/a>        6a href="+code=strcpy" class="sref">strcpy6/a>(6a href="+code=acpi_device_class" class="sref">acpi_device_class6/a>(6a href="+code=device" class="sref">device6/a>), 6a href="+code=ACPI_VIDEO_CLASS" class="sref">ACPI_VIDEO_CLASS6/a>);
16676/a>        6a href="+code=device" class="sref">device6/a>->6a href="+code=driver_data" class="sref">driver_data6/a> = 6a href="+code=video" class="sref">video6/a>;
16686/a>
16696/a>        6a href="+code=acpi_video_bus_find_cap" class="sref">acpi_video_bus_find_cap6/a>(6a href="+code=video" class="sref">video6/a>);
16706/a>        6a href="+code=error" class="sref">error6/a> = 6a href="+code=acpi_video_bus_check" class="sref">acpi_video_bus_check6/a>(6a href="+code=video" class="sref">video6/a>);
16716/a>        if (6a href="+code=error" class="sref">error6/a>)
16726/a>                goto 6a href="+code=err_free_video" class="sref">err_free_video6/a>;
16736/a>
16746/a>        6a href="+code=mutex_init" class="sref">mutex_init6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=device_list_lock" class="sref">device_list_lock6/a>);
16756/a>        6a href="+code=INIT_LIST_HEAD" class="sref">INIT_LIST_HEAD6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=video_device_list" class="sref">video_device_list6/a>);
16766/a>
16776/a>        6a href="+code=error" class="sref">error6/a> = 6a href="+code=acpi_video_bus_get_devices" class="sref">acpi_video_bus_get_devices6/a>(6a href="+code=video" class="sref">video6/a>, 6a href="+code=device" class="sref">device6/a>);
16786/a>        if (6a href="+code=error" class="sref">error6/a>)
16796/a>                goto 6a href="+code=err_free_video" class="sref">err_free_video6/a>;
16806/a>
16816/a>        6a href="+code=video" class="sref">video6/a>->6a href="+code=input" class="sref">input6/a> = 6a href="+code=input" class="sref">input6/a> = 6a href="+code=input_allocate_device" class="sref">input_allocate_device6/a>();
16826/a>        if (!6a href="+code=input" class="sref">input6/a>) {
16836/a>                6a href="+code=error" class="sref">error6/a> = -6a href="+code=ENOMEM" class="sref">ENOMEM6/a>;
16846/a>                goto 6a href="+code=err_put_video" class="sref">err_put_video6/a>;
16856/a>        }
16866/a>
16876/a>        6a href="+code=error" class="sref">error6/a> = 6a href="+code=acpi_video_bus_start_devices" class="sref">acpi_video_bus_start_devices6/a>(6a href="+code=video" class="sref">video6/a>);
16886/a>        if (6a href="+code=error" class="sref">error6/a>)
16896/a>                goto 6a href="+code=err_free_input_dev" class="sref">err_free_input_dev6/a>;
16906/a>
16916/a>        6a href="+code=snprintf" class="sref">snprintf6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=phys" class="sref">phys6/a>, sizeof(6a href="+code=video" class="sref">video6/a>->6a href="+code=phys" class="sref">phys6/a>),
16926/a>                6spa  class="string">"%s/video/input0"6/spa >, 6a href="+code=acpi_device_hid" class="sref">acpi_device_hid6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>));
16936/a>
16946/a>        6a href="+code=input" class="sref">input6/a>->6a href="+code=name" class="sref">name6/a> = 6a href="+code=acpi_device_name" class="sref">acpi_device_name6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=device" class="sref">device6/a>);
16956/a>        6a href="+code=input" class="sref">input6/a>->6a href="+code=phys" class="sref">phys6/a> = 6a href="+code=video" class="sref">video6/a>->6a href="+code=phys" class="sref">phys6/a>;
16966/a>        6a href="+code=input" class="sref">input6/a>->6a href="+code=id" class="sref">id6/a>.6a href="+code=bustype" class="sref">bustype6/a> = 6a href="+code=BUS_HOST" class="sref">BUS_HOST6/a>;
16976/a>        6a href="+code=input" class="sref">input6/a>->6a href="+code=id" class="sref">id6/a>.6a href="+code=product" class="sref">product6/a> = 0x06;
16986/a>        6a href="+code=input" class="sref">input6/a>->6a href="+code=dev" class="sref">dev6/a>.6a href="+code=parent" class="sref">parent6/a> = &6a href="+code=device" class="sref">device6/a>->6a href="+code=dev" class="sref">dev6/a>;
16996/a>        6a href="+code=input" class="sref">input6/a>->6a href="+code=evbit" class="sref">evbit6/a>[0] = 6a href="+code=BIT" class="sref">BIT6/a>(6a href="+code=EV_KEY" class="sref">EV_KEY6/a>);
17006/a>        6a href="+code=set_bit" class="sref">set_bit6/a>(6a href="+code=KEY_SWITCHVIDEOMODE" class="sref">KEY_SWITCHVIDEOMODE6/a>, 6a href="+code=input" class="sref">input6/a>->6a href="+code=keybit" class="sref">keybit6/a>);
17016/a>        6a href="+code=set_bit" class="sref">set_bit6/a>(6a href="+code=KEY_VIDEO_NEXT" class="sref">KEY_VIDEO_NEXT6/a>, 6a href="+code=input" class="sref">input6/a>->6a href="+code=keybit" class="sref">keybit6/a>);
17026/a>        6a href="+code=set_bit" class="sref">set_bit6/a>(6a href="+code=KEY_VIDEO_PREV" class="sref">KEY_VIDEO_PREV6/a>, 6a href="+code=input" class="sref">input6/a>->6a href="+code=keybit" class="sref">keybit6/a>);
17036/a>        6a href="+code=set_bit" class="sref">set_bit6/a>(6a href="+code=KEY_BRIGHTNESS_CYCLE" class="sref">KEY_BRIGHTNESS_CYCLE6/a>, 6a href="+code=input" class="sref">input6/a>->6a href="+code=keybit" class="sref">keybit6/a>);
17046/a>        6a href="+code=set_bit" class="sref">set_bit6/a>(6a href="+code=KEY_BRIGHTNESSUP" class="sref">KEY_BRIGHTNESSUP6/a>, 6a href="+code=input" class="sref">input6/a>->6a href="+code=keybit" class="sref">keybit6/a>);
17056/a>        6a href="+code=set_bit" class="sref">set_bit6/a>(6a href="+code=KEY_BRIGHTNESSDOWN" class="sref">KEY_BRIGHTNESSDOWN6/a>, 6a href="+code=input" class="sref">input6/a>->6a href="+code=keybit" class="sref">keybit6/a>);
17066/a>        6a href="+code=set_bit" class="sref">set_bit6/a>(6a href="+code=KEY_BRIGHTNESS_ZERO" class="sref">KEY_BRIGHTNESS_ZERO6/a>, 6a href="+code=input" class="sref">input6/a>->6a href="+code=keybit" class="sref">keybit6/a>);
17076/a>        6a href="+code=set_bit" class="sref">set_bit6/a>(6a href="+code=KEY_DISPLAY_OFF" class="sref">KEY_DISPLAY_OFF6/a>, 6a href="+code=input" class="sref">input6/a>->6a href="+code=keybit" class="sref">keybit6/a>);
17086/a>
17096/a>        6a href="+code=printk" class="sref">printk6/a>(6a href="+code=KERN_INFO" class="sref">KERN_INFO6/a> 6a href="+code=PREFIX" class="sref">PREFIX6/a> 6spa  class="string">"%s [%s] (multi-head: %s  rom: %s  post: %s)\n"6/spa >,
17106/a>               6a href="+code=ACPI_VIDEO_DEVICE_NAME" class="sref">ACPI_VIDEO_DEVICE_NAME6/a>, 6a href="+code=acpi_device_bid" class="sref">acpi_device_bid6/a>(6a href="+code=device" class="sref">device6/a>),
17116/a>               6a href="+code=video" class="sref">video6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=multihead" class="sref">multihead6/a> ? 6spa  class="string">"yes"6/spa > : 6spa  class="string">"no"6/spa >,
17126/a>               6a href="+code=video" class="sref">video6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=rom" class="sref">rom6/a> ? 6spa  class="string">"yes"6/spa > : 6spa  class="string">"no"6/spa >,
17136/a>               6a href="+code=video" class="sref">video6/a>->6a href="+code=flags" class="sref">flags6/a>.6a href="+code=post" class="sref">post6/a> ? 6spa  class="string">"yes"6/spa > : 6spa  class="string">"no"6/spa >);
17146/a>
17156/a>        6a href="+code=video" class="sref">video6/a>->6a href="+code=pm_nb" class="sref">pm_nb6/a>.6a href="+code=notifier_call" class="sref">notifier_call6/a> = 6a href="+code=acpi_video_resume" class="sref">acpi_video_resume6/a>;
17166/a>        6a href="+code=video" class="sref">video6/a>->6a href="+code=pm_nb" class="sref">pm_nb6/a>.6a href="+code=priority" class="sref">priority6/a> = 0;
17176/a>        6a href="+code=error" class="sref">error6/a> = 6a href="+code=register_pm_notifier" class="sref">register_pm_notifier6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=pm_nb" class="sref">pm_nb6/a>);
17186/a>        if (6a href="+code=error" class="sref">error6/a>)
17196/a>                goto 6a href="+code=err_stop_video" class="sref">err_stop_video6/a>;
17206/a>
17216/a>        6a href="+code=error" class="sref">error6/a> = 6a href="+code=input_register_device" class="sref">input_register_device6/a>(6a href="+code=input" class="sref">input6/a>);
17226/a>        if (6a href="+code=error" class="sref">error6/a>)
17236/a>                goto 6a href="+code=err_unregister_pm_notifier" class="sref">err_unregister_pm_notifier6/a>;
17246/a>
17256/a>        return 0;
17266/a>
17276/a> 6a href="+code=err_unregister_pm_notifier" class="sref">err_unregister_pm_notifier6/a>:
17286/a>        6a href="+code=unregister_pm_notifier" class="sref">unregister_pm_notifier6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=pm_nb" class="sref">pm_nb6/a>);
17296/a> 6a href="+code=err_stop_video" class="sref">err_stop_video6/a>:
17306/a>        6a href="+code=acpi_video_bus_stop_devices" class="sref">acpi_video_bus_stop_devices6/a>(6a href="+code=video" class="sref">video6/a>);
17316/a> 6a href="+code=err_free_input_dev" class="sref">err_free_input_dev6/a>:
17326/a>        6a href="+code=input_free_device" class="sref">input_free_device6/a>(6a href="+code=input" class="sref">input6/a>);
17336/a> 6a href="+code=err_put_video" class="sref">err_put_video6/a>:
17346/a>        6a href="+code=acpi_video_bus_put_devices" class="sref">acpi_video_bus_put_devices6/a>(6a href="+code=video" class="sref">video6/a>);
17356/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a>);
17366/a> 6a href="+code=err_free_video" class="sref">err_free_video6/a>:
17376/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=video" class="sref">video6/a>);
17386/a>        6a href="+code=device" class="sref">device6/a>->6a href="+code=driver_data" class="sref">driver_data6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
17396/a>
17406/a>        return 6a href="+code=error" class="sref">error6/a>;
17416/a>}
17426/a>
17436/a>static.int 6a href="+code=acpi_video_bus_remove" class="sref">acpi_video_bus_remove6/a>(struct.6a href="+code=acpi_device" class="sref">acpi_device6/a> *6a href="+code=device" class="sref">device6/a>,.int 6a href="+code=type" class="sref">type6/a>)
17446/a>{
17456/a>        struct.6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a> *6a href="+code=video" class="sref">video6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
17466/a>
17476/a>
17486/a>        if (!6a href="+code=device" class="sref">device6/a> || !6a href="+code=acpi_driver_data" class="sref">acpi_driver_data6/a>(6a href="+code=device" class="sref">device6/a>))
17496/a>                return -6a href="+code=EINVAL" class="sref">EINVAL6/a>;
17506/a>
17516/a>        6a href="+code=video" class="sref">video6/a> = 6a href="+code=acpi_driver_data" class="sref">acpi_driver_data6/a>(6a href="+code=device" class="sref">device6/a>);
17526/a>
17536/a>        6a href="+code=unregister_pm_notifier" class="sref">unregister_pm_notifier6/a>(&6a href="+code=video" class="sref">video6/a>->6a href="+code=pm_nb" class="sref">pm_nb6/a>);
17546/a>
17556/a>        6a href="+code=acpi_video_bus_stop_devices" class="sref">acpi_video_bus_stop_devices6/a>(6a href="+code=video" class="sref">video6/a>);
17566/a>        6a href="+code=acpi_video_bus_put_devices" class="sref">acpi_video_bus_put_devices6/a>(6a href="+code=video" class="sref">video6/a>);
17576/a>
17586/a>        6a href="+code=input_unregister_device" class="sref">input_unregister_device6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=input" class="sref">input6/a>);
17596/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=video" class="sref">video6/a>->6a href="+code=attached_array" class="sref">attached_array6/a>);
17606/a>        6a href="+code=kfree" class="sref">kfree6/a>(6a href="+code=video" class="sref">video6/a>);
17616/a>
17626/a>        return 0;
17636/a>}
17646/a>
17656/a>static.int 6a href="+code=__init" class="sref">__init6/a> 6a href="+code=is_i740" class="sref">is_i7406/a>(struct.6a href="+code=pci_dev" class="sref">pci_dev6/a> *6a href="+code=dev" class="sref">dev6/a>)
17666/a>{
17676/a>        if (6a href="+code=dev" class="sref">dev6/a>->6a href="+code=device" class="sref">device6/a> == 0x00D1)
17686/a>                return 1;
17696/a>        if (6a href="+code=dev" class="sref">dev6/a>->6a href="+code=device" class="sref">device6/a> == 0x7000)
17706/a>                return 1;
17716/a>        return 0;
17726/a>}
17736/a>
17746/a>static.int 6a href="+code=__init" class="sref">__init6/a> 6a href="+code=intel_opregion_present" class="sref">intel_opregion_present6/a>(void)
17756/a>{
17766/a>        int 6a href="+code=opregion" class="sref">opregion6/a> = 0;
17776/a>        struct.6a href="+code=pci_dev" class="sref">pci_dev6/a> *6a href="+code=dev" class="sref">dev6/a> = 6a href="+code=NULL" class="sref">NULL6/a>;
17786/a>        6a href="+code=u32" class="sref">u326/a> 6a href="+code=address" class="sref">address6/a>;
17796/a>
17806/a>        6a href="+code=for_each_pci_dev" class="sref">for_each_pci_dev6/a>(6a href="+code=dev" class="sref">dev6/a>) {
17816/a>                if ((6a href="+code=dev" class="sref">dev6/a>->6a href="+code=class" class="sref">class6/a> >> 8) != 6a href="+code=PCI_CLASS_DISPLAY_VGA" class="sref">PCI_CLASS_DISPLAY_VGA6/a>)
17826/a>                        continue;
17836/a>                if (6a href="+code=dev" class="sref">dev6/a>->6a href="+code=vendor" class="sref">vendor6/a> != 6a href="+code=PCI_VENDOR_ID_INTEL" class="sref">PCI_VENDOR_ID_INTEL6/a>)
17846/a>                        continue;
17856/a>                6spa  class="comment">/* We don't want to poke around undefined i740 registers */6/spa >
17866/a>                if (6a href="+code=is_i740" class="sref">is_i7406/a>(6a href="+code=dev" class="sref">dev6/a>))
17876/a>                        continue;
17886/a>                6a href="+code=pci_read_config_dword" class="sref">pci_read_config_dword6/a>(6a href="+code=dev" class="sref">dev6/a>, 0xfc, &6a href="+code=address" class="sref">address6/a>);
17896/a>                if (!6a href="+code=address" class="sref">address6/a>)
17906/a>                        continue;
17916/a>                6a href="+code=opregion" class="sref">opregion6/a> = 1;
17926/a>        }
17936/a>        return 6a href="+code=opregion" class="sref">opregion6/a>;
17946/a>}
17956/a>
17966/a>int 6a href="+code=acpi_video_register" class="sref">acpi_video_register6/a>(void)
17976/a>{
17986/a>        int 6a href="+code=result" class="sref">result6/a> = 0;
17996/a>        if (6a href="+code=register_count" class="sref">register_count6/a>) {
18006/a>                6spa  class="comment">/*6/spa >
18016/a>6spa  class="comment">                 * if the function of acpi_video_register is already called,6/spa >
18026/a>6spa  class="comment">                 * don't register the acpi_vide_bus again and return no error.6/spa >
18036/a>6spa  class="comment">                 */6/spa >
18046/a>                return 0;
18056/a>        }
18066/a>
18076/a>        6a href="+code=result" class="sref">result6/a> = 6a href="+code=acpi_bus_register_driver" class="sref">acpi_bus_register_driver6/a>(&6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a>);
18086/a>        if (6a href="+code=result" class="sref">result6/a> < 0)
18096/a>                return -6a href="+code=ENODEV" class="sref">ENODEV6/a>;
18106/a>
18116/a>        6spa  class="comment">/*6/spa >
18126/a>6spa  class="comment">         * When the acpi_video_bus is loaded successfully,.increase6/spa >
18136/a>6spa  class="comment">         * the counter reference.6/spa >
18146/a>6spa  class="comment">         */6/spa >
18156/a>        6a href="+code=register_count" class="sref">register_count6/a> = 1;
18166/a>
18176/a>        return 0;
18186/a>}
18196/a>6a href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL6/a>(6a href="+code=acpi_video_register" class="sref">acpi_video_register6/a>);
18206/a>
18216/a>void 6a href="+code=acpi_video_unregister" class="sref">acpi_video_unregister6/a>(void)
18226/a>{
18236/a>        if (!6a href="+code=register_count" class="sref">register_count6/a>) {
18246/a>                6spa  class="comment">/*6/spa >
18256/a>6spa  class="comment">                 * If the acpi video bus is already unloaded, don't6/spa >
18266/a>6spa  class="comment">                 * unload it again and return directly.6/spa >
18276/a>6spa  class="comment">                 */6/spa >
18286/a>                return;
18296/a>        }
18306/a>        6a href="+code=acpi_bus_unregister_driver" class="sref">acpi_bus_unregister_driver6/a>(&6a href="+code=acpi_video_bus" class="sref">acpi_video_bus6/a>);
18316/a>
18326/a>        6a href="+code=register_count" class="sref">register_count6/a> = 0;
18336/a>
18346/a>        return;
18356/a>}
18366/a>6a href="+code=EXPORT_SYMBOL" class="sref">EXPORT_SYMBOL6/a>(6a href="+code=acpi_video_unregister" class="sref">acpi_video_unregister6/a>);
18376/a>
18386/a>6spa  class="comment">/*6/spa >
18396/a>6spa  class="comment"> * This is kind of nasty. Hardware using Intel chipsets may require6/spa >
18406/a>6spa  class="comment"> * the video opregion code to be run first.in order to initialise6/spa >
18416/a>6spa  class="comment"> * state before any ACPI video calls are made. To handle this we defer6/spa >
18426/a>6spa  class="comment"> * registration of the video class until the opregion code has run.6/spa >
18436/a>6spa  class="comment"> */6/spa >
18446/a>
18456/a>static.int 6a href="+code=__init" class="sref">__init6/a> 6a href="+code=acpi_video_init" class="sref">acpi_video_init6/a>(void)
18466/a>{
18476/a>        6a href="+code=dmi_check_system" class="sref">dmi_check_system6/a>(6a href="+code=video_dmi_table" class="sref">video_dmi_table6/a>);
18486/a>
18496/a>        if (6a href="+code=intel_opregion_present" class="sref">intel_opregion_present6/a>())
18506/a>                return 0;
18516/a>
18526/a>        return 6a href="+code=acpi_video_register" class="sref">acpi_video_register6/a>();
18536/a>}
18546/a>
18556/a>static.void 6a href="+code=__exit" class="sref">__exit6/a> 6a href="+code=acpi_video_exit" class="sref">acpi_video_exit6/a>(void)
18566/a>{
18576/a>        6a href="+code=acpi_video_unregister" class="sref">acpi_video_unregister6/a>();
18586/a>
18596/a>        return;
18606/a>}
18616/a>
18626/a>6a href="+code=module_init" class="sref">module_init6/a>(6a href="+code=acpi_video_init" class="sref">acpi_video_init6/a>);
18636/a>6a href="+code=module_exit" class="sref">module_exit6/a>(6a href="+code=acpi_video_exit" class="sref">acpi_video_exit6/a>);
18646/a>
lxr.linux.no kindly hosted by Redpill Linpro AS6/a>, provider of Linux consulting and operations services since 1995.