aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)Author
2007-11-20Revert "ACPI: EC: Workaround for optimized controllers"Len Brown
This reverts commit f2d68935ba08cf80f151bbdb5628381184e4a498.
2007-11-20ACPI: acpiphp: Remove dmesg spam on device removeGary Hade
In cases where acpi_pci_bind() does not attach device data, acpi_pci_unbind() complains via an ACPI exception about the missing data when the device is removed. For example, acpi_pci_bind() does not attach data for non-existent device functions so when the device is removed using the ACPI PCI hotplug driver 'acpiphp' an ACPI exception is logged for every non-existent function. This patch avoids the confusing log messages by removing the unnecessary ACPI exception. Signed-off-by: Gary Hade <garyhade@us.ibm.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20Pull fluff into release branchLen Brown
Conflicts: drivers/acpi/ec.c Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20Pull video-2.6.24 into release branchLen Brown
2007-11-20Pull thermal into release branchLen Brown
2007-11-20Pull procfs-default into release branchLen Brown
Conflicts: drivers/acpi/sbs.c Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-20Pull cpuidle into release branchLen Brown
2007-11-20Pull bugzilla-9327 into release branchLen Brown
2007-11-20Pull bugzilla-9262 into release branchLen Brown
2007-11-20Pull battery into release branchLen Brown
2007-11-19ACPI: Add missing spaces to printk formatJoe Perches
Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19cpuidle: fix HP nx6125 regressionVenkatesh Pallipadi
Fix for http://bugzilla.kernel.org/show_bug.cgi?id=9355 cpuidle always used to fallback to C2 if there is some bm activity while entering C3. But, presence of C2 is not always guaranteed. Change cpuidle algorithm to detect a safe_state to fallback in case of bm_activity and use that state instead of C2. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19cpuidle: add sched_clock_idle_[sleep|wakeup]_event() hooksVenkatesh Pallipadi
Port 2aa44d0567ed21b47b87d68819415d48194cb923 (sched: sched_clock_idle_[sleep|wakeup]_event()) to cpuidle. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19cpuidle: fix C3 for no bus-master control caseVenkatesh Pallipadi
Port 18eab8550397f1f3d4b8b2c5257c88dae25d58ed (Enable C3 even when PM2_control is zero) to cpuidle. Without this patch, some systems will notice a regression when enabling CPU_IDLE -- C3 would no longer be available. Signed-off-by: Venkatesh Pallipadi <venkatesh.pallipadi@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19ACPI: EC: Don't init EC early if it has no _INIAlexey Starikovskiy
Option to init EC early inserted to handle #8598 ASUS problem, introduced several others. EC driver in this particular case has fake _INI method, not present on other machines, which don't need or break from this workaround, so lets use its presence as a flag for early init. http://bugzilla.kernel.org/show_bug.cgi?id=9262 http://bugzilla.kernel.org/show_bug.cgi?id=8598 https://bugzilla.novell.com/show_bug.cgi?id=334806 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19Revert "acpi: make ACPI_PROCFS default to y"Len Brown
This reverts commit cbff2fbf55c21f50298b1aef1263b11bf510e35f.
2007-11-19Revert "ACPI: add documentation for deprecated /proc/acpi/battery in ↵Len Brown
ACPI_PROCFS" This reverts commit 6e800af233e0bdf108efb7bd23c11ea6fa34cdeb.
2007-11-19ACPI: Split out control for /proc/acpi entries from battery, ac, and sbs.Alexey Starikovskiy
Introduce new ACPI_PROCFS_POWER (default Yes) config option and move procfs code in battery, ac, and sbs drivers under it. This is done to allow ACPI_PROCFS to be default No. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19ACPI: Video: Increase buffer size for writes to brightness proc file.Danny Baumann
In order to be able to write the value "100" to /proc/acpi/video/.../brightness, we have to allocate 5 bytes: 4 characters will be written (1, 0, 0 plus null byte), and 1 byte should be buffer for a terminating NULL character. http://bugzilla.kernel.org/show_bug.cgi?id=9278 Signed-off-by: Danny Baumann <dannybaumann@web.de> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-19ACPI: EC: Workaround for optimized controllersAlexey Starikovskiy
Some controllers fail to send confirmation GPE after address write. Detect this and don't expect such confirmation in future. This is a generalization of previous workaround (66c5f4e7367b0085652931b2f3366de29e7ff5ec), which did only read address. http://bugzilla.kernel.org/show_bug.cgi?id=9327 Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Romano Giannetti <romano.giannetti@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-18ACPI: SBS: Fix retval warningJeff Garzik
drivers/acpi/sbs.c: In function acpi_battery_add: drivers/acpi/sbs.c:811: warning: ignoring return value of device_create_file, declared with attribute warn_unused_result Additional cleanups: * use struct acpi_battery in acpi_battery_remove() to clean up function calls, just like acpi_battery_add() already does. * put braces around unregister call, as it depends on dev being not NULL. * remove unneeded braces Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Enable MSR (FixedHW) support for T-StatesZhao Yakui
Add throttling control via MSR when T-states uses the FixHW Control Status registers. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Get throttling info from BIOS only after evaluating _PDCZhao Yakui
Previously _PDC was evaluated later, and thus we'd not get the chance to tell the BIOS that we can suport FixedHW registers (MSRs) and the BIOS would always ask us to use System I/O access for throttling. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Use _TSS for throttling control, when present. Add error checks.Zhao Yakui
_TSS was erroneously ignored, in favor of the FADT. When TSS is used, the access width is included in the PTC control/status register. So it is unnecessary that the access bit width is multiplied by 8. At the same time the bit_offset should be considered for system I/O Access. It should be checked the bit_width and bit_offset of PTC regsiter in order to avoid the failure of system I/O access. It means that bit_width plus bit_offset can't be greater than 32. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: throttle: Change internal APIs better handle _PTCZhao Yakui
Change the function interface for throttling control via PTC. The following functions are concerned: acpi_read_throttling_status() acpi_write_throttling_state() acpi_get_throttling_value() acpi_get_throttling_state() Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: If _TSS exists, do not access FADT.duty_widthZhao Yakui
Factor out legacy FADT.duty_width code and run it only in the non _TSS case. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Handle I/O access width requestst that are not a multiple of 8 bits.Zhao Yakui
We've run into BIOS that hand us 4-bit access width requests for T-state control when the code expected only multipls of 8-bits. Round up. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-16ACPI: Enforce T-state limit changes immediatelyZhao Yakui
When a T-state limit change notification is received, Linux must evaluate _TPC and change its current T-state immediately to comply with the new limit. Previously, Linux would notice the new limit only upon the next throttling change. Signed-off-by: Zhao Yakui <yakui.zhao@intel.com> Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14ACPI: AC: Update AC state on resumeAlexey Starikovskiy
Check if AC state has changed across resume and notify userspace if so. Fixes "[2.6.24-rc1 regression] AC adapter state does not change after resume" Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Andrey Borzenkov <arvidjaar@mail.ru> Cc: Len Brown <lenb@kernel.org> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14make /proc/acpi/ac_adapter dependent on ACPI_PROCFSAndrey Borzenkov
Do not provide /proc/acpi/ac_adapter if ACPI_PROCFS is not defined. This eliminates duplicated power adapters in HAL and makes it consistent with battery module Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Cc: Len Brown <lenb@kernel.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14acpi: make ACPI_PROCFS default to yAndrew Morton
Zillions of people are getting my-battery-monitor-doesnt-work problems (including me). Lessen the damage by making ACPI_PROCFS default to on. Cc: Len Brown <lenb@kernel.org> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Acked-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14Fix Oops in toshiba_acpi error return pathAndrey Borzenkov
When backlight_device_register() fails, return after undo initialization, do not try to use pointer that just was reset to NULL This fixes this oops: [ 1595.177672] [<c010480a>] show_trace_log_lvl+0x1a/0x30 [ 1595.177706] [<c01052a2>] show_trace+0x12/0x20 [ 1595.177718] [<c0105305>] dump_stack+0x15/0x20 [ 1595.177728] [<c01c9375>] kobject_shadow_add+0x125/0x1c0 [ 1595.177754] [<c01c941a>] kobject_add+0xa/0x10 [ 1595.177764] [<c0239a37>] device_add+0x97/0x5d0 [ 1595.177776] [<c0239f82>] device_register+0x12/0x20 [ 1595.177786] [<dfd912df>] backlight_device_register+0x9f/0x110 [backlight] [ 1595.177814] [<df861117>] toshiba_acpi_init+0x117/0x15e [toshiba_acpi] [ 1595.177834] [<c013e28d>] sys_init_module+0xfd/0x14e0 [ 1595.177871] [<c0104112>] sysenter_past_esp+0x5f/0x99 [ 1595.177883] ======================= [ 1595.177890] Could not register toshiba backlight device [ 1595.177985] BUG: unable to handle kernel NULL pointer dereference at virtual address 00000004 ... [ 1595.394097] EIP: 0060:[<df861143>] Not tainted VLI [ 1595.394101] EFLAGS: 00010282 (2.6.23-rc9-1avb #24) [ 1595.480081] EIP is at toshiba_acpi_init+0x143/0x15e [toshiba_acpi] Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru> Cc: John Belmonte <toshiba_acpi@memebeam.org> Acked-by: Richard Purdie <rpurdie@rpsys.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-14ACPI: video - delete stray run-time printkLen Brown
printk("video bus notify\n"); Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2007-11-14ACPI: video - convert semaphore to a mutexDmitry Torokhov
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>
2007-11-14ACPI: video - remove unsafe uses of list_for_each_safe()Dmitry Torokhov
list_for_each_safe() only protects list from list alterations performed by the same thread. One still needs to implement proper locking when list is being accessed from several threads. 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>
2007-11-14ACPI: video - add missing input_free_device()Dmitry Torokhov
If input_register_device() fails input_free_device() must be called to release memory allocated for the device. Also consolidate error handling in acpi_bus_video_add() and handle input_allocate_device() failures. 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>
2007-11-14ACPI: video - fit input device into sysfs treeDmitry Torokhov
Properly set up parent on input device registered by the video driver. 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>
2007-11-13ACPI: Battery: remove cycle from battery removal.Alexey Starikovskiy
get_property() should not call battery_update(), it also should call get_status() only if battery is present to avoid cycle and oops. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Rolf Eike Beer <eike-kernel@sf-tec.de> Acked-by: Johannes Weiner <hannes@saeurebad.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-10ACPI: add documentation for deprecated /proc/acpi/battery in ACPI_PROCFSJerome Pinot
Add documentation in Kconfig help about the move of /proc/acpi/battery to /sys/class/power_supply when selecting ACPI_PROCFS. This will impact a lot of users and should be documented. Signed-off-by: Jerome Pinot <ngc891@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-11-08ACPI: Always return valid 'status' from acpi_battery_get_property()Roland Dreier
If a battery is at a critical charge level and not being charged or discharged, then the ACPI _BST method will return a state of 4, and the current acpi_battery_get_property() code will not set any property value for POWER_SUPPLY_PROP_STATUS. This will cause an oops in power_supply_show_property() when it reads off the end of the status_text array. This actually was causing a 100% reproducible crash on boot on my laptop with two batteries, when one battery was completely drained and the laptop was not plugged in. Fix this by making sure acpi_battery_get_property() returns POWER_SUPPLY_STATUS_UNKNOWN for any battery state it doesn't already handle explicitly. There doesn't seem to be any status enum value defined that makes more sense than 'unknown' for a battery at a critical charge level. Signed-off-by: Roland Dreier <roland@digitalvampire.org> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <lenb@t61.(none)>
2007-10-29Pull documentation into release branchLen Brown
2007-10-29Pull alexey-fixes into release branchLen Brown
2007-10-29acpi: remove double mention of Support for ACPI optionFrans Pop
Current description for CONFIG_ACPI includes the word "Support" twice. One effect of this is that in menuconfig the "--->" that indicates the presence of sub-options will not show up unless you have a very wide console. Signed-off-by: Frans Pop <elendil@planet.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-10-29ACPI: use select POWER_SUPPLY for AC, BATTERY and SBSAlexey Starikovskiy
POWER_SUPPLY is needed for AC, battery, and SBS sysfs support. Use 'select' instead of 'depends on', as it is will not be selected by anything else, leading to confusion. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Frans Pop <elendil@planet.nl> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
2007-10-29ACPI: Battery: Allow extract string from integerAlexey Starikovskiy
Some machines return integer instead of expected string. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Tested-by: Andrey Borzenkov <arvidjaar@mail.ru> Tested-by: Frans Pop <elendil@planet.nl> Signed-off-by: Len Brown <len.brown@intel.com>
2007-10-29ACPI: battery: Support for non-spec name for LiIon technologyAlexey Starikovskiy
Support Li-Ion as possible name for technology. Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-10-29ACPI: battery: register power_supply subdevice only when battery is presentAndrey Borzenkov
Make sure no power_supply object is present unless we actualy detect presence of battery. This fixes ghost batteries detected by HAL Signed-off-by: Andrey Borzenkov <arvidjaar@mail.ru> Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-10-25Fix /proc/acpi/alarm BCD alarm encodingsLinus Torvalds
This fixes some totally illogical and wrong code that converts things to and from BCD mode essentially randomly, does math on values in BCD mode etc etc. Introduce a few helper functions to make it a bit more obvious what is going on, and make sure that we always do all the arithmetic (and anythign else, for that matter) in binary, not BCD. Tested by Mark Lord, who found the problem originally, and also pushed the patch back and reminded me about it. Signed-off-by: Mark Lord <mlord@pobox.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-10-25ACPI: battery: Update battery information upon sysfs read.Alexey Starikovskiy
Signed-off-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>
2007-10-25ACPI: EC: fix use-after-freeAdrian Bunk
This patch fixes a use-after-free introduced by commit 30c08574da0ead1a47797ce028218ce5b2de61c7 (ACPI: EC: Add new query handler to list head) Spotted by the Coverity checker. Signed-off-by: Adrian Bunk <bunk@kernel.org> Acked-by: Alexey Starikovskiy <astarikovskiy@suse.de> Signed-off-by: Len Brown <len.brown@intel.com>