2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* acpi.h - ACPI Interface
|
|
|
|
*
|
|
|
|
* Copyright (C) 2001 Paul Diefenbaugh <paul.s.diefenbaugh@intel.com>
|
|
|
|
*
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program; if not, write to the Free Software
|
|
|
|
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
|
|
*
|
|
|
|
* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef _LINUX_ACPI_H
|
|
|
|
#define _LINUX_ACPI_H
|
|
|
|
|
2008-02-05 07:31:23 +00:00
|
|
|
#include <linux/ioport.h> /* for struct resource */
|
2005-06-06 22:50:09 +00:00
|
|
|
|
2005-05-27 08:21:50 +00:00
|
|
|
#ifdef CONFIG_ACPI
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
#ifndef _LINUX
|
|
|
|
#define _LINUX
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <linux/list.h>
|
2007-07-23 12:43:51 +00:00
|
|
|
#include <linux/mod_devicetable.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#include <acpi/acpi.h>
|
|
|
|
#include <acpi/acpi_bus.h>
|
|
|
|
#include <acpi/acpi_drivers.h>
|
2006-06-23 09:03:19 +00:00
|
|
|
#include <acpi/acpi_numa.h>
|
2005-04-16 22:20:36 +00:00
|
|
|
#include <asm/acpi.h>
|
|
|
|
|
|
|
|
enum acpi_irq_model_id {
|
|
|
|
ACPI_IRQ_MODEL_PIC = 0,
|
|
|
|
ACPI_IRQ_MODEL_IOAPIC,
|
|
|
|
ACPI_IRQ_MODEL_IOSAPIC,
|
2006-12-22 17:50:04 +00:00
|
|
|
ACPI_IRQ_MODEL_PLATFORM,
|
2005-04-16 22:20:36 +00:00
|
|
|
ACPI_IRQ_MODEL_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
extern enum acpi_irq_model_id acpi_irq_model;
|
|
|
|
|
|
|
|
enum acpi_interrupt_id {
|
|
|
|
ACPI_INTERRUPT_PMI = 1,
|
|
|
|
ACPI_INTERRUPT_INIT,
|
|
|
|
ACPI_INTERRUPT_CPEI,
|
|
|
|
ACPI_INTERRUPT_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
#define ACPI_SPACE_MEM 0
|
|
|
|
|
|
|
|
enum acpi_address_range_id {
|
|
|
|
ACPI_ADDRESS_RANGE_MEMORY = 1,
|
|
|
|
ACPI_ADDRESS_RANGE_RESERVED = 2,
|
|
|
|
ACPI_ADDRESS_RANGE_ACPI = 3,
|
|
|
|
ACPI_ADDRESS_RANGE_NVS = 4,
|
|
|
|
ACPI_ADDRESS_RANGE_COUNT
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Table Handlers */
|
|
|
|
|
2007-02-02 16:48:22 +00:00
|
|
|
typedef int (*acpi_table_handler) (struct acpi_table_header *table);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-02-11 02:35:47 +00:00
|
|
|
typedef int (*acpi_table_entry_handler) (struct acpi_subtable_header *header, const unsigned long end);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
char * __acpi_map_table (unsigned long phys_addr, unsigned long size);
|
2009-02-15 22:06:13 +00:00
|
|
|
void __acpi_unmap_table(char *map, unsigned long size);
|
2008-02-19 11:21:06 +00:00
|
|
|
int early_acpi_boot_init(void);
|
2005-04-16 22:20:36 +00:00
|
|
|
int acpi_boot_init (void);
|
2010-01-06 21:11:06 +00:00
|
|
|
void acpi_boot_table_init (void);
|
2008-06-20 23:11:20 +00:00
|
|
|
int acpi_mps_check (void);
|
2005-04-16 22:20:36 +00:00
|
|
|
int acpi_numa_init (void);
|
|
|
|
|
|
|
|
int acpi_table_init (void);
|
2007-02-02 16:48:22 +00:00
|
|
|
int acpi_table_parse (char *id, acpi_table_handler handler);
|
2007-02-11 03:17:07 +00:00
|
|
|
int __init acpi_table_parse_entries(char *id, unsigned long table_size,
|
|
|
|
int entry_id, acpi_table_entry_handler handler, unsigned int max_entries);
|
2007-02-11 02:35:47 +00:00
|
|
|
int acpi_table_parse_madt (enum acpi_madt_type id, acpi_table_entry_handler handler, unsigned int max_entries);
|
2007-02-02 16:48:22 +00:00
|
|
|
int acpi_parse_mcfg (struct acpi_table_header *header);
|
2007-02-02 16:48:22 +00:00
|
|
|
void acpi_table_print_madt_entry (struct acpi_subtable_header *madt);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
/* the following four functions are architecture-dependent */
|
|
|
|
void acpi_numa_slit_init (struct acpi_table_slit *slit);
|
2007-02-02 16:48:22 +00:00
|
|
|
void acpi_numa_processor_affinity_init (struct acpi_srat_cpu_affinity *pa);
|
2009-03-30 21:55:30 +00:00
|
|
|
void acpi_numa_x2apic_affinity_init(struct acpi_srat_x2apic_cpu_affinity *pa);
|
2007-02-02 16:48:22 +00:00
|
|
|
void acpi_numa_memory_affinity_init (struct acpi_srat_mem_affinity *ma);
|
2005-04-16 22:20:36 +00:00
|
|
|
void acpi_numa_arch_fixup(void);
|
|
|
|
|
|
|
|
#ifdef CONFIG_ACPI_HOTPLUG_CPU
|
|
|
|
/* Arch dependent functions for cpu hotplug support */
|
|
|
|
int acpi_map_lsapic(acpi_handle handle, int *pcpu);
|
|
|
|
int acpi_unmap_lsapic(int cpu);
|
|
|
|
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
|
|
|
|
|
2005-04-28 07:25:58 +00:00
|
|
|
int acpi_register_ioapic(acpi_handle handle, u64 phys_addr, u32 gsi_base);
|
|
|
|
int acpi_unregister_ioapic(acpi_handle handle, u32 gsi_base);
|
2008-02-06 06:26:55 +00:00
|
|
|
void acpi_irq_stats_init(void);
|
|
|
|
extern u32 acpi_irq_handled;
|
2009-04-21 04:35:47 +00:00
|
|
|
extern u32 acpi_irq_not_handled;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2006-02-21 02:27:58 +00:00
|
|
|
extern int sbf_port;
|
2007-07-19 08:47:41 +00:00
|
|
|
extern unsigned long acpi_realmode_flags;
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2009-04-28 01:01:20 +00:00
|
|
|
int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
|
2005-04-16 22:20:36 +00:00
|
|
|
int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
|
2010-03-30 08:07:02 +00:00
|
|
|
int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
2007-11-17 06:05:28 +00:00
|
|
|
#ifdef CONFIG_X86_IO_APIC
|
2010-03-30 08:07:03 +00:00
|
|
|
extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity);
|
2007-11-17 06:05:28 +00:00
|
|
|
#else
|
2010-03-30 08:07:03 +00:00
|
|
|
#define acpi_get_override_irq(gsi, trigger, polarity) (-1)
|
2007-11-17 06:05:28 +00:00
|
|
|
#endif
|
2005-04-16 22:20:36 +00:00
|
|
|
/*
|
|
|
|
* This function undoes the effect of one call to acpi_register_gsi().
|
|
|
|
* If this matches the last registration, any IRQ resources for gsi
|
|
|
|
* are freed.
|
|
|
|
*/
|
|
|
|
void acpi_unregister_gsi (u32 gsi);
|
|
|
|
|
|
|
|
struct pci_dev;
|
|
|
|
|
|
|
|
int acpi_pci_irq_enable (struct pci_dev *dev);
|
2005-04-01 05:07:31 +00:00
|
|
|
void acpi_penalize_isa_irq(int irq, int active);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
void acpi_pci_irq_disable (struct pci_dev *dev);
|
|
|
|
|
|
|
|
struct acpi_pci_driver {
|
|
|
|
struct acpi_pci_driver *next;
|
|
|
|
int (*add)(acpi_handle handle);
|
|
|
|
void (*remove)(acpi_handle handle);
|
|
|
|
};
|
|
|
|
|
|
|
|
int acpi_pci_register_driver(struct acpi_pci_driver *driver);
|
|
|
|
void acpi_pci_unregister_driver(struct acpi_pci_driver *driver);
|
|
|
|
|
|
|
|
extern int ec_read(u8 addr, u8 *val);
|
|
|
|
extern int ec_write(u8 addr, u8 val);
|
2006-09-05 16:12:24 +00:00
|
|
|
extern int ec_transaction(u8 command,
|
|
|
|
const u8 *wdata, unsigned wdata_len,
|
2011-03-31 11:36:38 +00:00
|
|
|
u8 *rdata, unsigned rdata_len);
|
2012-01-18 19:44:08 +00:00
|
|
|
extern acpi_handle ec_get_handle(void);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
ACPI: WMI: Add ACPI-WMI mapping driver
The following is an implementation of the Windows Management
Instrumentation (WMI) ACPI interface mapper (PNP0C14).
What it does:
Parses the _WDG method and exports functions to process WMI method calls,
data block query/ set commands (both based on GUID) and does basic event
handling.
How: WMI presents an in kernel interface here (essentially, a minimal
wrapper around ACPI)
(const char *guid assume the 36 character ASCII representation of
a GUID - e.g. 67C3371D-95A3-4C37-BB61-DD47B491DAAB)
wmi_evaluate_method(const char *guid, u8 instance, u32 method_id,
const struct acpi_buffer *in, struct acpi_buffer *out)
wmi_query_block(const char *guid, u8 instance,
struct acpi_buffer *out)
wmi_set_block(const char *guid, u38 instance,
const struct acpi_buffer *in)
wmi_install_notify_handler(acpi_notify_handler handler);
wmi_remove_notify_handler(void);
wmi_get_event_data(u32 event, struct acpi_buffer *out)
wmi_has_guid(const char guid*)
wmi_has_guid() is a helper function to find if a GUID exists or not on the
system (a quick and easy way for WMI dependant drivers to see if the
the method/ block they want exists, since GUIDs are supposed to be unique).
Event handling - allow a WMI based driver to register a notifier handler
for each GUID with WMI. When a notification is sent to a GUID in WMI, the
handler registered with WMI is then called (it is left to the caller to
ask for the WMI event data associated with the GUID, if needed).
What it won't do:
Unicode - The MS article[1] calls for converting between ASCII and Unicode (or
vice versa) if a GUID is marked as "string". This is left up to the calling
driver.
Handle a MOF[1] - the WMI mapper just exports methods, data and events to
userspace. MOF handling is down to userspace.
Userspace interface - this will be added later.
[1] http://www.microsoft.com/whdc/system/pnppwr/wmi/wmi-acpi.mspx
===
ChangeLog
==
v1 (2007-10-02):
* Initial release
v2 (2007-10-05):
* Cleaned up code - split up super "wmi_evaluate_block" -> each external
symbol now handles its own ACPI calls, rather than handing off to
a "super" method (and in turn, is a lot simpler to read)
* Added a find_guid() symbol - return true if a given GUID exists on
the system
* wmi_* functions now return type acpi_status (since they are just
fancy wrappers around acpi_evaluate_object())
* Removed extra debug code
v3 (2007-10-27)
* More code clean up - now passes checkpatch.pl
* Change data block calls - ref MS spec, method ID is not required for
them, so drop it from the function parameters.
* Const'ify guid in the function call parameters.
* Fix _WDG buffer handling - copy the data to our own private structure.
* Change WMI from tristate to bool - otherwise the external functions are
not exported in linux/acpi.h if you try to build WMI as a module.
* Fix more flag comparisons.
* Add a maintainers entry - since I wrote this, I should take the blame
for it.
v4 (2007-10-30)
* Add missing brace from after fixing checkpatch errors.
* Rewrote event handling - allow external drivers to register with WMI to
handle WMI events
* Clean up flags and sanitise flag handling
v5 (2007-11-03)
* Add sysfs interface for userspace. Export events over netlink again.
* Remove module left overs, fully convert to built-in driver.
* Tweak in-kernel API to use u8 for instance, since this is what the GUID
blocks use (so instance cannot be greater than u8).
* Export wmi_get_event_data() for in kernel WMI drivers.
v6 (2007-11-07)
* Split out userspace into a different patch
v7 (2007-11-20)
* Fix driver to handle multiple PNP0C14 devices - store all GUIDs using
the kernel's built in list functions, and just keep adding to the list
every time we handle a PNP0C14 devices - GUIDs will always be unique,
and WMI callers do not know or care about different devices.
* Change WMI event handler registration to use its' own event handling
struct; we should not pass an acpi_handle down to any WMI based drivers
- they should be able to function with only the calls provided in WMI.
* Update my e-mail address
v8 (2007-11-28)
* Convert back to a module.
* Update Kconfig to default to building as a module.
* Remove an erroneous printk.
* Simply comments for string flag (since we now leave the handling to the
caller).
v9 (2007-12-07)
* Add back missing MODULE_DEVICE_TABLE for autoloading
* Checkpatch fixes
v10 (2007-12-12)
* Workaround broken GUIDs declared expensive without a WCxx method.
* Minor cleanups
v11 (2007-12-17)
* More fixing for broken GUIDs declared expensive without a WCxx method.
* Add basic EmbeddedControl region handling.
v12 (2007-12-18)
* Changed EC region handling code, as per Alexey's comments.
v13 (2007-12-27)
* Changed event handling so that we can have one event handler registered
per GUID, as per Matthew Garrett's suggestion.
v14 (2008-01-12)
* Remove ACPI debug statements
v15 (2008-02-01)
* Replace two remaining 'x == NULL' type tests with '!x'
v16 (2008-02-05)
* Change MAINTAINERS entry, as I am not, and never have been, paid to work
on WMI
* Remove 'default' line from Kconfig
Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
CC: Matthew Garrett <mjg59@srcf.ucam.org>
CC: Alexey Starikovskiy <aystarik@gmail.com>
Signed-off-by: Len Brown <len.brown@intel.com>
2008-02-05 02:17:04 +00:00
|
|
|
#if defined(CONFIG_ACPI_WMI) || defined(CONFIG_ACPI_WMI_MODULE)
|
|
|
|
|
|
|
|
typedef void (*wmi_notify_handler) (u32 value, void *context);
|
|
|
|
|
|
|
|
extern acpi_status wmi_evaluate_method(const char *guid, u8 instance,
|
|
|
|
u32 method_id,
|
|
|
|
const struct acpi_buffer *in,
|
|
|
|
struct acpi_buffer *out);
|
|
|
|
extern acpi_status wmi_query_block(const char *guid, u8 instance,
|
|
|
|
struct acpi_buffer *out);
|
|
|
|
extern acpi_status wmi_set_block(const char *guid, u8 instance,
|
|
|
|
const struct acpi_buffer *in);
|
|
|
|
extern acpi_status wmi_install_notify_handler(const char *guid,
|
|
|
|
wmi_notify_handler handler, void *data);
|
|
|
|
extern acpi_status wmi_remove_notify_handler(const char *guid);
|
|
|
|
extern acpi_status wmi_get_event_data(u32 event, struct acpi_buffer *out);
|
|
|
|
extern bool wmi_has_guid(const char *guid);
|
|
|
|
|
|
|
|
#endif /* CONFIG_ACPI_WMI */
|
|
|
|
|
2008-08-01 15:37:55 +00:00
|
|
|
#define ACPI_VIDEO_OUTPUT_SWITCHING 0x0001
|
|
|
|
#define ACPI_VIDEO_DEVICE_POSTING 0x0002
|
|
|
|
#define ACPI_VIDEO_ROM_AVAILABLE 0x0004
|
|
|
|
#define ACPI_VIDEO_BACKLIGHT 0x0008
|
|
|
|
#define ACPI_VIDEO_BACKLIGHT_FORCE_VENDOR 0x0010
|
|
|
|
#define ACPI_VIDEO_BACKLIGHT_FORCE_VIDEO 0x0020
|
|
|
|
#define ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VENDOR 0x0040
|
|
|
|
#define ACPI_VIDEO_OUTPUT_SWITCHING_FORCE_VIDEO 0x0080
|
|
|
|
#define ACPI_VIDEO_BACKLIGHT_DMI_VENDOR 0x0100
|
|
|
|
#define ACPI_VIDEO_BACKLIGHT_DMI_VIDEO 0x0200
|
|
|
|
#define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VENDOR 0x0400
|
|
|
|
#define ACPI_VIDEO_OUTPUT_SWITCHING_DMI_VIDEO 0x0800
|
|
|
|
|
|
|
|
#if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE)
|
|
|
|
|
|
|
|
extern long acpi_video_get_capabilities(acpi_handle graphics_dev_handle);
|
|
|
|
extern long acpi_is_video_device(struct acpi_device *device);
|
|
|
|
extern int acpi_video_backlight_support(void);
|
|
|
|
extern int acpi_video_display_switch_support(void);
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
static inline long acpi_video_get_capabilities(acpi_handle graphics_dev_handle)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline long acpi_is_video_device(struct acpi_device *device)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int acpi_video_backlight_support(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static inline int acpi_video_display_switch_support(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) */
|
|
|
|
|
2005-04-16 22:20:36 +00:00
|
|
|
extern int acpi_blacklisted(void);
|
2008-01-24 01:50:56 +00:00
|
|
|
extern void acpi_dmi_osi_linux(int enable, const struct dmi_system_id *d);
|
2010-12-09 08:50:52 +00:00
|
|
|
extern void acpi_osi_setup(char *str);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
#ifdef CONFIG_ACPI_NUMA
|
|
|
|
int acpi_get_pxm(acpi_handle handle);
|
2006-06-27 09:53:31 +00:00
|
|
|
int acpi_get_node(acpi_handle *handle);
|
2005-04-16 22:20:36 +00:00
|
|
|
#else
|
|
|
|
static inline int acpi_get_pxm(acpi_handle handle)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2006-06-27 09:53:31 +00:00
|
|
|
static inline int acpi_get_node(acpi_handle *handle)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2005-04-16 22:20:36 +00:00
|
|
|
#endif
|
2006-06-27 09:53:31 +00:00
|
|
|
extern int acpi_paddr_to_node(u64 start_addr, u64 size);
|
2005-04-16 22:20:36 +00:00
|
|
|
|
|
|
|
extern int pnpacpi_disabled;
|
|
|
|
|
2007-07-21 15:10:32 +00:00
|
|
|
#define PXM_INVAL (-1)
|
|
|
|
|
2009-11-11 14:22:15 +00:00
|
|
|
int acpi_check_resource_conflict(const struct resource *res);
|
2008-02-05 07:31:23 +00:00
|
|
|
|
2008-02-05 07:31:22 +00:00
|
|
|
int acpi_check_region(resource_size_t start, resource_size_t n,
|
|
|
|
const char *name);
|
|
|
|
|
2010-05-27 17:58:37 +00:00
|
|
|
int acpi_resources_are_enforced(void);
|
|
|
|
|
2008-06-12 21:24:06 +00:00
|
|
|
#ifdef CONFIG_PM_SLEEP
|
2008-07-24 04:28:41 +00:00
|
|
|
void __init acpi_no_s4_hw_signature(void);
|
2008-06-12 21:24:06 +00:00
|
|
|
void __init acpi_old_suspend_ordering(void);
|
2010-07-23 20:59:09 +00:00
|
|
|
void __init acpi_nvs_nosave(void);
|
2008-06-12 21:24:06 +00:00
|
|
|
#endif /* CONFIG_PM_SLEEP */
|
2009-02-09 07:00:04 +00:00
|
|
|
|
2009-10-29 03:04:28 +00:00
|
|
|
struct acpi_osc_context {
|
|
|
|
char *uuid_str; /* uuid string */
|
|
|
|
int rev;
|
|
|
|
struct acpi_buffer cap; /* arg2/arg3 */
|
|
|
|
struct acpi_buffer ret; /* free by caller if success */
|
|
|
|
};
|
|
|
|
|
2009-02-09 07:00:04 +00:00
|
|
|
#define OSC_QUERY_TYPE 0
|
|
|
|
#define OSC_SUPPORT_TYPE 1
|
|
|
|
#define OSC_CONTROL_TYPE 2
|
|
|
|
|
|
|
|
/* _OSC DW0 Definition */
|
|
|
|
#define OSC_QUERY_ENABLE 1
|
|
|
|
#define OSC_REQUEST_ERROR 2
|
|
|
|
#define OSC_INVALID_UUID_ERROR 4
|
|
|
|
#define OSC_INVALID_REVISION_ERROR 8
|
|
|
|
#define OSC_CAPABILITIES_MASK_ERROR 16
|
|
|
|
|
2009-10-29 03:04:28 +00:00
|
|
|
acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
|
|
|
|
|
2009-10-29 03:05:05 +00:00
|
|
|
/* platform-wide _OSC bits */
|
|
|
|
#define OSC_SB_PAD_SUPPORT 1
|
|
|
|
#define OSC_SB_PPC_OST_SUPPORT 2
|
|
|
|
#define OSC_SB_PR3_SUPPORT 4
|
|
|
|
#define OSC_SB_CPUHP_OST_SUPPORT 8
|
|
|
|
#define OSC_SB_APEI_SUPPORT 16
|
|
|
|
|
2011-07-13 05:14:20 +00:00
|
|
|
extern bool osc_sb_apei_support_acked;
|
|
|
|
|
2009-10-29 03:04:50 +00:00
|
|
|
/* PCI defined _OSC bits */
|
2009-02-09 07:00:04 +00:00
|
|
|
/* _OSC DW1 Definition (OS Support Fields) */
|
|
|
|
#define OSC_EXT_PCI_CONFIG_SUPPORT 1
|
|
|
|
#define OSC_ACTIVE_STATE_PWR_SUPPORT 2
|
|
|
|
#define OSC_CLOCK_PWR_CAPABILITY_SUPPORT 4
|
|
|
|
#define OSC_PCI_SEGMENT_GROUPS_SUPPORT 8
|
|
|
|
#define OSC_MSI_SUPPORT 16
|
2009-10-29 03:04:50 +00:00
|
|
|
#define OSC_PCI_SUPPORT_MASKS 0x1f
|
2009-02-09 07:00:04 +00:00
|
|
|
|
|
|
|
/* _OSC DW1 Definition (OS Control Fields) */
|
|
|
|
#define OSC_PCI_EXPRESS_NATIVE_HP_CONTROL 1
|
|
|
|
#define OSC_SHPC_NATIVE_HP_CONTROL 2
|
|
|
|
#define OSC_PCI_EXPRESS_PME_CONTROL 4
|
|
|
|
#define OSC_PCI_EXPRESS_AER_CONTROL 8
|
|
|
|
#define OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL 16
|
|
|
|
|
2009-10-29 03:04:50 +00:00
|
|
|
#define OSC_PCI_CONTROL_MASKS (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \
|
2009-02-09 07:00:04 +00:00
|
|
|
OSC_SHPC_NATIVE_HP_CONTROL | \
|
|
|
|
OSC_PCI_EXPRESS_PME_CONTROL | \
|
|
|
|
OSC_PCI_EXPRESS_AER_CONTROL | \
|
|
|
|
OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL)
|
2011-11-06 22:11:28 +00:00
|
|
|
|
|
|
|
#define OSC_PCI_NATIVE_HOTPLUG (OSC_PCI_EXPRESS_NATIVE_HP_CONTROL | \
|
|
|
|
OSC_SHPC_NATIVE_HP_CONTROL)
|
|
|
|
|
2010-08-23 21:53:11 +00:00
|
|
|
extern acpi_status acpi_pci_osc_control_set(acpi_handle handle,
|
|
|
|
u32 *mask, u32 req);
|
2009-06-13 00:42:08 +00:00
|
|
|
extern void acpi_early_init(void);
|
|
|
|
|
2011-12-08 03:25:49 +00:00
|
|
|
extern int acpi_nvs_register(__u64 start, __u64 size);
|
|
|
|
|
|
|
|
extern int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
|
|
|
|
void *data);
|
|
|
|
|
2009-07-28 09:41:53 +00:00
|
|
|
#else /* !CONFIG_ACPI */
|
|
|
|
|
|
|
|
#define acpi_disabled 1
|
|
|
|
|
2009-06-13 00:42:08 +00:00
|
|
|
static inline void acpi_early_init(void) { }
|
2005-07-30 08:18:00 +00:00
|
|
|
|
2008-02-19 11:21:06 +00:00
|
|
|
static inline int early_acpi_boot_init(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2005-07-30 08:18:00 +00:00
|
|
|
static inline int acpi_boot_init(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2010-01-06 21:11:06 +00:00
|
|
|
static inline void acpi_boot_table_init(void)
|
2005-07-30 08:18:00 +00:00
|
|
|
{
|
2010-01-06 21:11:06 +00:00
|
|
|
return;
|
2005-07-30 08:18:00 +00:00
|
|
|
}
|
|
|
|
|
2008-06-20 23:11:20 +00:00
|
|
|
static inline int acpi_mps_check(void)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-02-05 07:31:23 +00:00
|
|
|
static inline int acpi_check_resource_conflict(struct resource *res)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2008-02-05 07:31:22 +00:00
|
|
|
static inline int acpi_check_region(resource_size_t start, resource_size_t n,
|
|
|
|
const char *name)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2009-07-28 09:41:53 +00:00
|
|
|
struct acpi_table_header;
|
|
|
|
static inline int acpi_table_parse(char *id,
|
|
|
|
int (*handler)(struct acpi_table_header *))
|
|
|
|
{
|
|
|
|
return -1;
|
|
|
|
}
|
2011-01-12 21:03:20 +00:00
|
|
|
|
2011-12-08 03:25:49 +00:00
|
|
|
static inline int acpi_nvs_register(__u64 start, __u64 size)
|
2011-01-12 21:03:20 +00:00
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
2011-12-08 03:25:49 +00:00
|
|
|
|
|
|
|
static inline int acpi_nvs_for_each_region(int (*func)(__u64, __u64, void *),
|
|
|
|
void *data)
|
|
|
|
{
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif /* !CONFIG_ACPI */
|
2011-01-12 21:03:20 +00:00
|
|
|
|
2011-12-09 02:05:54 +00:00
|
|
|
#ifdef CONFIG_ACPI
|
|
|
|
void acpi_os_set_prepare_sleep(int (*func)(u8 sleep_state,
|
|
|
|
u32 pm1a_ctrl, u32 pm1b_ctrl));
|
|
|
|
|
|
|
|
acpi_status acpi_os_prepare_sleep(u8 sleep_state,
|
|
|
|
u32 pm1a_control, u32 pm1b_control);
|
|
|
|
#else
|
|
|
|
#define acpi_os_set_prepare_sleep(func, pm1a_ctrl, pm1b_ctrl) do { } while (0)
|
|
|
|
#endif
|
|
|
|
|
2005-05-27 08:21:50 +00:00
|
|
|
#endif /*_LINUX_ACPI_H*/
|