Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
power.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/slab.h>
#include <linux/pm_runtime.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include "sleep.h"
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  acpi_power_managed_device
 
struct  acpi_power_resource_device
 
struct  acpi_power_resource
 

Macros

#define PREFIX   "ACPI: "
 
#define _COMPONENT   ACPI_POWER_COMPONENT
 
#define ACPI_POWER_CLASS   "power_resource"
 
#define ACPI_POWER_DEVICE_NAME   "Power Resource"
 
#define ACPI_POWER_FILE_INFO   "info"
 
#define ACPI_POWER_FILE_STATUS   "state"
 
#define ACPI_POWER_RESOURCE_STATE_OFF   0x00
 
#define ACPI_POWER_RESOURCE_STATE_ON   0x01
 
#define ACPI_POWER_RESOURCE_STATE_UNKNOWN   0xFF
 

Functions

 ACPI_MODULE_NAME ("power")
 
 MODULE_DEVICE_TABLE (acpi, power_device_ids)
 
void acpi_power_resource_unregister_device (struct device *dev, acpi_handle handle)
 
 EXPORT_SYMBOL_GPL (acpi_power_resource_unregister_device)
 
int acpi_power_resource_register_device (struct device *dev, acpi_handle handle)
 
 EXPORT_SYMBOL_GPL (acpi_power_resource_register_device)
 
int acpi_device_sleep_wake (struct acpi_device *dev, int enable, int sleep_state, int dev_state)
 
int acpi_enable_wakeup_device_power (struct acpi_device *dev, int sleep_state)
 
int acpi_disable_wakeup_device_power (struct acpi_device *dev)
 
int acpi_power_get_inferred_state (struct acpi_device *device, int *state)
 
int acpi_power_on_resources (struct acpi_device *device, int state)
 
int acpi_power_transition (struct acpi_device *device, int state)
 
int __init acpi_power_init (void)
 

Macro Definition Documentation

#define _COMPONENT   ACPI_POWER_COMPONENT

Definition at line 51 of file power.c.

#define ACPI_POWER_CLASS   "power_resource"

Definition at line 53 of file power.c.

#define ACPI_POWER_DEVICE_NAME   "Power Resource"

Definition at line 54 of file power.c.

#define ACPI_POWER_FILE_INFO   "info"

Definition at line 55 of file power.c.

#define ACPI_POWER_FILE_STATUS   "state"

Definition at line 56 of file power.c.

#define ACPI_POWER_RESOURCE_STATE_OFF   0x00

Definition at line 57 of file power.c.

#define ACPI_POWER_RESOURCE_STATE_ON   0x01

Definition at line 58 of file power.c.

#define ACPI_POWER_RESOURCE_STATE_UNKNOWN   0xFF

Definition at line 59 of file power.c.

#define PREFIX   "ACPI: "

Definition at line 49 of file power.c.

Function Documentation

int acpi_device_sleep_wake ( struct acpi_device *  dev,
int  enable,
int  sleep_state,
int  dev_state 
)

acpi_device_sleep_wake - execute _DSW (Device Sleep Wake) or (deprecated in ACPI 3.0) _PSW (Power State Wake) : Device to handle. : 0 - disable, 1 - enable the wake capabilities of the device. : Target sleep state of the system. : Target power state of the device.

Execute _DSW (Device Sleep Wake) or (deprecated in ACPI 3.0) _PSW (Power State Wake) for the device, if present. On failure reset the device's wakeup.flags.valid flag.

RETURN VALUE: 0 if either _DSW or _PSW has been successfully executed 0 if neither _DSW nor _PSW has been found -ENODEV if the execution of either _DSW or _PSW has failed

Definition at line 498 of file power.c.

int acpi_disable_wakeup_device_power ( struct acpi_device *  dev)

Definition at line 594 of file power.c.

int acpi_enable_wakeup_device_power ( struct acpi_device *  dev,
int  sleep_state 
)

Definition at line 550 of file power.c.

ACPI_MODULE_NAME ( "power"  )
int acpi_power_get_inferred_state ( struct acpi_device *  device,
int state 
)

Definition at line 637 of file power.c.

int __init acpi_power_init ( void  )

Definition at line 823 of file power.c.

int acpi_power_on_resources ( struct acpi_device *  device,
int  state 
)

Definition at line 670 of file power.c.

int acpi_power_resource_register_device ( struct device dev,
acpi_handle  handle 
)

Definition at line 437 of file power.c.

void acpi_power_resource_unregister_device ( struct device dev,
acpi_handle  handle 
)

Definition at line 390 of file power.c.

int acpi_power_transition ( struct acpi_device *  device,
int  state 
)

Definition at line 678 of file power.c.

EXPORT_SYMBOL_GPL ( acpi_power_resource_unregister_device  )
EXPORT_SYMBOL_GPL ( acpi_power_resource_register_device  )
MODULE_DEVICE_TABLE ( acpi  ,
power_device_ids   
)