summaryrefslogtreecommitdiff
path: root/drivers/acpi/video.c
AgeCommit message (Collapse)Author
2007-09-18ACPI: video: remove dmesg spamMaik Broemme
i am actually heavily using the ACPI video extension for my Thinkpad X61 Tablet. I have bound the input events triggered by the brightness up/down keys to a simple echo <value> > /sys/class/backlight/acpi_video1/brightness but everytime the event is triggered and acpi_video_device_lcd_set_level() is called i got a notificication in my kernel log like: set_level status: 0 set_level status: 0 set_level status: 0 set_level status: 0 ... Signed-off-by: Maik Broemme <mbroemme@plusserver.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-09-18ACPI: video: _DOS=0 by default to prevent hotkey hangZhang Rui
In the past, the Linux/ACPI video driver invoked _DOS (Display Output Switch) with the parameter 1 to tell the BIOS to switch the video output display for us. But this conflicts with Linux native graphics drivers, and can cause all sorts of issues, including hanging the system. http://bugzilla.kernel.org/show_bug.cgi?id=6001 Here we change the Linux default to evaluate _DOS=0, which tells the BIOS to simply send us a hotkey event and not touch the graphics hardware. The acpi video driver sends the display switch hotkey event up through the intput layer, and X can interpret that and use its native graphics driver to switch the display. For the case where Linux has no native graphics driver running, or the graphics driver doesn't know how to switch video and the BIOS (safely) does, the previous behaviour can be restored with: # echo 1 > /proc/acpi/video/*/DOS Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-08-25Pull bugzilla-8798 into release branchLen Brown
2007-08-25ACPI: work around duplicate name "VID" problem on T61Zhang Rui
This can only fix the problem that more than one video bus device have the same AML name "VID". ie. the proc I/F for the second "VID" video bus device is located under /proc/acpi/video/VID1/... As this is really rare and the ACPI proc I/F is a legacy feature that we are planning to remove. We won't provide a generic solution for this problem. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-08-25Pull events into release branchLen Brown
Conflicts: drivers/acpi/video.c Signed-off-by: Len Brown <len.brown@intel.com>
2007-08-24ACPI video hotkey: export missing ACPI video hotkey events via input layerLuming Yu
Signed-off-by: Yu Luming <luming.yu@intel.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-08-23ACPI video hotkey: remove invalid events handler for video output devicesZhang Rui
Both ACPI_VIDEO_NOTIFY_SWITCH and ACPI_VIDEO_NOTIFY_PROBE are valid for video bus devices only. Actually ACPI video output device should never be notified for a output device switch/probe. ACPI bus devices notify handler already has the code to handle these kinds of events. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-08-23ACPI: Schedule /proc/acpi/event for removalLen Brown
Schedule /proc/acpi/event for removal in 6 months. Re-name acpi_bus_generate_event() to acpi_bus_generate_proc_event() to make sure there is no confusion that it is for /proc/acpi/event only. Add CONFIG_ACPI_PROC_EVENT to allow removal of /proc/acpi/event. There is no functional change if CONFIG_ACPI_PROC_EVENT=y Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-23ACPI: autoload modules - Create __mod_acpi_device_table symbol for all ACPI ↵Thomas Renninger
drivers modpost is going to use these to create e.g. acpi:ACPI0001 in modules.alias. Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-07-22Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlightLinus Torvalds
* 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight: leds: cr_bllcd.c: build fix backlight: Convert from struct class_device to struct device backlight: Fix order of Kconfig entries
2007-07-16backlight: Convert from struct class_device to struct deviceRichard Purdie
Convert the backlight and LCD classes from struct class_device to struct device since class_device is scheduled for removal. One nasty API break is the backlight power attribute has had to be renamed to bl_power and the LCD power attribute has had to be renamed to lcd_power since the original names clash with the core. I can't see a way around this. Signed-off-by: Richard Purdie <rpurdie@rpsys.net> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
2007-07-03ACPI video: Don't export sysfs backlight interface if query _BCL failDanny Kukawka
Currently the acpi video module export the backlight interface to sysfs also if acpi_video_device_lcd_query_levels() fails to read _BLC method (e.g. because the method is not available). In this case the userspace don't know which brightness level are supported and can't set a brightness level (echo return with: "write error: Invalid Argument"). This happend e.g. on a ASUS RF1 (correct supported by the asus-laptop module). The video module should not export the backlight interface if query _BLC fail, because you can't set anything from userspace and this make it useless. http://bugzilla.kernel.org/show_bug.cgi?id=8375 Signed-off-by: Danny Kukawka <dkukawka@suse.de> Acked-by: Luming Yu <luming.yu@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-05-09ACPI: video: output switch sysfs supportLuming Yu
Requires CONFIG_VIDEO_OUTPUT_CONTROL and CONFIG_ACPI_VIDEO. After loading output.ko and video.ko, you would have /sys/class/video_output and several device acpi_videoNum there. For example, I got acpi_video0, acpi_video1,acpi_video2,and acpi_video3 under /sys/class/video_output on my T40. I can query the status of output device0 by running " cat /sys/class/video_output/acpi_video0 " The return value is defined in ACPI SPEC B.5.5 _DCS(Return the Status of Output Device). Also you can turn off video1 and turn on video0 by " echo 0 > acpi_video1; echo 0x80000000 > acpi_video0". Please reference ACPI SPEC B.5.7 _DSS for the parameter definition. Please note that it may or may NOT works purely depending on if your vendor providing correct ACPI video extension support in bios. the driver output.ko and video.ko just works like a interface to invoke BIOS. Signed-off-by: Luming Yu <Luming.yu@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-09ACPI: video: Fix spelling and grammar mistakesJulius Volz
Correct some of the most obvious spelling and grammar mistakes in drivers/acpi/video.c (comments and printk output). Signed-off-by: Julius Volz <juliusrv@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-20backlight: Separate backlight properties from backlight ops pointersRichard Purdie
Per device data such as brightness belongs to the indivdual device and should therefore be separate from the the backlight operation function pointers. This patch splits the two types of data and allows simplifcation of some code. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-20backlight: Remove unneeded owner fieldRichard Purdie
Remove uneeded owner field from backlight_properties structure. Nothing uses it and it is unlikely that it will ever be used. The backlight class uses other means to ensure that nothing references unloaded code. Based on a patch from Dmitry Torokhov <dtor@insightbb.com> Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-12ACPI: delete extra #defines in /drivers/acpi/ driversLen Brown
Cosmetic only. Except in a single case, #define ACPI_*_DRIVER_NAME were invoked 0 or 1 times. Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-12ACPI: fix acpi_driver.name usageLen Brown
It was erroneously used as a description rather than a name. ie. turn this: lenb@se7525gp2:/sys> ls bus/acpi/drivers ACPI AC Adapter Driver ACPI Embedded Controller Driver ACPI Power Resource Driver ACPI Battery Driver ACPI Fan Driver ACPI Processor Driver ACPI Button Driver ACPI PCI Interrupt Link Driver ACPI Thermal Zone Driver ACPI container driver ACPI PCI Root Bridge Driver hpet into this: lenb@se7525gp2:~> ls /sys/bus/acpi/drivers ac battery button container ec fan hpet pci_link pci_root power processor thermal Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-12ACPI: clean up ACPI_MODULE_NAME() useLen Brown
cosmetic only Make "module name" actually match the file name. Invoke with ';' as leaving it off confuses Lindent and gcc doesn't care. Fix indentation where Lindent did get confused. Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-03Pull sysfs into test branchLen Brown
Conflicts: Documentation/feature-removal-schedule.txt include/acpi/acpi_drivers.h Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-02Pull bugzilla-7349 into test branchLen Brown
2007-02-02Pull video into test branchLen Brown
2007-01-23[PATCH] acpi: remove "video device notify" messageJeff Chua
Seems to be some left-over debug code. Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-01-03ACPI: video: fix LCD monitor seen as CRTRui Zhang
http://bugzilla.kernel.org/show_bug.cgi?id=7349 Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: Adds backlight sysfs support for acpi video driver.Yu Luming
Adds backlight sysfs support for acpi video driver. signed-off-by: Luming Yu <Luming.yu@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20ACPI: replace kmalloc+memset with kzallocBurman Yan
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20Pull platform-drivers into test branchLen Brown
2006-12-20ACPI: Implement acpi_video_get_next_level()Thomas Tuttle
acpi_video_get_next_level was supposed to implement an algorithm to select a new brightness level based on the old brightness level of an ACPI video device, but it simply says "/* Fix me */" and returns the current brightness. This patch implements acpi_video_get_next_level properly. It had to change a few constants at the top of the file because they were (apparently) wrong, but it appears to work on my Dell Inspiron e1405 (with BIOS A05 only--BIOS A04 doesn't seem to send ACPI video hotkey events). [akpm@osdl.org: cleanups] Signed-off-by: Thomas Tuttle <linux-kernel@ttuttle.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-15ACPI: Set fake hid for non-PNPID ACPI devicesZhang Rui
We do this mainly because: 1. hid is used to match ACPI devices and drivers. .match method which is incompatible to driver model can be deleted from acpi_driver.ops then. 2. As the .uevent method mark ACPI drivers by PNPID, fake hid is set to non-PNPID devices so that udev script can load the right ACPI driver by looking for "HWID = " or "COMPTID = ". Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpiJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Len Brown <len.brown@intel.com>
2006-07-01Pull acpi_device_handle_cleanup into release branchLen Brown
2006-06-30ACPI: delete acpi_os_free(), use kfree() directlyLen Brown
Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-30ACPI: video: Remove unneeded acpi_handle from driver.Patrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-30ACPI: video: Use acpi_device's handle instead of driver'sPatrick Mochel
Signed-off-by: Patrick Mochel <mochel@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-30ACPI: video: add struct acpi_device to struct acpi_video_bus.Patrick Mochel
- Use it instead of acpi_bus_get_device() in acpi_video_bus_notify() and use the one from struct acpi_video_device in acpi_video_device_notify(). Signed-off-by: Patrick Mochel <mochel@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-27ACPI: delete tracing macros from drivers/acpi/*.cPatrick Mochel
Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-27ACPI: un-export ACPI_ERROR() -- use printk(KERN_ERR...)Len Brown
Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-26ACPI: Enable ACPI error messages w/o CONFIG_ACPI_DEBUGThomas Renninger
Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-23[PATCH] fix typo in acpi video brightness changes.Dave Jones
Prevent possible null dereference due to misplaced ; Signed-off-by: Dave Jones <davej@redhat.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-06-15Pull video into release branchLen Brown
2006-05-15ACPI: fix potential memory leaks in driver/acpi/video.cYu, Luming
acpi_video_bus_get_one_device() and other functions in driver/acpi/video.c do not release allocated memory on remove and on the error path. Signed-off-by: "Yu, Luming" <luming.yu@intel.com> Signed-off-by: Vasily Averin <vvs@sw.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-31[ACPI] drivers/acpi/video.c: fix error path NULL pointer dereferenceAdrian Bunk
The Coverity checker spotted this bug in acpi_video_device_lcd_query_levels(). Signed-off-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Len Brown <len.brown@intel.com>
2006-01-07[ACPI] move some run-time structure inits to compile timeArjan van de Ven
acpi_processor_limit_fops.write was written at run time, but can be initiailized at compile-time instead. Similar for acpi_video_bus_POST_fops.write and friends, but keep doing those at runtime to avoid prototype-hell. Signed-off-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Len Brown <len.brown@intel.com>
2005-11-30[ACPI] Fix Null pointer deref in video/lcd/brightnessThomas Renninger
http://bugzilla.kernel.org/show_bug.cgi?id=5571 Signed-off-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Yu Luming <luming.yu@gmail.com> Cc: <stable@kernel.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2005-11-07[PATCH] kfree cleanup: misc remaining driversJesper Juhl
This is the remaining misc drivers/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in misc files in drivers/. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Acked-by: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> Acked-by: Roland Dreier <rolandd@cisco.com> Acked-by: Pierre Ossman <drzeus@drzeus.cx> Acked-by: Jean Delvare <khali@linux-fr.org> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Acked-by: Len Brown <len.brown@intel.com> Acked-by: "Antonino A. Daplas" <adaplas@gmail.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-09-03[ACPI] acpi_video_device_write_state() now worksLuming Yu
http://bugzilla.kernel.org/show_bug.cgi?id=5060 Signed-off-by: Luming Yu <luming.yu@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2005-08-05[ACPI] Lindent all ACPI filesLen Brown
Signed-off-by: Len Brown <len.brown@intel.com>
2005-08-04[ACPI] acpi_remove_notify_handler() on video driver unloadKarol Kozimor
The video driver doesn't properly remove all the notify handlers on module unload. This has a side effect of subdevices failing to register on module reload, but sudden death looms if the handlers trigger after the module is unloaded. Signed-off-by: Karol Kozimor <sziwan@hell.org.pl> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2005-07-11[ACPI] fix kmalloc size bug in acpi/video.cPaulo Marques
acpi_video_device_find_cap() used &p instead of *p when calculating storage size, thus allocating only 4 or 8 bytes instead of 12... Also, kfree(NULL) is legal, so remove some unneeded checks. From: Paulo Marques <pmarques@grupopie.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2005-07-11[ACPI] fix potential NULL dereference in acpi/video.cAdrian Bunk
Found-by: Adrian Bunk <bunk@stusta.de> Signed-off-by: Len Brown <len.brown@intel.com>