Commit Graph

61059 Commits (46ec8598fde74ba59703575c22a6fb0b6b151bb6)

Author SHA1 Message Date
Bjorn Helgaas 46ec8598fd ACPI: support acpi_device_ops .notify methods
This patch adds support for ACPI device driver .notify() methods.  If
such a method is present, Linux/ACPI installs a handler for device
notifications (but not for system notifications such as Bus Check,
Device Check, etc).  When a device notification occurs, Linux/ACPI
passes it on to the driver's .notify() method.

In most cases, this removes the need for drivers to install their own
handlers for device-specific notifications.

For fixed hardware devices like some power and sleep buttons, there's
no notification value because there's no control method to execute a
Notify opcode.  When a fixed hardware device generates an event, we
handle it the same as a regular device notification, except we send
a ACPI_FIXED_HARDWARE_EVENT value.  This is outside the normal 0x0-0xff
range used by Notify opcodes.

Several drivers install their own handlers for system Bus Check and
Device Check notifications so they can support hot-plug.  This patch
doesn't affect that usage.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Reviewed-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-05 02:25:07 -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 8a3f257c70 Merge branch 'misc' into release 2009-04-05 01:52:07 -04:00
Len Brown 33526a5360 Merge branch 'x2apic' into release 2009-04-05 01:51:51 -04:00
Len Brown 47ae106d3f Merge branch 'pnpacpi' into release 2009-04-05 01:51:38 -04:00
Len Brown 2e33b234ab Merge branch 'dell-wmi' into release 2009-04-05 01:51:22 -04:00
Len Brown e2fae0abf6 Merge branch 'constify' into release 2009-04-05 01:51:16 -04:00
Len Brown fff251f6b2 Merge branches 'bugzilla-12461' and 'bugzilla-9998' into release 2009-04-05 01:51:10 -04:00
Len Brown 3b4dadf05d Merge branch 'acpi_enforce_resources' into release 2009-04-05 01:50:46 -04:00
Len Brown 59b17bf6ea Merge branch 'async-battery' into release
Conflicts:
	drivers/acpi/Makefile

Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-05 01:48:46 -04:00
Len Brown edd84690d1 Merge branch 'acpi-modparam' into release
Conflicts:
	drivers/acpi/Makefile

Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-05 01:45:50 -04:00
Len Brown 7c27fd19b6 Merge branch 'sony-laptop' into release 2009-04-05 01:42:14 -04:00
Len Brown 336d63b8a3 Merge branch 'thinkpad-acpi' into release 2009-04-05 01:42:09 -04:00
Len Brown 07290bed79 Merge branch 'acer' into release 2009-04-05 01:42:03 -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 7329e9356e Merge branch 'psd' into release 2009-04-05 01:39:33 -04:00
Len Brown 3266d63c06 Merge branch 'battery' into release 2009-04-05 01:39:26 -04:00
Len Brown 4926a23639 Merge branch 'hp-wmi' into release 2009-04-05 01:39:20 -04:00
Len Brown 4f3bff70a6 Merge branch 'thermal' into release 2009-04-05 01:39:12 -04:00
Len Brown 2ddb9f17ba Merge branch 'pmtimer-overflow' into release 2009-04-05 01:39:07 -04:00
Len Brown a3b2c5e413 Merge branch 'dynamic-ssdt' into release 2009-04-05 01:39:00 -04:00
Len Brown 4938370096 Merge branch 'driver-ops-cleanup' into release 2009-04-05 01:38:51 -04:00
Len Brown e857b33d18 Merge branch 'bjorn-cleanups' into release 2009-04-05 01:38:42 -04:00
Len Brown 9a38f4eec5 Merge branch 'bjorn-initcall-cleanup' into release 2009-04-05 01:38:31 -04:00
Arjan van de Ven 0f66af5301 ACPI: battery: asynchronous init
The battery driver tends to take quite some time to initialize
(100ms-300ms is quite typical).
This patch initializes the batter driver asynchronously, so that other
things in the kernel can initialize in parallel to this 300 msec.

As part of this, the battery driver had to move to the back
of the ACPI init order (hence the Makefile change).
Without this move, the next ACPI driver would just block
on the ACPI/devicee layer semaphores until the battery driver was
done anyway, not gaining any boot time.

Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 12:51:17 -04:00
Carlos Corbacho 4f0175dc13 acer-wmi: Update copyright notice & documentation
Explicitly note in the documentation that the Acer Aspire One is not
supported.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 12:36:31 -04:00
Andy Whitcroft 350e32907c acer-wmi: Cleanup the failure cleanup handling
Cleanup the failure cleanup handling for brightness and email led.

[cc: Split out from another patch]

Signed-off-by: Andy Whitcroft <apw@canonical.com>
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 12:36:21 -04:00
Carlos Corbacho a74dd5fdab acer-wmi: Blacklist Acer Aspire One
The Aspire One's ACPI-WMI interface is a placeholder that does nothing,
and the invalid results that we get from it are now causing userspace
problems as acer-wmi always returns that the rfkill is enabled (i.e. the
radio is off, when it isn't). As it's hardware controlled, acer-wmi
isn't needed on the Aspire One either.

Thanks to Andy Whitcroft at Canonical for tracking down Ubuntu's userspace
issues to this.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
Reported-by: Andy Whitcroft <apw@canonical.com>
Cc: stable@kernel.org
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 12:36: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
Henrique de Moraes Holschuh 0e501834f8 thinkpad-acpi: rework brightness support
Refactor and redesign the brightness control backend...

In order to fix bugzilla #11750...

Add a new brightness control mode: support direct NVRAM checkpointing
of the backlight level (i.e. store directly to NVRAM without the need
for UCMS calls), and use that together with the EC-based control.
Disallow UCMS+EC, thus avoiding races with the SMM firmware.

Switch the models that define HBRV (EC Brightness Value) in the DSDT
to the new mode.  These are: T40-T43, R50-R52, R50e, R51e, X31-X41.

Change the default for all other IBM ThinkPads to UCMS-only.  The
Lenovo models already default to UCMS-only.

Reported-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:53 -04:00
Henrique de Moraes Holschuh 74a60c0f82 thinkpad-acpi: enhanced debugging messages for the fan subdriver
Enhance debugging messages for the fan subdriver.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:53 -04:00
Henrique de Moraes Holschuh 56e2c20094 thinkpad-acpi: enhanced debugging messages for the hotkey subdriver
Enhance debugging messages for the hotkey subdriver.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:53 -04:00
Henrique de Moraes Holschuh bee4cd9b9e thinkpad-acpi: enhanced debugging messages for rfkill subdrivers
Enhance debugging messages for all rfkill subdrivers in thinkpad-acpi.

Also, log a warning if the deprecated sysfs attributes are in use.
These attributes are going to be removed sometime in 2010.

There is an user-visible side-effect: we now coalesce attempts to
enable/disable bluetooth or WWAN in the procfs interface, instead of
hammering the firmware with multiple requests.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:53 -04:00
Henrique de Moraes Holschuh a4d5effcc7 thinkpad-acpi: restrict access to some firmware LEDs
Some of the ThinkPad LEDs indicate critical conditions that can cause
data loss or cause hardware damage when ignored (e.g. force-ejecting
a powered up bay; ignoring a failing battery, or empty battery; force-
undocking with the dock buses still active, etc).

On almost all ThinkPads, LED access is write-only, and the firmware
usually does fire-and-forget signaling on them, so you effectively
lose whatever message the firmware was trying to convey to the user
when you override the LED state, without any chance to restore it.

Restrict access to all LEDs that can convey important alarms, or that
could mislead the user into incorrectly operating the hardware.  This
will make the Lenovo engineers less unhappy about the whole issue.

Allow users that really want it to still control all LEDs, it is the
unaware user that we have to worry about.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:52 -04:00
Henrique de Moraes Holschuh 2586d5663d thinkpad-acpi: remove HKEY disable functionality
The HKEY disable functionality basically cripples the entire event
model of the ThinkPad firmware and of the thinkpad-acpi driver.
Remove this functionality from the driver.  HKEY must be enabled at
all times while thinkpad-acpi is loaded, and disabled otherwise.

For sysfs, according to the sysfs ABI and the thinkpad-acpi sysfs
rules of engagement, we will just remove the attributes.  This will be
done in two stages: disable their function now, after two kernel
releases, remove the attributes.

For procfs, we call WARN().  If nothing triggers it, I will simply
remove the enable/disable commands entirely in the future along with
the sysfs attributes.

I don't expect much, if any fallout from this.  There really isn't any
reason to mess with hotkey_enable or with the enable/disable commands
to /proc/acpi/ibm/hotkey, and this has been true for years...

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:52 -04:00
Henrique de Moraes Holschuh 73a94d86a8 thinkpad-acpi: add new debug helpers and warn of deprecated atts
Add a debug helper that discloses the TGID of the userspace task
attempting to access the driver.  This is highly useful when dealing
with bug reports, since often the user has no idea that some userspace
application is accessing thinkpad-acpi...

Also add a helper to log warnings about sysfs attributes that are
deprecated.

Use the new helpers to issue deprecation warnings for bluetooth_enable
and wwan_enabled, that have been deprecated for a while, now.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:52 -04:00
Henrique de Moraes Holschuh 7ff8d62f7f thinkpad-acpi: add missing log levels
Add missing log levels in a standalone commit, to avoid dependencies in
future unrelated changes, just because they wanted to use one of the
missing log levels.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:52 -04:00
Henrique de Moraes Holschuh 3dcc2c3b00 thinkpad-acpi: cleanup debug helpers
Fix the vdbg_printk macro definition to be sane when
CONFIG_THINKPAD_ACPI_DEBUG is undefined, and move the mess into a file
section of its own.

This doesn't change anything in the current code, but future code will
need the proper behaviour.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:52 -04:00
Henrique de Moraes Holschuh 257bc1cb3e thinkpad-acpi: drop ibm-acpi alias
The driver was renamed two years ago, on 2.6.21.  Drop the old
compatibility alias, we have given everybody quite enough time
to update their configs to the new name.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:52 -04:00
Henrique de Moraes Holschuh 1c762ca438 thinkpad-acpi: update copyright notices
It is that time of the year again...

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-04 03:14:51 -04:00
Harald Welte ba256b41bd panasonic-laptop: use snprintf with PAGE_SIZE in sysfs attributes
Instead of just sprintf() into the page-sized buffer provided
by the sysfs/device_attribute API, we use snprintf with PAGE_SIZE
as an additional safeguard.

Signed-off-by: Martin Lucina <mato@kotelna.sk>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 23:43:02 -04:00
Harald Welte c542aadeb4 panasonic-laptop: Fix autoloading
This patch adds MODULE_DEVICE_TABLE() to panasonic-laptop.c in order
to ensure automatic loading of the module on systems with the respective
"MAT*" ACPI devices.

Signed-off-by: Martin Lucina <mato@kotelna.sk>
Signed-off-by: Harald Welte <laforge@gnumonks.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 23:42:33 -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
Matthew Garrett 0b3f6109f0 dell-wmi: new driver for hotkey control
Add a WMI driver for Dell laptops. Currently it does nothing but send a
generic input event when a button with a picture of a battery on it is
pressed, but maybe other uses will appear over time.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 22:54:50 -04:00
Jan Beulich 609d4bc949 ACPI: constify tables in pci_irq.c
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 22:00:40 -04:00
Witold Szczeponik 6328a57401 Enable PNPACPI _PSx Support, v3
(This is an update to the patch presented earlier in
http://lkml.org/lkml/2008/12/8/284, with new error handling.)

This patch sets the power of PnP ACPI devices to D0 when they
are activated and to D3 when they are disabled.  The latter is
in correspondence with the ACPI 3.0 specification, whereas the
former is added in order to be able to power up a device after
it has been previously disabled (or when booting up a system).
(As a consequence, the patch makes the PnP ACPI code more ACPI
compliant.)

Section 6.2.2 of the ACPI Specification (at least versions 1.0b
and 3.0a) states: "Prior to running this control method [_DIS],
the OS[PM] will have already put the device in the D3 state."
Unfortunately, there is no clear statement as to when to put
a device in the D0 state. :-( Therefore, the patch executes the
method calls as _PS3/_DIS and _SRS/_PS0. What is clear: "If the
device is disabled, _SRS enables the device at the specified
resources." (From the ACPI 3.0a Specification.)

The patch fixes a problem with some IBM ThinkPads (at least the
600E and the 600X) where the serial ports have a dedicated
power source that needs to be brought up before the serial port
can be used.  Without this patch, the serial port is enabled
but has no power. (In the past, the tpctl utility had to be
utilized to turn on the power, but support for this feature
stopped with version 5.9 as it did not support the more recent
kernel versions.)

The error handlers that handle any errors that can occur during
the power up/power down phases return the error codes to the
caller directly.  Comments welcome! :-)

No regressions were observed on hardware that does not require
this patch.

The patch is applied against 2.6.27.x.

Signed-off-by: Witold Szczeponik <Witold.Szczeponik@gmx.net>
Acked-by: Zhao Yakui <yakui.zhao@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 21:44:10 -04:00
Suresh Siddha 7237d3de78 x86, ACPI: add support for x2apic ACPI extensions
All logical processors with APIC ID values of 255 and greater will have their
APIC reported through Processor X2APIC structure (type-9 entry type) and all
logical processors with APIC ID less than 255 will have their APIC reported
through legacy Processor Local APIC (type-0 entry type) only. This is the
same case even for NMI structure reporting.
    
The Processor X2APIC Affinity structure provides the association between the
X2APIC ID of a logical processor and the proximity domain to which the logical
processor belongs.
    
For OSPM, Procssor IDs outside the 0-254 range are to be declared as Device()
objects in the ACPI namespace.

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2009-04-03 20:08:12 -04:00
Linus Torvalds 5fba0925fd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
  HID: remove compat stuff
  HID: constify arrays of struct apple_key_translation
  HID: add support for Kye/Genius Ergo 525V
  HID: Support Apple mini aluminum keyboard
  HID: support for Kensington slimblade device
  HID: DragonRise game controller force feedback driver
  HID: add support for another version of 0e8f:0003 device in hid-pl
  HID: fix race between usb_register_dev() and hiddev_open()
  HID: bring back possibility to specify vid/pid ignore on module load
  HID: make HID_DEBUG defaults consistent
  HID: autosuspend -- fix lockup of hid on reset
  HID: hid_reset_resume() needs to be defined only when CONFIG_PM is set
  HID: fix USB HID devices after STD with autosuspend
  HID: do not try to compile PM code with CONFIG_PM unset
  HID: autosuspend support for USB HID
2009-04-03 15:25:44 -07:00
Linus Torvalds 811158b147 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (28 commits)
  trivial: Update my email address
  trivial: NULL noise: drivers/mtd/tests/mtd_*test.c
  trivial: NULL noise: drivers/media/dvb/frontends/drx397xD_fw.h
  trivial: Fix misspelling of "Celsius".
  trivial: remove unused variable 'path' in alloc_file()
  trivial: fix a pdlfush -> pdflush typo in comment
  trivial: jbd header comment typo fix for JBD_PARANOID_IOFAIL
  trivial: wusb: Storage class should be before const qualifier
  trivial: drivers/char/bsr.c: Storage class should be before const qualifier
  trivial: h8300: Storage class should be before const qualifier
  trivial: fix where cgroup documentation is not correctly referred to
  trivial: Give the right path in Documentation example
  trivial: MTD: remove EOL from MODULE_DESCRIPTION
  trivial: Fix typo in bio_split()'s documentation
  trivial: PWM: fix of #endif comment
  trivial: fix typos/grammar errors in Kconfig texts
  trivial: Fix misspelling of firmware
  trivial: cgroups: documentation typo and spelling corrections
  trivial: Update contact info for Jochen Hein
  trivial: fix typo "resgister" -> "register"
  ...
2009-04-03 15:24:35 -07:00