aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/video.c
Commit message (Collapse)AuthorAge
* Merge branch 'video-error-case' into releaseLen Brown2009-12-30
|\
| * ACPI video: correct error-handling codeZhang Rui2009-12-30
| | | | | | | | | | | | | | | | | | | | | | backlight_device_register may return an ERR_PTR value rather than a valid pointer. Problem found by Julia Lawall, properly fixed by Zhang Rui. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Julia Lawall <julia@diku.dk> Signed-off-by: Len Brown <len.brown@intel.com>
* | ACPI video: no warning message if "acpi_backlight=vendor" is usedZhang Rui2009-12-30
|/ | | | | | | | | | | | AML code always sends notifications to ACPI video device, even if we disable the ACPI backlight control by using boot option "acpi_backlight=vendor". In this case we should not print any warning message. http://bugzilla.kernel.org/show_bug.cgi?id=13671#c14 Sigend-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: clean up video.c boundary checks and typesArjan van de Ven2009-10-28
| | | | | | | | | | | | | | | | | | | | | | | proc.c and video.c are a bit sloppy around types and style, confusing gcc for a new feature that'll be in 2.6.33 and will cause a warning on the current code. This patch changes if (foo + 1 > sizeof bar) into if (foo >= sizeof(bar)) which is more kernel-style. it also changes a variable in proc.c to unsigned; it gets assigned a value from an unsigned type, and is then only compared for > not for negative, so using unsigned is just outright the right type Signed-off-by: Arjan van de Ven <arjan@linux.intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: video: Loosen strictness of video bus detection codeStefan Bader2009-10-13
| | | | | | | | | | | | | | | BugLink: http://bugs.launchpad.net/bugs/333386 Currently a video bus device must (beside other criteria) define _DOD and _DOS methods to be considered a video device. Some broken BIOSes prevented working backlight control by only defining both for one (non-existing bus) and only _DOD for the rest. With this patch in place the other bus definitions were considered too and backlight control started to work again. Signed-off-by: Stefan Bader <stefan.bader@canonical.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* const: constify remaining file_operationsAlexey Dobriyan2009-10-01
| | | | | | | | [akpm@linux-foundation.org: fix KVM] Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com> Acked-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlightLinus Torvalds2009-09-26
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight: backlight: new driver for ADP5520/ADP5501 MFD PMICs backlight: extend event support to also support poll() backlight/eeepc-laptop: Update the backlight state when we change brightness backlight/acpi: Update the backlight state when we change brightness backlight: Allow drivers to update the core, and generate events on changes backlight: switch to da903x driver to dev_pm_ops backlight: Add support for the Avionic Design Xanthos backlight device. backlight: spi driver for LMS283GF05 LCD backlight: move hp680-bl's probe function to .devinit.text backlight: Add support for new Apple machines. backlight: mbp_nvidia_bl: add support for MacBookAir 1,1 backlight: Add WM831x backlight driver Trivial conflicts due to '#ifdef CONFIG_PM' differences in drivers/video/backlight/da903x_bl.c
| * backlight/acpi: Update the backlight state when we change brightnessMatthew Garrett2009-09-21
| | | | | | | | | | | | | | | | Trigger a status update when we change the brightness in the driver, thus allowing userspace to present appropriate UI. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
* | Merge branch 'video' into releaseLen Brown2009-09-19
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: drivers/acpi/video.c Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI video: work-around BIOS AML bug in _BQCZhang Rui2009-08-31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _BQC on some laptops returns an uninitialized value when it's invoked for the first time. Set the laptop to the maximum backlight level in this case. http://bugzilla.kernel.org/attachment.cgi?id=22675 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: video - rename cdev to cooling_dev -- syntax onlyDmitry Torokhov2009-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | Cdev name is normally used for ether class devices or character devices so rename member to avoid confusion for casual reader of the code. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: video - fix potential crash when unloadingDmitry Torokhov2009-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | thermal_cooling_device_register() returns error encoded in a pointer when it fails in which case we need to explictly set device->cdev to NULL so we don't try to unregister it when unloading. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI video: ignore buggy _BQCVladimir Serbinenko2009-08-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | _BQC doesn't return a value listed in _BCL method. http://bugzilla.kernel.org/show_bug.cgi?id=13511 ingore the buggy _BQC method in this case Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com> Signed-off-by: Scott Howard <showard314@gmail.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: video: remove unneeded memsetsZhang Rui2009-08-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | device->cap and video->cap are zeroed initially so we don't need to clear them again. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
* | | Merge branch 'misc-2.6.32' into releaseLen Brown2009-09-19
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: drivers/pci/dmar.c Signed-off-by: Len Brown <len.brown@intel.com>
| * | | ACPI: linux/acpi.h should not include linux/dmi.hLen Brown2009-09-19
| | |/ | |/| | | | | | | | | | | | | users of acpi.h that need dmi.h should include it directly. Signed-off-by: Len Brown <len.brown@intel.com>
* | | Merge branch 'sfi-base' into releaseLen Brown2009-09-19
|\ \ \ | |/ / |/| | | | | | | | | | | | | | Conflicts: drivers/acpi/power.c Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: Move definition of PREFIX from acpi_bus.h to internal..hLen Brown2009-08-28
| |/ | | | | | | | | | | | | | | | | | | | | | | | | Linux/ACPI core files using internal.h all PREFIX "ACPI: ", however, not all ACPI drivers use/want it -- and they should not have to #undef PREFIX to define their own. Add GPL commment to internal.h while we are there. This does not change any actual console output, asside from a whitespace fix. Signed-off-by: Len Brown <len.brown@intel.com>
* / ACPI: don't free non-existent backlight in acpi video moduleKeith Packard2009-08-28
|/ | | | | | | | | | | acpi_video_put_one_device was attempting to remove sysfs entries and unregister a backlight device without first checking that said backlight device structure had been created. Signed-off-by: Keith Packard <keithp@keithp.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
*-------. Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', ↵Len Brown2009-06-24
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 'bugzilla-12904', 'bugzilla-13121', 'bugzilla-13396', 'bugzilla-13533', 'bugzilla-13612', 'c3_lock', 'hid-cleanups', 'misc-2.6.31', 'pdc-leak-fix', 'pnpacpi', 'power_nocheck', 'thinkpad_acpi', 'video' and 'wmi' into release
| | | | | * Show the physical device node of backlight class device.Zhang Rui2009-06-23
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Create symbol link from backlight class device to ACPI video device. More and more laptops are shipped with multiple ACPI video devices, while we export only one of them to userspace. With this patch applied, we can know which ACPI video device is used by "cat /sys/class/backlight/acpi_video0/device/path". Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
| | | * | ACPI: Add the reference count to avoid unloading ACPI video bus twiceZhao Yakui2009-06-23
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sometimes both acpi video and i915 driver are compiled as modules. And there exists the strict dependency between the two drivers. The acpi video bus will be unloaded in course of unloading the i915 driver. If we unload the acpi video driver, then the kernel oops will be triggered. Add the reference count to avoid unloading the ACPI video bus twice. The reference count should be checked before unregistering the acpi video bus. If the reference count is already zero, it won't unregister it again. And after the acpi video bus is already unregistered, the reference count will be set to zero. http://bugzilla.kernel.org/show_bug.cgi?id=13396 Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
| | * | ACPI: video: DMI workaround broken Acer 7720 BIOS enabling display brightnessZhang Rui2009-06-23
| |/ / |/| | | | | | | | | | | | | | | | | http://bugzilla.kernel.org/show_bug.cgi?id=13121 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: video: convert to acpi_get_pci_devAlexander Chiang2009-06-17
|/ / | | | | | | | | | | | | | | | | | | Now that acpi_get_pci_dev is available, let's use it instead of acpi_get_physical_pci_device() Cc: Thomas Renninger <trenn@suse.de> Signed-off-by: Alex Chiang <achiang@hp.com> Acked-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
| |
| \
*-. \ Merge branches 'bugzilla-13121+', 'bugzilla-13233', ↵Len Brown2009-05-29
|\ \ \ | | |/ | |/| | | | 'redhat-bugzilla-500311', 'pci-bind-oops', 'misc-2.6.30' and 'i7300_idle' into release
| | * drm/i915: acpi/video.c fix section mismatch warningJaswinder Singh Rajput2009-05-29
| |/ | | | | | | | | | | | | | | | | | | | | Currently acpi_video_exit() is exported as well as using __exit which causes: WARNING: drivers/acpi/video.o(__ksymtab+0x0): Section mismatch in reference from the variable __ksymtab_acpi_video_exit to the function .exit.text:acpi_video_exit() The symbol acpi_video_exit is exported and annotated __exit Fix this by removing the __exit annotation of acpi_video_exit or drop the export. Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
* | ACPI: video: DMI workaround broken Acer 5315 BIOS enabling display brightnessZhang Rui2009-05-29
| | | | | | | | | | | | | | http://bugzilla.kernel.org/show_bug.cgi?id=13121 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* | ACPI: video: DMI workaround broken eMachines E510 BIOS enabling display ↵Zhang Rui2009-05-29
|/ | | | | | | | | brightness http://bugzilla.kernel.org/show_bug.cgi?id=13376 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
*-. Merge branches 'release', 'bugzilla-13032', 'bugzilla-13041+', ↵Len Brown2009-05-16
|\ \ | | | | | | | | | 'bugzilla-13121', 'bugzilla-13165', 'bugzilla-13243', 'bugzilla-13259', 'resume-sci-en-regression', 'thermal-regression', 'tsc-regression' and 'asus-2.6.30' into release
| * | ACPI: video: DMI workaround another broken Acer BIOS enabling display brightnessLen Brown2009-05-07
| | | | | | | | | | | | | | | | | | http://bugzilla.kernel.org/show_bug.cgi?id=13121 Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI video: dmi check for broken _BQC on Acer Aspire 5720Zhang Rui2009-04-24
| |/ | | | | | | | | | | | | | | | | | | | | On Acer Aspire 5720, _BQC always returns a value 9 smaller than the actual brightness level. Add dmi quirk for this laptop. http://bugzilla.kernel.org/show_bug.cgi?id=13121 Tested-by: Maxim Levitsky <maximlevitsky@gmail.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* | Merge branch 'drm-intel-next' of ↵Linus Torvalds2009-04-28
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel * 'drm-intel-next' of git://git.kernel.org/pub/scm/linux/kernel/git/anholt/drm-intel: drm/i915: fix up error path leak in i915_cmdbuffer drm/i915: fix unpaired i915 device mutex on entervt failure. drm/i915: add support for G41 chipset drm/i915: Enable ASLE if present drm/i915: Unregister ACPI video driver when exiting drm/i915: Register ACPI video even when not modesetting drm/i915: fix transition to I915_TILING_NONE drm/i915: Don't let an oops get triggered from irq_emit without dma init. drm/i915: allow tiled front buffers on 965+
| * | drm/i915: Unregister ACPI video driver when exitingMatthew Garrett2009-04-17
| |/ | | | | | | | | | | | | | | | | The i915 DRM triggers registration of the ACPI video driver on load. It should unregister it at unload in order to avoid generating backtraces on being reloaded. Signed-off-by: Matthew Garrett <mjg@redhat.com> Signed-off-by: Eric Anholt <eric@anholt.net>
* | Merge branch 'bugzilla-12249' into releaseLen Brown2009-04-24
|\ \
| * | ACPI video: handle indexed _BQC correctlyZhang Rui2009-04-11
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current code, for a box with an indexed _BQC method, we 1. get the current brightness level by evaluating _BQC 2. set the value gotten in step 1 to _BCM 3. get the current brightness level again 4. set the _BQC_use_index flag if the results gotten in step 1 and in step 3 don't equal. But this logic doesn't work actually, because the _BQC_use_index is not set when acpi_video_device_lcd_set_level is invoked. This results in a failure in step 2. http://bugzilla.kernel.org/show_bug.cgi?id=12249#c83 Now, we set the _BQC_use_index flag after invoking _BQC for the first time. And reevaluate the _BQC to get the correct brightness level. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* / ACPI video: fix an error when the brightness levels on AC and on Battery are ↵Zhang Rui2009-04-20
|/ | | | | | | | | | | same when the brightness level on AC and brightness level on Battery are same, the level_ac_battery is 1 in the current code, which is wrong. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* ACPI: video: use .notify method instead of installing handler directlyBjorn Helgaas2009-04-07
| | | | | | | | | | This patch adds a .notify() method. The presence of .notify() causes Linux/ACPI to manage event handlers and notify handlers on our behalf, so we don't have to install and remove them ourselves. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> CC: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
* Merge branch 'linus' into releaseLen Brown2009-04-05
|\ | | | | | | | | | | | | Conflicts: arch/x86/kernel/cpu/cpufreq/longhaul.c Signed-off-by: Len Brown <len.brown@intel.com>
| * proc 2/2: remove struct proc_dir_entry::ownerAlexey Dobriyan2009-03-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy as correctly noted at bug #12454. Someone can lookup entry with NULL ->owner, thus not pinning enything, and release it later resulting in module refcount underflow. We can keep ->owner and supply it at registration time like ->proc_fops and ->data. But this leaves ->owner as easy-manipulative field (just one C assignment) and somebody will forget to unpin previous/pin current module when switching ->owner. ->proc_fops is declared as "const" which should give some thoughts. ->read_proc/->write_proc were just fixed to not require ->owner for protection. rmmod'ed directories will be empty and return "." and ".." -- no harm. And directories with tricky enough readdir and lookup shouldn't be modular. We definitely don't want such modular code. Removing ->owner will also make PDE smaller. So, let's nuke it. Kudos to Jeff Layton for reminding about this, let's say, oversight. http://bugzilla.kernel.org/show_bug.cgi?id=12454 Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
* | Merge branch 'constify' into releaseLen Brown2009-04-05
|\ \
| * | video: build fixLen Brown2009-04-04
| | | | | | | | | | | | | | | | | | | | | acpi_video_device_write_state() and friends now return ssize_t, while the constify patch assumed it was still int. Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: constify VFTs (2/2)Jan Engelhardt2009-04-03
| | | | | | | | | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: constify VFTs (1/2)Jan Engelhardt2009-04-03
| |/ | | | | | | | | Signed-off-by: Jan Engelhardt <jengelh@medozas.de> Signed-off-by: Len Brown <len.brown@intel.com>
* | Merge branch 'video' into releaseLen Brown2009-04-05
|\ \ | | | | | | | | | | | | | | | | | | Conflicts: drivers/acpi/video.c Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI: Populate DIDL before registering ACPI video device on IntelMatthew Garrett2009-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Intel graphics hardware that implements the ACPI IGD OpRegion spec requires that the list of display devices be populated before any ACPI video methods are called. Detect when this is the case and defer registration until the opregion code calls it. Fixes crashes on HP laptops. http://bugzilla.kernel.org/show_bug.cgi?id=11259 Signed-off-by: Matthew Garrett <mjg@redhat.com> Acked-by: Eric Anholt <eric@anholt.net> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI video: support buggy BIOSes with _BCQ implementedZhang Rui2009-03-27
| | | | | | | | | | | | | | | | | | | | | | | | Some buggy BIOSes implements _BCQ instead of _BQC. Male ACPI video driver support these buggy BIOS. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI video: support _BQC/_BCL/_BCM methods that use index valuesZhang Rui2009-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The input/output of _BQC/_BCL/_BCM control methods should be represented by a number between 0 and 100, and can be thought of as a percentage. But some buggy _BQC/_BCL/_BCM methods use the index values instead. http://bugzilla.kernel.org/show_bug.cgi?id=12302 http://bugzilla.kernel.org/show_bug.cgi?id=12249 http://bugzilla.kernel.org/show_bug.cgi?id=12037 Add the functionality to support such kind of BIOSes in ACPI video driver. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Matthew Garrett <mjg59@srcf.ucam.org> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI video: support reversed _BCL method in ACPI video driverZhang Rui2009-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The brightness levels returned by _BCL package are in a reversed order on some laptops. http://bugzilla.kernel.org/show_bug.cgi?id=12037 http://bugzilla.kernel.org/show_bug.cgi?id=12302 http://bugzilla.kernel.org/show_bug.cgi?id=12235 sort the _BCL packge in case it's reversed. Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Matthew Garrett <mjg59@srcf.ucam.org> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI video: support _BCL packages that don't export brightness levels when ↵Zhang Rui2009-03-27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | machine is on AC/Battery Many buggy BIOSes don't export the brightness levels when machine is on AC/Battery in the _BCL method. Reformat the _BCL package for these laptops: now the elements in device->brightness->levels[] are like: levels[0]: brightness level when on AC power. levels[1]: brightness level when on Battery power. levels[2]: supported brightness level 1. levels[3]: supported brightness level 2. ... levels[n]: supported brightness level n-1. levels[n + 1]: supported brightness level n. So if there are n supported brightness levels on this laptop, we will have n+2 entries in device->brightnes->levels[]. level[0] and level[1] are invalid on the laptops that don't export the brightness levels on AC/Battery. Fortunately, we never use these two values at all, even for the valid ones. http://bugzilla.kernel.org/show_bug.cgi?id=12249 Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Matthew Garrett <mjg59@srcf.ucam.org> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
| * | ACPI video: check the return value of acpi_video_device_lcd_set_levelZhang Rui2009-03-27
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Zhang Rui <rui.zhang@intel.com> Acked-by: Matthew Garrett <mjg59@srcf.ucam.org> Acked-by: Thomas Renninger <trenn@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>