Skip to content

Commit

Permalink
Merge branch 'acpi-lpss' into acpi-cleanup
Browse files Browse the repository at this point in the history
The following commits depend on the 'acpi-lpss' material.
  • Loading branch information
Rafael J. Wysocki committed Jan 29, 2013
2 parents 64e94e7 + e375325 commit 8b4e2fa
Show file tree
Hide file tree
Showing 129 changed files with 5,186 additions and 4,089 deletions.
4 changes: 0 additions & 4 deletions arch/ia64/include/asm/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@

/* Asm macros */

#define ACPI_ASM_MACROS
#define BREAKPOINT3
#define ACPI_DISABLE_IRQS() local_irq_disable()
#define ACPI_ENABLE_IRQS() local_irq_enable()
#define ACPI_FLUSH_CPU_CACHE()

static inline int
Expand Down
10 changes: 10 additions & 0 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -454,6 +454,16 @@ config X86_MDFLD

endif

config X86_INTEL_LPSS
bool "Intel Low Power Subsystem Support"
depends on ACPI
select COMMON_CLK
---help---
Select to build support for Intel Low Power Subsystem such as
found on Intel Lynxpoint PCH. Selecting this option enables
things like clock tree (common clock framework) which are needed
by the LPSS peripheral drivers.

config X86_RDC321X
bool "RDC R-321x SoC"
depends on X86_32
Expand Down
4 changes: 0 additions & 4 deletions arch/x86/include/asm/acpi.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@

/* Asm macros */

#define ACPI_ASM_MACROS
#define BREAKPOINT3
#define ACPI_DISABLE_IRQS() local_irq_disable()
#define ACPI_ENABLE_IRQS() local_irq_enable()
#define ACPI_FLUSH_CPU_CACHE() wbinvd()

int __acpi_acquire_global_lock(unsigned int *lock);
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ acpi-y += processor_core.o
acpi-y += ec.o
acpi-$(CONFIG_ACPI_DOCK) += dock.o
acpi-y += pci_root.o pci_link.o pci_irq.o
acpi-y += csrt.o
acpi-y += acpi_platform.o
acpi-y += power.o
acpi-y += event.o
Expand Down
27 changes: 25 additions & 2 deletions drivers/acpi/acpi_platform.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

#include <linux/acpi.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/platform_device.h>
Expand All @@ -21,17 +22,34 @@

ACPI_MODULE_NAME("platform");

static int acpi_create_platform_clks(struct acpi_device *adev)
{
static struct platform_device *pdev;

/* Create Lynxpoint LPSS clocks */
if (!pdev && !strncmp(acpi_device_hid(adev), "INT33C", 6)) {
pdev = platform_device_register_simple("clk-lpt", -1, NULL, 0);
if (IS_ERR(pdev))
return PTR_ERR(pdev);
}

return 0;
}

/**
* acpi_create_platform_device - Create platform device for ACPI device node
* @adev: ACPI device node to create a platform device for.
* @flags: ACPI_PLATFORM_* flags that affect the creation of the platform
* devices.
*
* Check if the given @adev can be represented as a platform device and, if
* that's the case, create and register a platform device, populate its common
* resources and returns a pointer to it. Otherwise, return %NULL.
*
* The platform device's name will be taken from the @adev's _HID and _UID.
* Name of the platform device will be the same as @adev's.
*/
struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
struct platform_device *acpi_create_platform_device(struct acpi_device *adev,
unsigned long flags)
{
struct platform_device *pdev = NULL;
struct acpi_device *acpi_parent;
Expand All @@ -41,6 +59,11 @@ struct platform_device *acpi_create_platform_device(struct acpi_device *adev)
struct resource *resources;
int count;

if ((flags & ACPI_PLATFORM_CLK) && acpi_create_platform_clks(adev)) {
dev_err(&adev->dev, "failed to create clocks\n");
return NULL;
}

/* If the ACPI node already has a physical device attached, skip it. */
if (adev->physical_node_count)
return NULL;
Expand Down
8 changes: 7 additions & 1 deletion drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ acpi-y += \
evgpeinit.o \
evgpeutil.o \
evglock.o \
evhandler.o \
evmisc.o \
evregion.o \
evrgnini.o \
Expand Down Expand Up @@ -90,6 +91,7 @@ acpi-y += \
nsobject.o \
nsparse.o \
nspredef.o \
nsprepkg.o \
nsrepair.o \
nsrepair2.o \
nssearch.o \
Expand All @@ -104,7 +106,9 @@ acpi-$(ACPI_FUTURE_USAGE) += nsdumpdv.o
acpi-y += \
psargs.o \
psloop.o \
psobject.o \
psopcode.o \
psopinfo.o \
psparse.o \
psscope.o \
pstree.o \
Expand All @@ -126,7 +130,7 @@ acpi-y += \
rsutils.o \
rsxface.o

acpi-$(ACPI_FUTURE_USAGE) += rsdump.o
acpi-$(ACPI_FUTURE_USAGE) += rsdump.o rsdumpinfo.o

acpi-y += \
tbfadt.o \
Expand Down Expand Up @@ -155,8 +159,10 @@ acpi-y += \
utmutex.o \
utobject.o \
utosi.o \
utownerid.o \
utresrc.o \
utstate.o \
utstring.o \
utxface.o \
utxfinit.o \
utxferror.o \
Expand Down
1 change: 1 addition & 0 deletions drivers/acpi/acpica/accommon.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@
*
* Note: The order of these include files is important.
*/
#include <acpi/acconfig.h> /* Global configuration constants */
#include "acmacros.h" /* C macros */
#include "aclocal.h" /* Internal data types */
#include "acobject.h" /* ACPI internal object */
Expand Down
17 changes: 17 additions & 0 deletions drivers/acpi/acpica/acdebug.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,21 @@ ACPI_HW_DEPENDENT_RETURN_VOID(void
acpi_db_generate_gpe(char *gpe_arg,
char *block_arg))

/*
* dbconvert - miscellaneous conversion routines
*/
acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value);

acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object);

acpi_status
acpi_db_convert_to_object(acpi_object_type type,
char *string, union acpi_object *object);

u8 *acpi_db_encode_pld_buffer(struct acpi_pld_info *pld_info);

void acpi_db_dump_pld_buffer(union acpi_object *obj_desc);

/*
* dbmethod - control method commands
*/
Expand Down Expand Up @@ -191,6 +206,8 @@ void
acpi_db_create_execution_threads(char *num_threads_arg,
char *num_loops_arg, char *method_name_arg);

void acpi_db_delete_objects(u32 count, union acpi_object *objects);

#ifdef ACPI_DBG_TRACK_ALLOCATIONS
u32 acpi_db_get_cache_info(struct acpi_memory_list *cache);
#endif
Expand Down
21 changes: 14 additions & 7 deletions drivers/acpi/acpica/acevents.h
Original file line number Diff line number Diff line change
Expand Up @@ -158,10 +158,23 @@ acpi_ev_delete_gpe_handlers(struct acpi_gpe_xrupt_info *gpe_xrupt_info,
void *context);

/*
* evregion - Address Space handling
* evhandler - Address space handling
*/
u8
acpi_ev_has_default_handler(struct acpi_namespace_node *node,
acpi_adr_space_type space_id);

acpi_status acpi_ev_install_region_handlers(void);

acpi_status
acpi_ev_install_space_handler(struct acpi_namespace_node *node,
acpi_adr_space_type space_id,
acpi_adr_space_handler handler,
acpi_adr_space_setup setup, void *context);

/*
* evregion - Operation region support
*/
acpi_status acpi_ev_initialize_op_regions(void);

acpi_status
Expand All @@ -179,12 +192,6 @@ void
acpi_ev_detach_region(union acpi_operand_object *region_obj,
u8 acpi_ns_is_locked);

acpi_status
acpi_ev_install_space_handler(struct acpi_namespace_node *node,
acpi_adr_space_type space_id,
acpi_adr_space_handler handler,
acpi_adr_space_setup setup, void *context);

acpi_status
acpi_ev_execute_reg_methods(struct acpi_namespace_node *node,
acpi_adr_space_type space_id);
Expand Down
37 changes: 20 additions & 17 deletions drivers/acpi/acpica/acglobal.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,6 @@ ACPI_EXTERN u8 acpi_gbl_integer_bit_width;
ACPI_EXTERN u8 acpi_gbl_integer_byte_width;
ACPI_EXTERN u8 acpi_gbl_integer_nybble_width;

/* Mutex for _OSI support */

ACPI_EXTERN acpi_mutex acpi_gbl_osi_mutex;

/* Reader/Writer lock is used for namespace walk and dynamic table unload */

ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;

/*****************************************************************************
*
* Mutual exclusion within ACPICA subsystem
Expand Down Expand Up @@ -233,6 +225,14 @@ ACPI_EXTERN u8 acpi_gbl_global_lock_pending;
ACPI_EXTERN acpi_spinlock acpi_gbl_gpe_lock; /* For GPE data structs and registers */
ACPI_EXTERN acpi_spinlock acpi_gbl_hardware_lock; /* For ACPI H/W except GPE registers */

/* Mutex for _OSI support */

ACPI_EXTERN acpi_mutex acpi_gbl_osi_mutex;

/* Reader/Writer lock is used for namespace walk and dynamic table unload */

ACPI_EXTERN struct acpi_rw_lock acpi_gbl_namespace_rw_lock;

/*****************************************************************************
*
* Miscellaneous globals
Expand All @@ -252,7 +252,7 @@ ACPI_EXTERN acpi_cache_t *acpi_gbl_operand_cache;
ACPI_EXTERN struct acpi_global_notify_handler acpi_gbl_global_notify[2];
ACPI_EXTERN acpi_exception_handler acpi_gbl_exception_handler;
ACPI_EXTERN acpi_init_handler acpi_gbl_init_handler;
ACPI_EXTERN acpi_tbl_handler acpi_gbl_table_handler;
ACPI_EXTERN acpi_table_handler acpi_gbl_table_handler;
ACPI_EXTERN void *acpi_gbl_table_handler_context;
ACPI_EXTERN struct acpi_walk_state *acpi_gbl_breakpoint_walk;
ACPI_EXTERN acpi_interface_handler acpi_gbl_interface_handler;
Expand Down Expand Up @@ -304,6 +304,7 @@ extern const char *acpi_gbl_region_types[ACPI_NUM_PREDEFINED_REGIONS];
ACPI_EXTERN struct acpi_memory_list *acpi_gbl_global_list;
ACPI_EXTERN struct acpi_memory_list *acpi_gbl_ns_node_list;
ACPI_EXTERN u8 acpi_gbl_display_final_mem_stats;
ACPI_EXTERN u8 acpi_gbl_disable_mem_tracking;
#endif

/*****************************************************************************
Expand Down Expand Up @@ -365,19 +366,18 @@ ACPI_EXTERN u8 acpi_gbl_sleep_type_b;
*
****************************************************************************/

extern struct acpi_fixed_event_info
acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];
ACPI_EXTERN struct acpi_fixed_event_handler
acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
ACPI_EXTERN struct acpi_gpe_block_info
*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];

#if (!ACPI_REDUCED_HARDWARE)

ACPI_EXTERN u8 acpi_gbl_all_gpes_initialized;
ACPI_EXTERN struct acpi_gpe_xrupt_info *acpi_gbl_gpe_xrupt_list_head;
ACPI_EXTERN struct acpi_gpe_block_info
*acpi_gbl_gpe_fadt_blocks[ACPI_MAX_GPE_BLOCKS];
ACPI_EXTERN acpi_gbl_event_handler acpi_gbl_global_event_handler;
ACPI_EXTERN void *acpi_gbl_global_event_handler_context;
ACPI_EXTERN struct acpi_fixed_event_handler
acpi_gbl_fixed_event_handlers[ACPI_NUM_FIXED_EVENTS];
extern struct acpi_fixed_event_info
acpi_gbl_fixed_event_info[ACPI_NUM_FIXED_EVENTS];

#endif /* !ACPI_REDUCED_HARDWARE */

Expand Down Expand Up @@ -415,6 +415,8 @@ ACPI_EXTERN u8 acpi_gbl_db_output_flags;

ACPI_EXTERN u8 acpi_gbl_db_opt_disasm;
ACPI_EXTERN u8 acpi_gbl_db_opt_verbose;
ACPI_EXTERN struct acpi_external_list *acpi_gbl_external_list;
ACPI_EXTERN struct acpi_external_file *acpi_gbl_external_file_list;
#endif

#ifdef ACPI_DEBUGGER
Expand All @@ -426,6 +428,7 @@ extern u8 acpi_gbl_db_terminate_threads;
ACPI_EXTERN u8 acpi_gbl_db_opt_tables;
ACPI_EXTERN u8 acpi_gbl_db_opt_stats;
ACPI_EXTERN u8 acpi_gbl_db_opt_ini_methods;
ACPI_EXTERN u8 acpi_gbl_db_opt_no_region_support;

ACPI_EXTERN char *acpi_gbl_db_args[ACPI_DEBUGGER_MAX_ARGS];
ACPI_EXTERN acpi_object_type acpi_gbl_db_arg_types[ACPI_DEBUGGER_MAX_ARGS];
Expand Down
2 changes: 1 addition & 1 deletion drivers/acpi/acpica/acinterp.h
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ void acpi_ex_reacquire_interpreter(void);

void acpi_ex_relinquish_interpreter(void);

void acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);
u8 acpi_ex_truncate_for32bit_table(union acpi_operand_object *obj_desc);

void acpi_ex_acquire_global_lock(u32 rule);

Expand Down
45 changes: 35 additions & 10 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -189,11 +189,10 @@ struct acpi_namespace_node {
#define ANOBJ_EVALUATED 0x20 /* Set on first evaluation of node */
#define ANOBJ_ALLOCATED_BUFFER 0x40 /* Method AML buffer is dynamic (install_method) */

#define ANOBJ_IS_EXTERNAL 0x08 /* i_aSL only: This object created via External() */
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* i_aSL only: Method has no return value */
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* i_aSL only: Method has at least one return value */
#define ANOBJ_IS_BIT_OFFSET 0x40 /* i_aSL only: Reference is a bit offset */
#define ANOBJ_IS_REFERENCED 0x80 /* i_aSL only: Object was referenced */
#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
#define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */

/* Internal ACPI table management - master table list */

Expand Down Expand Up @@ -411,11 +410,10 @@ struct acpi_gpe_notify_info {
struct acpi_gpe_notify_info *next;
};

struct acpi_gpe_notify_object {
struct acpi_namespace_node *node;
struct acpi_gpe_notify_object *next;
};

/*
* GPE dispatch info. At any time, the GPE can have at most one type
* of dispatch - Method, Handler, or Implicit Notify.
*/
union acpi_gpe_dispatch_info {
struct acpi_namespace_node *method_node; /* Method node for this GPE level */
struct acpi_gpe_handler_info *handler; /* Installed GPE handler */
Expand Down Expand Up @@ -679,6 +677,8 @@ struct acpi_opcode_info {
u8 type; /* Opcode type */
};

/* Value associated with the parse object */

union acpi_parse_value {
u64 integer; /* Integer constant (Up to 64 bits) */
u32 size; /* bytelist or field size */
Expand Down Expand Up @@ -1023,6 +1023,31 @@ struct acpi_port_info {

#define ACPI_ASCII_ZERO 0x30

/*****************************************************************************
*
* Disassembler
*
****************************************************************************/

struct acpi_external_list {
char *path;
char *internal_path;
struct acpi_external_list *next;
u32 value;
u16 length;
u8 type;
u8 flags;
};

/* Values for Flags field above */

#define ACPI_IPATH_ALLOCATED 0x01

struct acpi_external_file {
char *path;
struct acpi_external_file *next;
};

/*****************************************************************************
*
* Debugger
Expand Down
Loading

0 comments on commit 8b4e2fa

Please sign in to comment.