Commit Graph

530 Commits (5b7b4119553dd7cc0bc200c0d1b1598e158eec9a)

Author SHA1 Message Date
Len Brown 5b7b411955 Pull sgi into test branch 2006-12-20 02:53:27 -05:00
Len Brown 3be11c8f4f Pull bugfix into test branch 2006-12-20 02:52:50 -05:00
Len Brown 706b75ddbe Pull ec into test branch 2006-12-20 02:52:33 -05:00
Len Brown 40b20c257a Pull platform-drivers into test branch 2006-12-20 02:52:17 -05:00
John Keller 0f0fe1a08a ACPI: Add support for acpi_load_table/acpi_unload_table_id
Make acpi_load_table() available for use by removing it from the #ifdef
ACPI_FUTURE_USAGE.

Also add a new routine used to unload an ACPI table of a given type and "id" -
acpi_unload_table_id().  The implementation of this new routine was almost a
direct copy of existing routine acpi_unload_table() - only difference being
that it only removes a specific table id instead of ALL tables of a given
type.  The SN hotplug driver (sgi_hotplug.c) now uses both of these interfaces
to dynamically load and unload SSDT ACPI tables.

Also, a few other ACPI routines now used by the SN hotplug driver are exported
(since the driver can be a loadable module):

 acpi_ns_map_handle_to_node
 acpi_ns_convert_entry_to_handle
 acpi_ns_get_next_node

Signed-off-by: Aaron Young <ayoung@sgi.com>
Cc: Greg KH <greg@kroah.com>
Cc: "Luck, Tony" <tony.luck@intel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 01:51:14 -05:00
Yu Luming 519ab5f2be ACPI: video: Add dev argument for backlight_device_register
This patch set adds generic abstract layer support for acpi video driver to
have generic user interface to control backlight and output switch control by
leveraging the existing backlight sysfs class driver, and by adding a new
video output sysfs class driver.

This patch:

Add dev argument for backlight_device_register to link the class device to
real device object.  The platform specific driver should find a way to get the
real device object for their video device.

[akpm@osdl.org: build fix]
[akpm@osdl.org: fix msi-laptop.c]
Signed-off-by: Luming Yu <Luming.yu@intel.com>
Cc: "Antonino A. Daplas" <adaplas@pol.net>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 01:42:19 -05:00
Thomas Tuttle f4715189df ACPI: Implement acpi_video_get_next_level()
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-20 01:38:38 -05:00
Andrew Morton 6796a1204c ACPI: Kconfig - depend on PM rather than selecting it
Make ACPI depend on PM rather than selecting it.
Otherwise it's a nightmare working out why CONFIG_PM keeps getting set.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 01:36:29 -05:00
Adrian Bunk a6fdbf90b9 ACPI: fix NULL check in drivers/acpi/osl.c
Spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 01:27:57 -05:00
Adrian Bunk a854e08a5a ACPI: make drivers/acpi/ec.c:ec_ecdt static
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 00:44:39 -05:00
Akinobu Mita 83822fc9e6 ACPI: prevent processor module from loading on failures
Make loading processor.ko fail when an error happens.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 00:33:07 -05:00
Akinobu Mita f10bb2544b ACPI: fix single linked list manipulation
Fix single linked list manipulation for sub_driver.  If the remving entry
is not on the head of the sub_driver list, it goes into infinate loop.

Though that infinite loop doesn't happen.  Because the only user of
acpi_pci_register_dirver() is acpiphp.

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20 00:30:48 -05:00
Alexey Starikovskiy 4afaf54b3b ACPI: ibm_acpi: allow clean removal
Allow clean removal by setting notify_installed in the right place.

Signed-off-by: Alexey Starikovskiy <alexey.y.starikovskiy@intel.com>
Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-19 23:07:39 -05:00
Len Brown cece901481 Pull style into test branch
Conflicts:

	drivers/acpi/button.c
	drivers/acpi/ec.c
	drivers/acpi/osl.c
	drivers/acpi/sbs.c
2006-12-16 01:04:27 -05:00
Len Brown cfee47f99b Pull bugfix into test branch
Conflicts:

	kernel/power/disk.c
2006-12-16 01:01:18 -05:00
Len Brown 463e7c7cf9 Pull trivial into test branch
Conflicts:

	drivers/acpi/ec.c
2006-12-16 00:45:07 -05:00
Len Brown 25c68a33b7 ACPI: ibm_acpi: respond to workqueue update
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-16 00:39:50 -05:00
Len Brown 6bfe5c9d6f Pull platform-drivers into test branch 2006-12-16 00:34:18 -05:00
Len Brown b361735043 Pull button into test branch 2006-12-16 00:34:00 -05:00
Len Brown fb7665544d Pull dock into test branch 2006-12-16 00:33:45 -05:00
Kristen Carlson Accardi 8ea86e0ba7 ACPI: dock: add uevent to indicate change in device status
Send a uevent to indicate a device change whenever we dock or
undock, so that userspace may now check the dock status via sysfs.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Holger Macht <hmacht@suse.de>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-14 17:16:06 -05:00
Alexey Starikovskiy 6ccedb10e3 ACPI: ec: Lindent once again
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:09 -05:00
Alexey Starikovskiy 3261ff4db3 ACPI: ec: Change #define to enums there possible.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:09 -05:00
Alexey Starikovskiy 78d0af3392 ACPI: ec: Style changes.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy 523953b41e ACPI: ec: Acquire Global Lock under EC mutex.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy 50c1e1138c ACPI: ec: Drop udelay() from poll mode. Loop by reading status field instead.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy a86e277259 ACPI: ec: Rename gpe_bit to gpe
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy c787a8551e ACPI: ec: Change semaphore to mutex.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:07 -05:00
Alexey Starikovskiy 5d0c288b73 ACPI: ec: Query only single query at a time.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:06 -05:00
Alexey Starikovskiy e41334c0a6 ACPI: ec: Remove calls to clear_gpe() and enable_gpe(), as these are handled at
dispatch_gpe() level.

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:06 -05:00
Alexey Starikovskiy af3fd1404f ACPI: ec: Remove expect_event and all races around it.
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:06 -05:00
Alexey Starikovskiy bec5a1e060 ACPI: ec: Read status register from check_status() function
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:06 -05:00
Alexey Starikovskiy 5c4064124a ACPI: ec: Increase timeout from 50 to 500 ms to handle old slow machines.
http://bugzilla.kernel.org/show_bug.cgi?id=7466

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:05 -05:00
Alexey Starikovskiy 5d57a6a55e ACPI: ec: Enable EC GPE at beginning of transaction
Temporary measure until resume sequence is right.

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:05 -05:00
Alexey Starikovskiy d91df1aaa9 ACPI: ec: Allow for write semantics in any command.
Check for transaction attributes, not command index to decide on event to
expect.

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-08 02:56:04 -05:00
Prarit Bhargava 2548c06b72 ACPI: dock: Fix symbol conflict between acpiphp and dock
Fix bug which will cause acpiphp to not be able to load when dock.ko
cannot load.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-07 04:17:52 -05:00
brandon@ifup.org c80fdbe81a ACPI: dock: Add a docked sysfs file to the dock driver.
Add 2 sysfs files for user interface.
1) docked - 1/0 (read only) - indicates whether the software believes the
laptop is docked in a docking station.
2) undock - (write only) - writing to this file causes the software to
initiate an undock request to the firmware.

Signed-off-by: Brandon Philips <brandon@ifup.org>
Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-07 04:17:45 -05:00
Len Brown e67beb37df ACPI: dock: fix build warning
drivers/acpi/dock.c:689: warning: too many arguments for format

Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-07 04:17:35 -05:00
Kristen Carlson Accardi 671adbec21 ACPI: dock: Make the dock station driver a platform device driver.
Make the dock station driver a platform device driver so that
we can create sysfs entries under /sys/device/platform.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-07 04:11:58 -05:00
Henrique de Moraes Holschuh f9ff43a626 ACPI: ibm-acpi: update version and copyright
Bump up module version, add myself to copyright and MODULE_AUTHOR.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:47 -05:00
Henrique de Moraes Holschuh 9a8e1738c1 ACPI: ibm-acpi: style fixes and cruft removal
This patch just fixes style, move some #defines to enums, and removes some
old cruft.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:47 -05:00
Henrique de Moraes Holschuh fb87a811a4 ACPI: ibm-acpi: backlight device cleanup
This patch cleans up the recently added backlight device support by Holger
Macht <hmacht@suse.de> to fit well with the rest of the code, using the
ibms struct as the other "subdrivers" in ibm-acpi.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:45 -05:00
Henrique de Moraes Holschuh 2df910b4c3 ACPI: ibm-acpi: make non-generic bay support optional
This patch makes it possible to disable ibm-acpi non-generic bay support,
as generic bay support already works well for a number of ThinkPads.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:45 -05:00
Henrique de Moraes Holschuh e0298997ac ACPI: ibm-acpi: add support for the ultrabay on the T60,X60
This patch adds support for the ultrabay on the T60, X60 and other new
ThinkPads that have a SATA ultrabay.

I intend to keep bay and dock support in ibm-acpi working and updated until
it finally gets deprecated and removed in favour of the generic dock and
bay support.  But we aren't there yet.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:45 -05:00
Henrique de Moraes Holschuh 16663a87ad ACPI: ibm-acpi: implement fan watchdog command
This patch implements a fan control safety watchdog, by request of the
authors of userspace fan control scripts.

When the watchdog timer expires, the equivalent action of a "fan enable"
command is executed.  The watchdog timer is reset at every reception of a
fan control command that could change the state of the fan itself.

This command is meant to be used by userspace fan control daemons, to make
sure the fan is never left set to an unsafe level because of userspace
problems.

Users of the X31/X40/X41 "speed" command are on their own, the current
implementation of "speed" is just too incomplete to be used safely,
anyway.  Better to never use it, and just use the "level" command instead.

The watchdog is programmed using echo "watchdog <number>" > fan, where
number is the number of seconds to wait before doing an "enable", and zero
disables the watchdog.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:44 -05:00
Henrique de Moraes Holschuh 778b4d742b ACPI: ibm-acpi: workaround for EC 0x2f initialization bug
A few ThinkPads fail to initialize EC register 0x2f both in the EC
firmware and ACPI DSDT.  If the BIOS and the ACPI DSDT also do not
initialize it, then the initial status of that register does not
correspond to reality.

On all reported buggy machines, EC 0x2f will read 0x07 (fan level 7) upon
cold boot, when the EC is actually in mode 0x80 (auto mode).  Since
returning a text string ("unknown") would break a number of userspace
programs, instead we correct the reading for the most probably correct
answer, and return it is in auto mode.

The workaround flags the status and level as unknown on module load/kernel
boot, until we are certain at least one fan control command was issued,
either by us, or by something else.

We don't work around the bug by doing a "fan enable" at module
load/startup (which would initialize the EC register) because it is not
known if these ThinkPad ACPI DSDT might have set the fan to level 7
instead of "auto" (we don't know if they can do this or not) due to a
thermal condition, and we don't want to override that, should they be
capable of it.

We should be setting the workaround flag to "status known" upon resume, as
both reports and a exaustive search on the DSDT tables at acpi.sf.net show
that the DSDTs always enable the fan on resume, thus working around the
bug.  But since we don't have suspend/resume handlers in ibm-acpi yet and
the "EC register 0x2f was modified" logic is likely to catch the change
anyway, we don't.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:44 -05:00
Henrique de Moraes Holschuh 49a13cd6a2 ACPI: ibm-acpi: store embedded controller firmware version for matching
This patch changes the ThinkPad Embedded Controller DMI matching
code to store the firmware version of the EC for later usage, e.g.
for quirks.

It also prints the firmware version when starting up.

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:44 -05:00
Henrique de Moraes Holschuh a12095c2b5 ACPI: ibm-acpi: fix and extend fan control functions
This patch extend fan control functions, implementing enable/disable for
all write access modes, implementing level control for all level-capable
write access modes.

The patch also updates the documentation, explaining levels auto and
disengaged.

ABI changes:
	1. Support level 0 as an equivalent to disable
	2. Add support for level auto and level disengaged when doing
	   EC 0x2f fan control
	3. Support enable/disable for all level-based write access modes
	4. Add support for level command on FANS thinkpads, as per
	   thinkwiki reports

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:43 -05:00
Henrique de Moraes Holschuh 1c6a334e9c ACPI: ibm-acpi: fix and extend fan enable
This patch fix fan enable to attempt to do the right thing and not slow
down the fan if it is forced to the maximum speed.  It also extends fan
enable to work on older thinkpads.

ABI changes:
	1.  Support enable/disable for all level-based write access modes

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:40 -05:00
Henrique de Moraes Holschuh bab812a329 ACPI: ibm-acpi: extend fan status functions
This patch fixes fan_read to return correct values for all fan access
modes.  It also implements some fan access mode status output that was
missing, and normalizes the proc fan abi to return consistent data across
all fan read/write modes.

Userspace ABI changes and extensions:
	1. Return status: enable/disable for *all* modes
	   (this actually improves compatibility with userspace utils!)
	2. Return level: auto and level: disengaged for EC 2f access mode
	3. Return level: <number> for EC 0x2f access mode
	4. Return level 0 as well as "disabled" in level-aware modes

Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07 01:38:40 -05:00