aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi/ibm_acpi.c
AgeCommit message (Collapse)Author
2007-03-25ACPI: ibm-acpi: move driver to drivers/misc hierarchyHenrique de Moraes Holschuh
ibm-acpi is not an ACPICA driver, so move it to drivers/misc as per Len Brown's request. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25ACPI: ibm-acpi: update copyright noticeHenrique de Moraes Holschuh
Update copyright and license info on the source code comments. No functional changes. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25ACPI: ibm-acpi: organize codeHenrique de Moraes Holschuh
Shuffle code around to better organize the driver code inside the ibm-acpi.c file. This patch adds no functional changes. It is pure fluff that will make me a bit more productive. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25ACPI: ibm-acpi: add header fileHenrique de Moraes Holschuh
Add a (private) header file for ibm-acpi, and move type definitions and ThinkPad driver constants to the new header file. This patch has no functional changes. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25ACPI: ibm-acpi: rename some identifiersHenrique de Moraes Holschuh
Rename some identifiers so that they are more in tune with the rest of the driver code, or less generic. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-25ACPI: ibm-acpi: kill trailing whitespaceHenrique de Moraes Holschuh
I shall protect the ibm-acpi city against the invasion of the barbarian blanks! To the unforgiving jaws of sed s/[[:blank:]]\+$// they go! Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-16ACPI: ibm-acpi: allow module to load when acpi notifiers can't be set (v2)Henrique de Moraes Holschuh
This patch allows for ibm-acpi to coexist (with diminished functionality) with other drivers like ACPI_BAY. ibm-acpi will simply disable the functions it is not able to register ACPI notifiers for. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Cc: Chris Wedgwood <cw@f00f.org> Cc: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-03-08ACPI: ibm-acpi: improve backlight power handlingHenrique de Moraes Holschuh
Improve the backlight code to emulate as much as possible the power management events, as we are unable to really power on or power off the backlight. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-22ACPI: ibm-acpi: make ibm-acpi bay support optionalHenrique de Moraes Holschuh
Make ibm-acpi bay support optional at kernel compile time. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2007-02-22ACPI: ibm-acpi: fix initial status of backlight deviceHenrique de Moraes Holschuh
The brightness class core does not update the initial status of the device's brightness at register time. Do it by ourselves. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Acked-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-20backlight: Separate backlight properties from backlight ops pointersRichard Purdie
Per device data such as brightness belongs to the indivdual device and should therefore be separate from the the backlight operation function pointers. This patch splits the two types of data and allows simplifcation of some code. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-20backlight: Remove unneeded owner fieldRichard Purdie
Remove uneeded owner field from backlight_properties structure. Nothing uses it and it is unlikely that it will ever be used. The backlight class uses other means to ensure that nothing references unloaded code. Based on a patch from Dmitry Torokhov <dtor@insightbb.com> Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
2007-02-16Pull remove-hotkey into release branchLen Brown
2007-02-16ACPI: hotkey: remove driver, per feature-removal-schedule.txtLen Brown
Signed-off-by: Len Brown <len.brown@intel.com>
2007-02-09ACPI: ibm-acpi: cleanup init and exit pathsHenrique de Moraes Holschuh
Fix a small memory leak on module removal, and other assorted minor cleanups on the module init codepath. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2007-01-11Revert "ACPI: ibm-acpi: make non-generic bay support optional"Henrique de Moraes Holschuh
This reverts commit 2df910b4c3edcce9a0c12394db6f5f4a6e69c712. ACPI_BAY has not been merged into mainline yet, so the changes to ibm-acpi related Kconfig entries that depend on ACPI_BAY were permanently disabling ibm-acpi bay support. This is a serious regression for ThinkPad users. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-22Merge branch 'release' of ↵Linus Torvalds
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: (68 commits) ACPI: replace kmalloc+memset with kzalloc ACPI: Add support for acpi_load_table/acpi_unload_table_id fbdev: update after backlight argument change ACPI: video: Add dev argument for backlight_device_register ACPI: Implement acpi_video_get_next_level() ACPI: Kconfig - depend on PM rather than selecting it ACPI: fix NULL check in drivers/acpi/osl.c ACPI: make drivers/acpi/ec.c:ec_ecdt static ACPI: prevent processor module from loading on failures ACPI: fix single linked list manipulation ACPI: ibm_acpi: allow clean removal ACPI: fix git automerge failure ACPI: ibm_acpi: respond to workqueue update ACPI: dock: add uevent to indicate change in device status ACPI: ec: Lindent once again ACPI: ec: Change #define to enums there possible. ACPI: ec: Style changes. ACPI: ec: Acquire Global Lock under EC mutex. ACPI: ec: Drop udelay() from poll mode. Loop by reading status field instead. ACPI: ec: Rename gpe_bit to gpe ...
2006-12-20ACPI: replace kmalloc+memset with kzallocBurman Yan
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-20Driver core: proper prototype for drivers/base/init.c:driver_init()Adrian Bunk
Add a prototype for driver_init() in include/linux/device.h. Also remove a static function of the same name in drivers/acpi/ibm_acpi.c to ibm_acpi_driver_init() to fix the namespace collision. Signed-off-by: Adrian Bunk <bunk@stusta.de> Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-12-20Pull platform-drivers into test branchLen Brown
2006-12-20ACPI: video: Add dev argument for backlight_device_registerYu Luming
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-19ACPI: ibm_acpi: allow clean removalAlexey Starikovskiy
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-16Pull style into test branchLen Brown
Conflicts: drivers/acpi/button.c drivers/acpi/ec.c drivers/acpi/osl.c drivers/acpi/sbs.c
2006-12-16ACPI: ibm_acpi: respond to workqueue updateLen Brown
Signed-off-by: Len Brown <len.brown@intel.com>
2006-12-07ACPI: ibm-acpi: update version and copyrightHenrique de Moraes Holschuh
Bump up module version, add myself to copyright and MODULE_AUTHOR. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: style fixes and cruft removalHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: backlight device cleanupHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: make non-generic bay support optionalHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: add support for the ultrabay on the T60,X60Henrique de Moraes Holschuh
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-07ACPI: ibm-acpi: implement fan watchdog commandHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: workaround for EC 0x2f initialization bugHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: store embedded controller firmware version for matchingHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: fix and extend fan control functionsHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: fix and extend fan enableHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: extend fan status functionsHenrique de Moraes Holschuh
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-07ACPI: ibm-acpi: document fan controlHenrique de Moraes Holschuh
This patch documents the ThinkPad fan control strategies. Source of the data: 0. ibm-acpi source 1. DSDTs for various ThinkPads (770, X31, X40, X41, T43, A21m, T22) 2. http://thinkwiki.org/wiki/Embedded_Controller_Firmware#Firmware_Issues 3. http://thinkwiki.org/wiki/How_to_control_fan_speed 4. Various threads about windows fan control utilities in thinkpads.com Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: cleanup fan_writeHenrique de Moraes Holschuh
This patch cleans up fan_write so that it is much easier to read and extend. It separates the proc api handling from the operations themselves. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: break fan_read into separate functionsHenrique de Moraes Holschuh
This patch breaks fan_read mechanics into a generic function to get fan status and speed, and leaves only the procfs interface code in fan_read. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: clean up fan_readHenrique de Moraes Holschuh
This patch cleans up fan_read so that it is much easier to read and extend. The patch fixes the userspace ABI to return "status: not supported" (like all other ibm-acpi functions) when neither fan status or fan control are possible. It also fixes the userspace ABI to return EIO if ACPI access to the EC fails, instead of returning "status: unreadable" or "speed: unreadable". Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: prepare to cleanup fan_read and fan_writeHenrique de Moraes Holschuh
This patch lays some groundwork for a fan_read and fan_write cleanup in the next patches. To do so, it provides a new fan_init initializer, and also some constants (through enums). Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: Implement direct-ec-access thermal reading modes for up to ↵Henrique de Moraes Holschuh
16 sensors This patch extends ibm-acpi to support reading thermal sensors directly through ACPI EC register access. It uses a DMI match to detect ThinkPads with a new-style embedded controller, that are known to have forward- compatible register maps and use 0x00 to fill in non-used registers and export thermal sensors at EC offsets 0x78-7F and 0xC0-C7. Direct ACPI EC register access is implemented for 8-sensor and 16-sensor new-style ThinkPad controller firmwares as an experimental feature. The code does some limited sanity checks on the temperatures read through EC access, and will default to the old ACPI TMP0-7 mode if anything is amiss. Userspace ABI is not changed for 8 sensors, but /proc/acpi/ibm/thermal is extended for 16 sensors if the firmware supports 16 sensors. A documentation update is also provided. The information about the ThinkPad register map was determined by studying ibm-acpi "ecdump" output from various ThinkPad models, submitted by subscribers of the linux-thinkpad mailinglist. Futher information was gathered from the DSDT tables, as they describe the EC register map in recent ThinkPads. DSDT source shows that TMP0-7 access and direct register access are actually the same thing on these firmwares, but unfortunately IBM never did update their DSDT EC register map to export TMP8-TMP15 for the second range of sensors. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: Use a enum to select the thermal sensor reading strategyHenrique de Moraes Holschuh
This patch consolidades all decisions regarding the strategy to be used to read thinkpad thermal sensors into a single enum, and refactors the thermal sensor reading code to use a much more readable (and easier to extend) switch() construct, in a separate function. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: trivial Lindent cleanupsHenrique de Moraes Holschuh
This patch just makes drives/acpi/ibm-acpi.c Lindent-clean, as requested by Len Brown. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-12-07ACPI: ibm-acpi: do not use / in driver namesHenrique de Moraes Holschuh
ibm-acpi uses sub-device names like ibm/hotkey, which get in the way of a sysfs conversion. Fix it to use ibm_hotkey instead. Thanks to Zhang Rui for noticing this. Signed-off-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
2006-10-21ACPI: ibm_acpi: Add support for the generic backlight deviceHolger Macht
Add support for the generic backlight interface below /sys/class/backlight. The patch keeps the procfs brightness handling for backward compatibility. Add two generic functions brightness_get and brightness_set to be used both by the procfs related and the sysfs related methods. [apw@shadowen.org: backlight users need to select BACKLIGHT_CLASS_DEVICE] Signed-off-by: Holger Macht <hmacht@suse.de> Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14ACPI: Remove unnecessary from/to-void* and to-void casts in drivers/acpiJan Engelhardt
Signed-off-by: Jan Engelhardt <jengelh@gmx.de> Signed-off-by: Len Brown <len.brown@intel.com>
2006-10-14ACPI: ibm_acpi: Remove experimental status for brightness and volume.Stefan Schmidt
The brightness and volume features from ibm-acpi are stable. The experimental flag is no longer needed. Signed-off-by: Stefan Schmidt <stefan@datenfreihafen.org> Acked-by: Borislav Deianov <borislav@users.sourceforge.net> Signed-off-by: Len Brown <len.brown@intel.com>
2006-06-01ACPI: Allow a WAN module enable/disable on a Thinkpad X60.Jeremy Fitzhardinge
The WAN (Sierra Wireless EV-DO) module is very similar to the Bluetooth module. It appears on the USB bus when enabled. It can be controlled via hot key, or directly via ACPI. This change enables direct control via ACPI. I have tested it on my Lenovo Thinkpad X60; I guess it will probably work on other Thinkpad models which come with this module installed. Signed-off-by: Jeremy Fitzhardinge <jeremy@goop.org> Ack'd by: Borislav Deianov <borislav@users.sf.net> Signed-off-by: Len Brown <len.brown@intel.com>
2006-03-23[PATCH] acpi: remove dock event handling from ibm_acpiKristen Accardi
Remove dock station support from ibm_acpi by default. This support has been put into acpiphp instead. Allow ibm_acpi to continue to provide docking station support via config option for laptops/docking stations that are not supported by acpiphp. Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-25[ACPI] IBM ThinkPad ACPI Extras Driver v0.12Borislav Deianov
http://ibm-acpi.sf.net/ Signed-off-by: Borislav Deianov <borislav@users.sf.net> Signed-off-by: Len Brown <len.brown@intel.com>