Commit Graph

219 Commits (master)

Author SHA1 Message Date
Matthew Garrett 70287db87c ACPI video: Be more liberal in validating _BQC behaviour
Right now, if _BQC returns a value we don't understand we immediately
invalidate it. Change this behaviour so we only invalidate it if it
continues to give an invalid answer after we've already set a brightness.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-03-14 16:06:37 -04:00
Lin Ming 439913fffd ACPI: replace acpi_integer by u64
acpi_integer is now obsolete and removed from the ACPICA code base,
replaced by u64.

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2010-01-28 01:47:33 -05:00
Len Brown 093e2961fe Merge branch 'bugzilla-13577-video' into release 2010-01-20 01:14:41 -05:00
Zhang Rui c504f8cb68 ACPI video: Prune dupe video devices, unless "video.allow_duplicates"
Some buggy BIOS exports multiple ACPI video bus devices for the same
VGA controller, and multiple backlight control methods as well.
This messes up the ACPI video backlight control.

http://bugzilla.kernel.org/show_bug.cgi?id=13577

With this patch applied, only the FIRST ACPI video bus device
under a PCI device node is bind to ACPI video driver by default.

If the first ACPI video bus device doesn't work well, we can use
video.allow_duplicates=1 to go back to the old behavior.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-12-30 20:30:04 -05:00
Len Brown cccc67a4cf Merge branch 'video-error-case' into release 2009-12-30 02:51:38 -05:00
Zhang Rui e01ce79b7f ACPI video: correct error-handling code
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>
2009-12-30 01:51:07 -05:00
Zhang Rui 28c32e99bd ACPI video: no warning message if "acpi_backlight=vendor" is used
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>
2009-12-30 01:46:12 -05:00
Arjan van de Ven 52a2b11caf ACPI: clean up video.c boundary checks and types
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>
2009-10-28 11:49:37 -04:00
Stefan Bader 3a1151e3f1 ACPI: video: Loosen strictness of video bus detection code
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>
2009-10-13 02:50:38 -04:00
Alexey Dobriyan 828c09509b const: constify remaining file_operations
[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>
2009-10-01 16:11:11 -07:00
Linus Torvalds d910fc7860 Merge branch 'for-linus' of git://git.o-hand.com/linux-rpurdie-backlight
* '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
2009-09-26 10:49:42 -07:00
Matthew Garrett 36342742a3 backlight/acpi: Update the backlight state when we change brightness
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>
2009-09-21 21:04:19 +01:00
Len Brown 193a6dec1c Merge branch 'video' into release
Conflicts:
	drivers/acpi/video.c

Signed-off-by: Len Brown <len.brown@intel.com>
2009-09-19 02:31:39 -04:00
Len Brown d26f0528d5 Merge branch 'misc-2.6.32' into release
Conflicts:
	drivers/pci/dmar.c

Signed-off-by: Len Brown <len.brown@intel.com>
2009-09-19 02:14:45 -04:00
Len Brown eb27cae8ad ACPI: linux/acpi.h should not include linux/dmi.h
users of acpi.h that need dmi.h should include it directly.

Signed-off-by: Len Brown <len.brown@intel.com>
2009-09-19 01:33:27 -04:00
Len Brown 003d6a38ce Merge branch 'sfi-base' into release
Conflicts:
	drivers/acpi/power.c

Signed-off-by: Len Brown <len.brown@intel.com>
2009-09-19 00:37:13 -04:00
Zhang Rui 90c53ca426 ACPI video: work-around BIOS AML bug in _BQC
_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>
2009-08-31 12:39:54 -04:00
Dmitry Torokhov 4a703a8fe5 ACPI: video - rename cdev to cooling_dev -- syntax only
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>
2009-08-29 23:03:16 -04:00
Dmitry Torokhov 4b4fe3b62e ACPI: video - fix potential crash when unloading
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>
2009-08-29 22:58:19 -04:00
Vladimir Serbinenko 4e231fa4cb ACPI video: ignore buggy _BQC
_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>
2009-08-29 17:41:31 -04:00
Len Brown a192a9580b ACPI: Move definition of PREFIX from acpi_bus.h to internal..h
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>
2009-08-28 19:57:27 -04:00
Keith Packard e29b3ee3b0 ACPI: don't free non-existent backlight in acpi video module
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>
2009-08-28 15:17:07 -04:00
Zhang Rui 3b5e634103 ACPI: video: remove unneeded memsets
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>
2009-08-27 14:09:30 -04:00
Len Brown fbe8cddd2d Merge branches 'acerhdf', 'acpi-pci-bind', 'bjorn-pci-root', '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 2009-06-24 01:19:50 -04:00
Zhang Rui 152a4e630f ACPI: video: DMI workaround broken Acer 7720 BIOS enabling display brightness
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>
2009-06-23 23:41:31 -04:00
Zhao Yakui 86e437f077 ACPI: Add the reference count to avoid unloading ACPI video bus twice
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>
2009-06-23 23:38:41 -04:00
Zhang Rui 056c308d3e Show the physical device node of backlight class device.
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>
2009-06-23 23:19:13 -04:00
Alexander Chiang 1e4cffe78e ACPI: video: convert to acpi_get_pci_dev
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>
2009-06-17 23:32:23 -04:00
Len Brown 6afec830ac Merge branches 'bugzilla-13121+', 'bugzilla-13233', 'redhat-bugzilla-500311', 'pci-bind-oops', 'misc-2.6.30' and 'i7300_idle' into release 2009-05-29 21:30:01 -04:00
Jaswinder Singh Rajput 1fc8d33aca drm/i915: acpi/video.c fix section mismatch warning
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>
2009-05-29 21:26:25 -04:00
Zhang Rui 93bcece20e ACPI: video: DMI workaround broken Acer 5315 BIOS enabling display brightness
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>
2009-05-29 21:24:06 -04:00
Zhang Rui 34ac272b3a ACPI: video: DMI workaround broken eMachines E510 BIOS enabling display 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>
2009-05-29 21:21:33 -04:00
Len Brown 4e3507f718 Merge branches 'release', 'bugzilla-13032', 'bugzilla-13041+', 'bugzilla-13121', 'bugzilla-13165', 'bugzilla-13243', 'bugzilla-13259', 'resume-sci-en-regression', 'thermal-regression', 'tsc-regression' and 'asus-2.6.30' into release 2009-05-16 01:55:59 -04:00
Len Brown 5afc4abe79 ACPI: video: DMI workaround another broken Acer BIOS enabling display brightness
http://bugzilla.kernel.org/show_bug.cgi?id=13121

Signed-off-by: Len Brown <len.brown@intel.com>
2009-05-07 21:11:56 -04:00
Linus Torvalds 56a50adda4 Merge branch 'drm-intel-next' of 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+
2009-04-28 17:21:20 -07:00
Zhang Rui 45cb50e646 ACPI video: dmi check for broken _BQC on Acer Aspire 5720
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>
2009-04-24 12:13:18 -04:00
Len Brown 2d40570786 Merge branch 'bugzilla-12249' into release 2009-04-24 01:35:46 -04:00
Zhang Rui 90af2cf620 ACPI video: fix an error when the brightness levels on AC and on Battery are 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>
2009-04-20 00:22:44 -04:00
Matthew Garrett 3b1c1c1118 drm/i915: Unregister ACPI video driver when exiting
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>
2009-04-17 13:31:07 -07:00
Zhang Rui e047cca66c ACPI video: handle indexed _BQC correctly
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>
2009-04-11 01:05:58 -04:00
Bjorn Helgaas 7015558fca ACPI: video: use .notify method instead of installing handler directly
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>
2009-04-07 16:26:57 -04:00
Len Brown 478c6a43fc Merge branch 'linus' into release
Conflicts:
	arch/x86/kernel/cpu/cpufreq/longhaul.c

Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-05 02:14:15 -04:00
Len Brown e2fae0abf6 Merge branch 'constify' into release 2009-04-05 01:51:16 -04:00
Len Brown 1264881050 Merge branch 'video' into release
Conflicts:
	drivers/acpi/video.c

Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-05 01:40:06 -04:00
Len Brown c07c9a78a9 video: build fix
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>
2009-04-04 03:33:45 -04:00
Jan Engelhardt b7171ae74b ACPI: constify VFTs (2/2)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 23:15:07 -04:00
Jan Engelhardt 070d8eb1f6 ACPI: constify VFTs (1/2)
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 23:14:40 -04:00
Alexey Dobriyan 99b7623380 proc 2/2: remove struct proc_dir_entry::owner
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>
2009-03-31 01:14:44 +04:00
Matthew Garrett 74a365b3f3 ACPI: Populate DIDL before registering ACPI video device on Intel
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>
2009-03-27 22:11:03 -04:00
Zhang Rui c60d638e29 ACPI video: support buggy BIOSes with _BCQ implemented
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>
2009-03-27 21:57:30 -04:00
Zhang Rui 1a7c618a3f ACPI video: support _BQC/_BCL/_BCM methods that use index values
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>
2009-03-27 21:56:45 -04:00
Zhang Rui d80fb99fdc ACPI video: support reversed _BCL method in ACPI video driver
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>
2009-03-27 21:56:24 -04:00
Zhang Rui d32f69470c ACPI video: support _BCL packages that don't export brightness levels when 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>
2009-03-27 21:55:58 -04:00
Zhang Rui 24450c7add ACPI video: check the return value of acpi_video_device_lcd_set_level
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>
2009-03-27 21:55:23 -04:00
Zhang Rui c8890f903a ACPI video: check the return value of acpi_video_device_lcd_get_level_current
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>
2009-03-27 21:48:29 -04:00
Matthew Garrett 6503e5df08 thermal: use integers rather than strings for thermal values
The thermal API currently uses strings to pass values to userspace. This
makes it difficult to use from within the kernel. Change the interface
to use integers and fix up the consumers.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Thomas Renninger <trenn@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-02-20 10:52:37 -05:00
Len Brown 2d29c6a075 Merge branches 'release', 'asus', 'bugzilla-12450', 'cpuidle', 'debug', 'ec', 'misc', 'printk' and 'processor' into release 2009-02-07 01:34:56 -05:00
Frank Seidel 4d9391557b ACPI: add missing KERN_* constants to printks
According to kerneljanitors todo list all printk calls (beginning
a new line) should have an according KERN_* constant.
Those are the missing peaces here for the acpi subsystem.

Signed-off-by: Frank Seidel <frank@f-seidel.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-02-07 00:29:32 -05:00
Zhao Yakui f3b39f1393 ACPI: proc_dir_entry 'video/VGA' already registered
eliminate the duplicate the name of "VGA"

http://bugzilla.kernel.org/show_bug.cgi?id=12514

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-02-02 22:55:01 -05:00
Zhao Yakui 0a3db1cec5 ACPI: Skip the first two elements in the _BCL package
According to the Spec the first two elements in the _BCL package won't be

regarded as the available brightness level. The first is the brightness when
full power is connected to the box(It means that the AC adapter is plugged).
The second is the brightness level when the box is on battery.
    If the first two elements are still used while finding the next brightness
level, it will fall back to the lowest level when keeping on pressing
hotkey. (On some boxes the brightness will be changed twice when hotkey is
pressed once. One is in the ACPI video driver. The other is changed by sys I/F.
In the ACPI video driver the first two elements will be used while changing
the brightness. But the first two elements is skipped while using sys I/F.
In such case there exists the inconsistency).
    So he first two elements had better be skipped while showing the available
brightness or finding the next brightness level.

http://bugzilla.kernel.org/show_bug.cgi?id=12450

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-02-02 22:34:23 -05:00
Len Brown d0302bc62a Merge branch 'misc' into release
Conflicts:
	include/acpi/acpixf.h

Signed-off-by: Len Brown <len.brown@intel.com>
2009-01-09 03:37:48 -05:00
Zhang Rui 9e6dada9d2 video: always update the brightness when poking "brightness"
always update props.brightness no matter the backlight is changed
via procfs, hotkeys or sysfs.

Sighed-off-by: Zhang Rui <rui.zhang@intel.com>
Acked-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30 23:39:43 -05:00
Zhang Rui 935e5f290e ACPI: video: Fix reversed brightness behavior on ThinkPad SL series
Section B.6.2 of ACPI 3.0b specification that defines _BCL method
doesn't require the brightness levels returned to be sorted.
At least ThinkPad SL300 (and probably all IdeaPads) returns the
array reversed (i.e. bightest levels have lowest indexes), which
causes the brightness management behave in completely reversed
manner on these machines (brightness increases when the laptop is
idle, while the display dims when used).

Sorting the array by brightness level values after reading the list
fixes the issue.

http://bugzilla.kernel.org/show_bug.cgi?id=12037

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Tested-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-11 16:24:52 -05:00
Len Brown f398778aa3 Merge branch 'video' into release
Conflicts:
	Documentation/kernel-parameters.txt

Signed-off-by: Len Brown <len.brown@intel.com>
2008-11-11 21:15:50 -05:00
Thomas Renninger c3d6de698c ACPI video: if no ACPI backlight support, use vendor drivers
If an ACPI graphics device supports backlight brightness functions (cmp. with
latest ACPI spec Appendix B), let the ACPI video driver control backlight and
switch backlight control off in vendor specific ACPI drivers (asus_acpi,
thinkpad_acpi, eeepc, fujitsu_laptop, msi_laptop, sony_laptop, acer-wmi).

Currently it is possible to load above drivers and let both poke on the
brightness HW registers, the video and vendor specific ACPI drivers -> bad.

This patch provides the basic support to check for BIOS capabilities before
driver loading time. Driver specific modifications are in separate follow up
patches.

"acpi_backlight=vendor"
	Prever vendor driver over ACPI driver for backlight.
"acpi_backlight=video" (default)
	Prever ACPI driver over vendor driver for backlight.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-11-07 23:57:55 -05:00
Thomas Renninger 22c13f9d81 ACPI: video: Ignore devices that aren't present in hardware
This is a reimplemention of commit
0119509c4f
from Matthew Garrett <mjg59@srcf.ucam.org>

This patch got removed because of a regression: ThinkPads with a
Intel graphics card and an Integrated Graphics Device BIOS implementation
stopped working.
In fact, they only worked because the ACPI device of the discrete, the
wrong one, got used (via int10). So ACPI functions were poking on the wrong
hardware used which is a sever bug.
The next patch provides support for above ThinkPads to be able to
switch brightness via the legacy thinkpad_acpi driver and automatically
detect when to use it.

Original commit message from Matthew Garrett:
    Vendors often ship machines with a choice of integrated or discrete
    graphics, and use the same DSDT for both. As a result, the ACPI video
    module will locate devices that may not exist on this specific platform.
    Attempt to determine whether the device exists or not, and abort the
    device creation if it doesn't.

http://bugzilla.kernel.org/show_bug.cgi?id=9614

Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-11-07 23:49:23 -05:00
Bjorn Helgaas 89595b8f28 ACPI: consolidate ACPI_*_COMPONENT definitions in acpi_drivers.h
Move all the component definitions for drivers to a single shared place,
include/acpi/acpi_drivers.h.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-11-07 21:44:37 -05:00
Bjorn Helgaas 5704d626e7 ACPI: remove comments about debug layer/level to use
I don't think there's any point in cluttering the code with these.
Better to improve the documentation so *anybody* can figure out
what layer & level to use.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-11-06 15:30:19 -05:00
Len Brown 7674416db4 Merge branch 'ull' into test
Conflicts:
	drivers/acpi/bay.c
	drivers/acpi/dock.c
	drivers/ata/libata-acpi.c

Signed-off-by: Len Brown <len.brown@intel.com>
2008-10-22 23:33:29 -04:00
Len Brown 5f50ef453d Merge branch 'misc' into test 2008-10-22 23:28:38 -04:00
Lin Ming 55ac9a018f ACPI: replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk
ACPI_DB_ERROR and ACPI_DB_WARN were removed from ACPICA core.
So replace ACPI_DEBUG_PRINT((ACPI_DB_ERROR, ...) with printk(KERN_ERR PREFIX ...)
and ACPI_DEBUG_PRINT((ACPI_DB_WARN, ...) with printk(KERN_WARNING PREFIX ...)

We do not use ACPI_ERROR/ACPI_WARNING since they're not exported, see
-------------------------------------------------------------
commit 6468463abd
Author: Len Brown <len.brown@intel.com>
Date:   Mon Jun 26 23:41:38 2006 -0400

    ACPI: un-export ACPI_ERROR() -- use printk(KERN_ERR...)

    Signed-off-by: Len Brown <len.brown@intel.com>
-------------------------------------------------------------

Signed-off-by: Lin Ming <ming.m.lin@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-10-22 23:14:41 -04:00
Matthew Wilcox 27663c5855 ACPI: Change acpi_evaluate_integer to support 64-bit on 32-bit kernels
As of version 2.0, ACPI can return 64-bit integers.  The current
acpi_evaluate_integer only supports 64-bit integers on 64-bit platforms.
Change the argument to take a pointer to an acpi_integer so we support
64-bit integers on all platforms.

lenb: replaced use of "acpi_integer" with "unsigned long long"
lenb: fixed bug in acpi_thermal_trips_update()

Signed-off-by: Matthew Wilcox <willy@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-10-11 02:47:33 -04:00
Pavel Machek db89b4f0db ACPI: catch calls of acpi_driver_data on pointer of wrong type
Catch attempts to use of acpi_driver_data on pointers of wrong type.

akpm: rewritten to use proper C typechecking and remove the
"function"-used-as-lvalue thing.

Signed-off-by: Pavel Machek <pavel@suse.cz>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-10-10 18:05:53 -04:00
Linus Torvalds 1481b9109f Merge branch 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6
* 'release-2.6.27' of git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-acpi-2.6:
  acpi: fix crash in core ACPI code, triggered by CONFIG_ACPI_PCI_SLOT=y
  ACPI: thinkpad-acpi: don't misdetect in get_thinkpad_model_data() on -ENOMEM
  ACPI: thinkpad-acpi: bump up version to 0.21
  ACPI: thinkpad-acpi: add bluetooth and WWAN rfkill support
  ACPI: thinkpad-acpi: WLSW overrides other rfkill switches
  ACPI: thinkpad-acpi: prepare for bluetooth and wwan rfkill support
  ACPI: thinkpad-acpi: consolidate wlsw notification function
  ACPI: thinkpad-acpi: minor refactor on radio switch init
  Revert "ACPI: don't walk tables if ACPI was disabled"
  Revert "dock: bay: Don't call acpi_walk_namespace() when ACPI is disabled."
  Revert "Fix FADT parsing"
  ACPI : Set FAN device to correct state in boot phase
  ACPI: Ignore _BQC object when registering backlight device
  ACPI: stop complaints about interrupt link End Tags and blank IRQ descriptors
2008-07-24 13:57:37 -07:00
Greg Kroah-Hartman fc3a8828b1 driver core: fix a lot of printk usages of bus_id
We have the dev_printk() variants for this kind of thing, use them
instead of directly trying to access the bus_id field of struct device.

This is done in order to remove bus_id entirely.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2008-07-21 21:54:53 -07:00
Zhao Yakui c2c789057f ACPI: Ignore _BQC object when registering backlight device
According to acpi spec , the objectes of  _BCL and _BCM are required if
integrated LCD is present and supports brightness level and the _BQC is
the optional object. So the _BQC object will be ignored when the backlight
device is registered.
At the same time when there is no _BQC object, the current brightness will be
set to the maximum.

http://bugzilla.kernel.org/show_bug.cgi?id=10206

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui  <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
2008-07-18 01:41:49 +02:00
Julia Jomantaite 469778c174 ACPI: video: fix brightness allocation
Fix use of uninitialized device->brightness.

Signed-off-by: Julia Jomantaite <julia.jomantaite@gmail.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-07-16 23:27:05 +02:00
Zhang Rui d385c2a858 ACPI Exception (video-1721): UNKNOWN_STATUS_CODE, Cant attach device
The child of a video bus device is not alway a video device.
It should be a warn message rather than an exception here.
http://bugzilla.kernel.org/show_bug.cgi?id=9761

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-06-14 01:01:18 -04:00
Alexey Dobriyan e0066c4ea9 Fix ACPI vs proc_create_data() mismerge
acpi_device_dir() is NULL until all files are createst, so everyting is
created in straight in /proc/ and creation code warns.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-30 16:26:27 -07:00
Linus Torvalds 08acd4f8af Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6
* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (179 commits)
  ACPI: Fix acpi_processor_idle and idle= boot parameters interaction
  acpi: fix section mismatch warning in pnpacpi
  intel_menlo: fix build warning
  ACPI: Cleanup: Remove unneeded, multiple local dummy variables
  ACPI: video - fix permissions on some proc entries
  ACPI: video - properly handle errors when registering proc elements
  ACPI: video - do not store invalid entries in attached_array list
  ACPI: re-name acpi_pm_ops to acpi_suspend_ops
  ACER_WMI/ASUS_LAPTOP: fix build bug
  thinkpad_acpi: fix possible NULL pointer dereference if kstrdup failed
  ACPI: check a return value correctly in acpi_power_get_context()
  #if 0 acpi/bay.c:eject_removable_drive()
  eeepc-laptop: add hwmon fan control
  eeepc-laptop: add backlight
  eeepc-laptop: add base driver
  ACPI: thinkpad-acpi: bump up version to 0.20
  ACPI: thinkpad-acpi: fix selects in Kconfig
  ACPI: thinkpad-acpi: use a private workqueue
  ACPI: thinkpad-acpi: fluff really minor fix
  ACPI: thinkpad-acpi: use uppercase for "LED" on user documentation
  ...

Fixed conflicts in drivers/acpi/video.c and drivers/misc/intel_menlow.c
manually.
2008-04-30 11:52:52 -07:00
Len Brown 96916090f4 Merge branches 'release', 'acpica', 'bugzilla-10224', 'bugzilla-9772', 'bugzilla-9916', 'ec', 'eeepc', 'idle', 'misc', 'pm-legacy', 'sysfs-links-2.6.26', 'thermal', 'thinkpad' and 'video' into release 2008-04-30 13:58:00 -04:00
Denis V. Lunev cf7acfab03 acpi: use non-racy method for proc entries creation
Use proc_create()/proc_create_data() to make sure that ->proc_fops and ->data
be setup before gluing PDE to main tree.

Add correct ->owner to proc_fops to fix reading/module unloading race.

Signed-off-by: Denis V. Lunev <den@openvz.org>
Cc: Len Brown <lenb@kernel.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-29 08:06:22 -07:00
Dmitry Torokhov c46e5658a0 ACPI: video - fix permissions on some proc entries
POST and DOS are supposed to be writable but permissions
did not allow it.

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>
2008-04-29 10:50:55 -04:00
Dmitry Torokhov 251cb0bc79 ACPI: video - properly handle errors when registering proc elements
Have acpi_video_device_add_fs() and acpi_video_bus_add_fs()
properly unwind proc creation after error.

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>
2008-04-29 10:50:41 -04:00
Dmitry Torokhov 78eed028f1 ACPI: video - do not store invalid entries in attached_array list
this is a cleanup, not a change to function.

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>
2008-04-29 10:50:31 -04:00
Julia Lawall 9030062f3d ACPI: elide a non-zero test on a result that is never 0
thermal_cooling_device_register used to return NULL if THERMAL is "n".
As the ACPI fan, processor and video drivers SELECT the generic
thermal in PATCH 01, this is not a problem any more.

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-04-29 02:52:45 -04:00
Linus Torvalds 797de7bdb2 Revert "ACPI: Ignore _BQC object when registering backlight device"
This reverts commit 7c0ea45be4 which
caused a regression with the backlight being set to off when a laptop
doesn't have a _BQC entry to query the actual backlight value.  The code
blindly then falls back on a value of 0.

See
	http://bugzilla.kernel.org/show_bug.cgi?id=10387
	http://lkml.org/lkml/2008/4/2/366

for details.

Bisected-and-reported-by: Andrey Borzenkov <arvidjaar@mail.ru>
Cc: Zhao Yakui <yakui.zhao@intel.com>
Cc: Zhang Rui <rui.zhang@intel.com>
Cc: Len Brown <len.brown@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-04-05 12:14:13 -07:00
Ingo Molnar 48d3d8263c revert "ACPI: drivers/acpi: elide a non-zero test on a result that is never 0"
Revert commit 1192aeb957 ("ACPI:
drivers/acpi: elide a non-zero test on a result that is never 0")
because it turns out that thermal_cooling_device_register() does
actually return NULL if CONFIG_THERMAL is turned off (then the routine
turns into a dummy inline routine in the header files that returns NULL
unconditionally).

This was found with randconfig testing, causing a crash during bootup:

  initcall 0x78878534 ran for 13 msecs: acpi_button_init+0x0/0x51()
  Calling initcall 0x78878585: acpi_fan_init+0x0/0x2c()
  BUG: unable to handle kernel NULL pointer dereference at 00000000
  IP: [<782b8ad0>] acpi_fan_add+0x7d/0xfd
  *pde = 00000000
  Oops: 0000 [#1]
  Modules linked in:

  Pid: 1, comm: swapper Not tainted (2.6.25-rc7-sched-devel.git-x86-latest.git #14)
  EIP: 0060:[<782b8ad0>] EFLAGS: 00010246 CPU: 0
  EIP is at acpi_fan_add+0x7d/0xfd
  EAX: b787c718 EBX: b787c400 ECX: b782ceb4 EDX: 00000007
  ESI: 00000000 EDI: b787c6f4 EBP: b782cee0 ESP: b782cecc
   DS: 007b ES: 007b FS: 0000 GS: 0000 SS: 0068
  Process swapper (pid: 1, ti=b782c000 task=b7846000 task.ti=b782c000)
  Stack: b787c459 00000000 b787c400 78790888 b787c60c b782cef8 782b6fb8 ffffffda
         b787c60c 00000000 78790958 b782cf0c 783005d7 b787c60c 78790958 78790584
         b782cf1c 783007f6 b782cf28 00000000 b782cf40 782ffc4a 78790958 b794d558
  Call Trace:
   [<782b6fb8>] ? acpi_device_probe+0x3e/0xdb
   [<783005d7>] ? driver_probe_device+0x82/0xfc
   [<783007f6>] ? __driver_attach+0x3a/0x70
   [<782ffc4a>] ? bus_for_each_dev+0x3e/0x60
   [<7830048c>] ? driver_attach+0x14/0x16
   [<783007bc>] ? __driver_attach+0x0/0x70
   [<7830006a>] ? bus_add_driver+0x9d/0x1b0
   [<783008c3>] ? driver_register+0x47/0xa3
   [<7813db00>] ? timespec_to_ktime+0x9/0xc
   [<782b7331>] ? acpi_bus_register_driver+0x3a/0x3c
   [<78878592>] ? acpi_fan_init+0xd/0x2c
   [<78863656>] ? kernel_init+0xac/0x1f9
   [<788635aa>] ? kernel_init+0x0/0x1f9
   [<78114563>] ? kernel_thread_helper+0x7/0x10
   =======================
  Code: 6e 78 e8 57 44 e7 ff 58 e9 93 00 00 00 8b 55 f0 8d bb f4 02 00 00 80 4b 2d 10 8b 03 e8 87 cb ff ff 8d 83 18 03 00 00 80 63 2d ef <ff> 35 00 00 00 00 50 68 e8 9c 6e 78 e8 22 44 e7 ff b9 b6 9c 6e
  EIP: [<782b8ad0>] acpi_fan_add+0x7d/0xfd SS:ESP 0068:b782cecc
  ---[ end trace 778e504de7e3b1e3 ]---
  Kernel panic - not syncing: Attempted to kill init!

Signed-off-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-03-28 10:16:53 -07:00
Julia Lawall 1192aeb957 ACPI: drivers/acpi: elide a non-zero test on a result that is never 0
The function thermal_cooling_device_register always returns either a valid
pointer or a value made with ERR_PTR, so a test for non-zero on the result
will always succeed.

The problem was found using the following semantic match.
(http://www.emn.fr/x-info/coccinelle/)

//<smpl>
@a@
expression E, E1;
statement S,S1;
position p;
@@

E = thermal_cooling_device_register(...)
... when != E = E1
if@p (E) S else S1

@n@
position a.p;
expression E,E1;
statement S,S1;
@@

E = NULL
... when != E = E1
if@p (E) S else S1

@depends on !n@
expression E;
statement S,S1;
position a.p;
@@

* if@p (E)
  S else S1
//</smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-27 01:48:22 -04:00
Len Brown 77321e624b Revert "ACPI: video: Ignore devices that aren't present in hardware"
This reverts commit 0119509c4f.

http://bugzilla.kernel.org/show_bug.cgi?id=9995

Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-18 04:04:35 -04:00
Len Brown f0d6752c9f Revert "ACPI: video: Ignore ACPI video devices that aren't present in hardware"
This reverts commit 3fa2cdcc45.

http://bugzilla.kernel.org/show_bug.cgi?id=9995

Signed-off-by: Len Brown <len.brown>
2008-03-18 01:43:53 -04:00
Len Brown c523aef0f7 Merge branches 'release', 'button-sysfs', 'misc', 'mismatch', 'randconfig' and 'toshiba' into release 2008-03-13 01:59:49 -04:00
Zhao Yakui 7c0ea45be4 ACPI: Ignore _BQC object when registering backlight device
According to acpi spec , the objects of  _BCL and _BCM are required if
integrated LCD is present and supports brightness level .The _BQC is
the optional object. So the _BQC object is ignored when the backlight device
is registered in ACPI video driver.

http://bugzilla.kernel.org/show_bug.cgi?id=10206

Signed-off-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Zhang Rui  <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 22:20:19 -04:00
Harvey Harrison 96b2dd1f1f ACPI: replace remaining __FUNCTION__ occurrences
__FUNCTION__ is gcc-specific, use __func__

Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-03-11 01:58:41 -04:00
Thomas Sujith 43ff39f2f6 ACPI video: check for error from thermal_cooling_device_register
Need to check whether thermal_cooling_device_register
returned ERROR or not.

Signed-off-by: Thomas Sujith <sujith.thomas@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-15 18:29:18 -05:00
Len Brown 52b097fff8 Merge branches 'release' and 'video' into release
Conflicts:

	include/acpi/acpi_bus.h

Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 03:25:48 -05:00
Matthew Garrett 3fa2cdcc45 ACPI: video: Ignore ACPI video devices that aren't present in hardware
Vendors often ship machines with a choice of integrated or discrete
graphics, and use the same DSDT for both. As a result, the ACPI video
module will locate devices that may not exist on this specific platform.

Attempt to determine whether the device exists or not, and abort the
device creation if it do not exist.

Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 03:22:57 -05:00
Matthew Garrett 863c1490e5 ACPI: video: reset brightness on resume
Some machines seem to need the backlight brightness to be reset on resume.
Add support for doing so to the video module.

[akpm@linux-foundation.org: coding-style fixes]
Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
Cc: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 03:22:57 -05:00
Zhang Rui 7761f638f6 ACPI: video: call ACPI notifier chain for ACPI video notifications
Call notifier chain for display/brightness switch events.
The kernel mode graphics driver is interested in this.

Sign-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 03:22:57 -05:00
Zhang Rui ba5e122342 ACPI: video: delete unused display switch on hotkey event code
Display switching via ACPI control methods are
not known to work on any platforms.

Further, the X community wants to control the display
switching all by themselves without BIOS/AML involvement.

Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-07 03:22:57 -05:00