aboutsummaryrefslogtreecommitdiff
path: root/drivers/acpi
AgeCommit message (Collapse)Author
2009-01-06trivial: fix an -> a typos in documentation and commentsFrederik Schwarzer
It is always "an" if there is a vowel _spoken_ (not written). So it is: "an hour" (spoken vowel) but "a uniform" (spoken 'j') Signed-off-by: Frederik Schwarzer <schwarzerf@gmail.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-01-03cpumask: convert shared_cpu_map in acpi_processor* structs to cpumask_var_tRusty Russell
Impact: Reduce memory usage, use new API. This is part of an effort to reduce structure sizes for machines configured with large NR_CPUS. cpumask_t gets replaced by cpumask_var_t, which is either struct cpumask[1] (small NR_CPUS) or struct cpumask * (large NR_CPUS). (Changes to powernow-k* by <travis>.) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Mike Travis <travis@sgi.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-12-31ACPICA: FADT: Update error msgs for consistencyBob Moore
Update all messages so they look consistent. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPICA: FADT: set acpi_gbl_use_default_register_widths to TRUE by defaultrobert.moore@intel.com
This returns the FADT support to the original behavior, which is to use default register widths. However, now check each register definition and report a warning if it differs from the default. This is a first step to moving away from the default widths, rather than outright believing the widths in all FADTs for all machines, considered rather dangerous until more data is obtained. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPICA: FADT parsing changes and fixesBob Moore
1) Update the register lengths for the PM1 event blocks. The length must be divided by two in order to use these to access the status registers. 2) Add run-time option to use default register lengths to override a faulty FADT. 3) Add warning message if any of the X64 address structures contain a length that does not match the legacy length earlier in the FADT. 4) Move all FADT warning messages into the ValidateFadt function. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPICA: Restructure includes into public/privateBob Moore
acpi.h now includes only the "public" acpica headers. All other acpica headers are "private" and should not be included by acpica users. One new file, accommon.h is used to include the commonly used private headers for acpica code generation. Future plans are to move all private headers to a new subdirectory. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPI: remove private acpica headers from driver filesLin Ming
External driver files should not include any private acpica headers. Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPI: reboot.c: use new acpi_reset interfaceLin Ming
Use new acpi_reset interface to write to reset register Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPICA: New: acpi_reset interface - write to reset registerBob Moore
Uses the FADT-defined reset register and reset value. Checks the FADT flags for the reset register supported bit. Supports reset register in memory or I/O space, but not in PCI config space since the host has the information to do it. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPICA: Move all public H/W interfaces to new hwxfaceBob Moore
Move public interfaces from hwregs.c to new file, hwxface.c - similar to the structure of the other ACPICA components. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPICA: New: acpi_read and acpi_write public interfacesBob Moore
Changed the acpi_hw_low_level_read and acpi_hw_low_level_write functions to the public acpi_read and acpi_write to allow direct access to ACPI registers. Removed the "width" parameter since the width can be obtained from the input GAS structure. Updated the FADT initialization to setup the GAS structures with the proper widths. Some widths are still hardcoded because many FADTs have incorrect register lengths. Signed-off-by: Bob Moore <robert.moore@intel.com Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPI: power.c: call acpi_get_name to get node nameLin Ming
acpi_ut_get_node_name is an internal acpica function. use acpi_get_name to get node ascii name Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPI: main.c: use new public GPE group enable/disable interfacesLin Ming
Avoid using internal functions: acpi_hw_disable_all_gpes and acpi_hw_enable_all_runtime_gpes Use new public GPE group enable/disable interfaces: acpi_disable_all_gpes and acpi_enable_all_runtime_gpes Also avoid using internal symbol ACPI_TABLE_INDEX_FACS, call acpi_get_table. Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPICA: New: Public GPE group enable/disable interfacesBob Moore
Added acpi_disable_all_gpes and acpi_enable_all_runtime_gpes for public use. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPICA: New: acpi_get_gpe_device interfaceBob Moore
This function maps an input GPE index to a GPE block device. Also Added acpi_current_gpe_count to track the current number of GPEs that are being managed by the ACPICA core (both FADT-based GPEs and the GPEs contained in GPE block devices.) Modify drivers/acpi/system.c to use these 2 new interfaces Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPI: wakeup.c: remove ACPI_FUNCTION_TRACELin Ming
ACPI_FUNCTION_TRACE is an internal acpica function. remove ACPI_FUNCTION_TRACE Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPI: proc.c: remove ACPI_FUNCTION_TRACELin Ming
ACPI_FUNCTION_TRACE and return_VALUE are internal acpica functions. remove ACPI_FUNCTION_TRACE replace return_VALUE with return Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPI: ec.c: call acpi_get_name to get node nameLin Ming
acpi_namespace_node is internal struct, it should not be used outside of ACPICA call acpi_get_name to get node ascii name Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-31ACPI: osl.c: replace return_ACPI_STATUS with returnLin Ming
return_ACPI_STATUS is an internal acpica function, replace it with return. acpi_gbl_permanent_mmap moved from acglobal.h to acpixf.h for external use Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30video: always update the brightness when poking "brightness"Zhang Rui
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-30ACPI: ec.c, pci_link.c, video_detec.c: staticRoel Kluin
Sparse asked whether these could be static. Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: simplify buffer management for acpi_pci_bind() etc.Len Brown
use ACPI_ALLOCATE_BUFFER to remove the allocations within acpi_pci_bind(), acpi_pci_unbind() and acpi_pci_bind_root(). While there, delete some unnecessary param inits from those routines. Delete concept of ACPI_PATHNAME_MAX, since this was the last use. Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: add HP copyrightBjorn Helgaas
Add HP copyright to pci_irq.c. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: whitespace and useless initialization cleanupBjorn Helgaas
This patch makes function declarations consistent throughout the file and removes some unnecessary initializations. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: expand acpi_pci_allocate_irq() and acpi_pci_free_irq() inlineBjorn Helgaas
acpi_pci_allocate_irq() and acpi_pci_free_irq() are trivial and only used once, so just open-code them. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: simplify struct acpi_prt_entryBjorn Helgaas
Remove unused "irq" field, remove unnecessary struct, rename "handle" to "link". Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: simplify list of _PRT entriesBjorn Helgaas
We don't need a struct containing a count and a list_head; a simple list_head is sufficient. The list iterators handle empty lists fine. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: combine lookup and deriveBjorn Helgaas
This folds acpi_pci_irq_derive() into acpi_pci_irq_lookup() so it can be easily used by both acpi_pci_irq_enable() and acpi_pci_irq_disable(). Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: follow typical PCI INTx swizzling patternBjorn Helgaas
No functional change; this just uses the typical pattern of PCI INTx swizzling done on other architectures. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: use positive logic to simplify codeBjorn Helgaas
This doesn't change anything functionally; it just changes tests so we test for success instead of failure. This makes the code read more easily and allows us to remove the "!entry" in the while loop condition. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: remove callback from acpi_pci_irq_lookup & acpi_pci_irq_deriveBjorn Helgaas
We currently pass a callback function (either acpi_pci_allocate_irq() or acpi_pci_free_irq()) to acpi_pci_irq_lookup() and acpi_pci_irq_derive(). I think it's simpler to remove the callback and just have the enable/ disable functions make the calls directly. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: tweak _PRT lookup debugBjorn Helgaas
Print one message (either "found" or "not found") for every _PRT search. And add pin information to the INTx swizzling debug. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: lookup _PRT entry by PCI dev and pin, not segment/bus/dev/pinBjorn Helgaas
There's no reason to pass around segment, bus, and device independently when we can just pass the pci_dev pointer, which carries all those already. The pci_dev contains an interrupt pin, too, but we still have to pass both the pci_dev and the pin because when we use a bridge to derive an IRQ, we need the pin from the downstream device, not the bridge. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: use 1-based encoding for _PRT quirksBjorn Helgaas
Use the PCI INTx pin encoding (1=INTA, 2=INTB, etc) for _PRT quirks. Then we can simply compare "entry->pin == quirk->pin". Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: always use the PCI INTx pin values, not the _PRT onesBjorn Helgaas
This patch changes pci_irq.c to always use PCI INTx pin encodings instead of a mix of PCI and _PRT encodings. The PCI INTx pin numbers from the PCI_INTERRUPT_PIN config register are 0=device doesn't use interrupts, 1=INTA, ..., 4=INTD. But the _PRT table uses 0=INTA, ..., 3=INTD. This patch converts the _PRT encoding to the PCI encoding immediately when we add a _PRT entry to the global list. All the rest of the code can then use the PCI encoding consistently. The point of this is to make the interrupt swizzling look the same as on other architectures, so someday we can unify them. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: add a helper to convert _PRT INTx pin number to nameBjorn Helgaas
This adds a helper function to convert INTx pin numbers from the _PRT (0, 1, 2, 3) to the pin name ('A', 'B', 'C', 'D'). Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: move struct acpi_prt_entry declaration out of public header fileBjorn Helgaas
The struct acpi_prt_entry is used only in pci_irq.c, so there's no need for the declaration to be public. This patch moves it into pci_irq.c. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: fix GSI/IRQ naming confusionBjorn Helgaas
The interrupt numbers from _PRT entries are GSIs, not Linux IRQs. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: ignore _PRT function informationBjorn Helgaas
_PRT entries don't contain any useful PCI function information (the function part of the PCI address is supposed to be 0xffff), and we don't ever look at it, so this patch just removes the reference to it. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: simplify buffer management for evaluating _PRTBjorn Helgaas
Previously, acpi_pci_irq_add_prt() did all its own buffer management. But now that we have ACPI_ALLOCATE_BUFFER, we no longer need to do that management. And we don't have to call acpi_get_irq_routing_table() twice (once to learn the size of the buffer needed, and again to actually get the table). Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: remove unnecessary null pointer checksBjorn Helgaas
Better to oops and learn about a bug than to silently cover it up. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: PCI: use conventional PCI address formatBjorn Helgaas
Use the conventional format for PCI addresses (%04x:%02x:%02x.%d). Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-30ACPI: Do not modify SCI_EN directlyRafael J. Wysocki
According to the ACPI specification the SCI_EN flag is controlled by the hardware, which sets this flag to inform the kernel that ACPI is enabled. For this reason, we shouldn't try to modify SCI_EN directly. Also, we don't need to do it in irqrouter_resume(), since lower-level resume code takes care of enabling ACPI in case it hasn't been enabled by the BIOS before passing control to the kernel (which by the way is against the ACPI specification). Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-29ACPICA: Enhance implicit return mechanismLin Ming
For Windows compatibility, return an implicit integer of value zero for methods that have no executable code. A default implicit value of zero is provided for methods. Lin Ming. Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-29ACPICA: Consolidate method arg count validation codeBob Moore
Merge the code that validates control method argument counts into the predefined validation module. Eliminates possible multiple warnings for incorrect counts. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-29ACPICA: Add Buffer->String conversion for predefined methodsBob Moore
For predefined methods (such as _BIF), add automatic conversion for objects that are required to be a String, but a Buffer was found instead. This can happen when reading string battery data from an operation region, because it used to be difficult to convert the data from buffer to string from within the ASL. Linux BZ 11822. http://bugzilla.kernel.org/show_bug.cgi?id=11822 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-29ACPICA: Allow multiple backslash prefix in namepathsLin Ming
In a fully qualified namepath, allow multiple backslash prefixes. This can happen because of the use of a double-backslash in strings (since backslash is the escape character) causing confusion. ACPICA BZ 739 Lin Ming. http://www.acpica.org/bugzilla/show_bug.cgi?id=739 Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-29ACPICA: Fix to allow aliases within ASL namepathsBob Moore
Fixes a problem where the use of an alias within a namepath would result in a not found error or cause the compiler to fault. Also now allows forward references from the Alias operator itself. ACPICA BZ 738. http://www.acpica.org/bugzilla/show_bug.cgi?id=738 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-29ACPICA: Remove references to obsolete ACPI_DUMP_APPBob Moore
This define is no longer used. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>
2008-12-29ACPICA: Add support to externally execute _OSI methodBob Moore
The current implemenation of _OSI within ACPICA only allows other control methods to execute _OSI. This change allows the host OS to execute _OSI via the AcpiEvaluateObject interface. _OSI is a special method -- it does not exist in the AML code, it is implemented within ACPICA. Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lin Ming <ming.m.lin@intel.com> Signed-off-by: Len Brown <len.brown@intel.com>