Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
ec.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/list.h>
#include <linux/spinlock.h>
#include <linux/slab.h>
#include <asm/io.h>
#include <acpi/acpi_bus.h>
#include <acpi/acpi_drivers.h>
#include <linux/dmi.h>
#include "internal.h"

Go to the source code of this file.

Data Structures

struct  acpi_ec_query_handler
 
struct  transaction
 

Macros

#define ACPI_EC_CLASS   "embedded_controller"
 
#define ACPI_EC_DEVICE_NAME   "Embedded Controller"
 
#define ACPI_EC_FILE_INFO   "info"
 
#define PREFIX   "ACPI: EC: "
 
#define ACPI_EC_FLAG_OBF   0x01 /* Output buffer full */
 
#define ACPI_EC_FLAG_IBF   0x02 /* Input buffer full */
 
#define ACPI_EC_FLAG_BURST   0x10 /* burst mode */
 
#define ACPI_EC_FLAG_SCI   0x20 /* EC-SCI occurred */
 
#define ACPI_EC_DELAY   500 /* Wait 500ms max. during EC ops */
 
#define ACPI_EC_UDELAY_GLK   1000 /* Wait 1ms max. to get global lock */
 
#define ACPI_EC_MSI_UDELAY   550 /* Wait 550us for MSI EC */
 

Typedefs

typedef int(* acpi_ec_query_func )(void *data)
 

Enumerations

enum  ec_command {
  ACPI_EC_COMMAND_READ = 0x80, ACPI_EC_COMMAND_WRITE = 0x81, ACPI_EC_BURST_ENABLE = 0x82, ACPI_EC_BURST_DISABLE = 0x83,
  ACPI_EC_COMMAND_QUERY = 0x84
}
 
enum  { EC_FLAGS_QUERY_PENDING, EC_FLAGS_GPE_STORM, EC_FLAGS_HANDLERS_INSTALLED, EC_FLAGS_BLOCKED }
 

Functions

 module_param (ec_delay, uint, 0644)
 
 MODULE_PARM_DESC (ec_delay,"Timeout(ms) waited until an EC command completes")
 
 module_param (ec_storm_threshold, uint, 0644)
 
 MODULE_PARM_DESC (ec_storm_threshold,"Maxim false GPE numbers not considered as GPE storm")
 
 EXPORT_SYMBOL (first_ec)
 
int ec_burst_enable (void)
 
 EXPORT_SYMBOL (ec_burst_enable)
 
int ec_burst_disable (void)
 
 EXPORT_SYMBOL (ec_burst_disable)
 
int ec_read (u8 addr, u8 *val)
 
 EXPORT_SYMBOL (ec_read)
 
int ec_write (u8 addr, u8 val)
 
 EXPORT_SYMBOL (ec_write)
 
int ec_transaction (u8 command, const u8 *wdata, unsigned wdata_len, u8 *rdata, unsigned rdata_len)
 
 EXPORT_SYMBOL (ec_transaction)
 
acpi_handle ec_get_handle (void)
 
 EXPORT_SYMBOL (ec_get_handle)
 
void acpi_ec_block_transactions (void)
 
void acpi_ec_unblock_transactions (void)
 
void acpi_ec_unblock_transactions_early (void)
 
int acpi_ec_add_query_handler (struct acpi_ec *ec, u8 query_bit, acpi_handle handle, acpi_ec_query_func func, void *data)
 
 EXPORT_SYMBOL_GPL (acpi_ec_add_query_handler)
 
void acpi_ec_remove_query_handler (struct acpi_ec *ec, u8 query_bit)
 
 EXPORT_SYMBOL_GPL (acpi_ec_remove_query_handler)
 
int __init acpi_boot_ec_enable (void)
 
int __init acpi_ec_ecdt_probe (void)
 
int __init acpi_ec_init (void)
 

Variables

struct acpi_ecboot_ec
 
struct acpi_ecfirst_ec
 

Macro Definition Documentation

#define ACPI_EC_CLASS   "embedded_controller"

Definition at line 48 of file ec.c.

#define ACPI_EC_DELAY   500 /* Wait 500ms max. during EC ops */

Definition at line 70 of file ec.c.

#define ACPI_EC_DEVICE_NAME   "Embedded Controller"

Definition at line 49 of file ec.c.

#define ACPI_EC_FILE_INFO   "info"

Definition at line 50 of file ec.c.

#define ACPI_EC_FLAG_BURST   0x10 /* burst mode */

Definition at line 58 of file ec.c.

#define ACPI_EC_FLAG_IBF   0x02 /* Input buffer full */

Definition at line 57 of file ec.c.

#define ACPI_EC_FLAG_OBF   0x01 /* Output buffer full */

Definition at line 56 of file ec.c.

#define ACPI_EC_FLAG_SCI   0x20 /* EC-SCI occurred */

Definition at line 59 of file ec.c.

#define ACPI_EC_MSI_UDELAY   550 /* Wait 550us for MSI EC */

Definition at line 72 of file ec.c.

#define ACPI_EC_UDELAY_GLK   1000 /* Wait 1ms max. to get global lock */

Definition at line 71 of file ec.c.

#define PREFIX   "ACPI: EC: "

Definition at line 53 of file ec.c.

Typedef Documentation

typedef int(* acpi_ec_query_func)(void *data)

Definition at line 98 of file ec.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
EC_FLAGS_QUERY_PENDING 
EC_FLAGS_GPE_STORM 
EC_FLAGS_HANDLERS_INSTALLED 
EC_FLAGS_BLOCKED 

Definition at line 74 of file ec.c.

enum ec_command
Enumerator:
ACPI_EC_COMMAND_READ 
ACPI_EC_COMMAND_WRITE 
ACPI_EC_BURST_ENABLE 
ACPI_EC_BURST_DISABLE 
ACPI_EC_COMMAND_QUERY 

Definition at line 62 of file ec.c.

Function Documentation

int __init acpi_boot_ec_enable ( void  )

Definition at line 894 of file ec.c.

int acpi_ec_add_query_handler ( struct acpi_ec ec,
u8  query_bit,
acpi_handle  handle,
acpi_ec_query_func  func,
void data 
)

Definition at line 526 of file ec.c.

void acpi_ec_block_transactions ( void  )

Definition at line 464 of file ec.c.

int __init acpi_ec_ecdt_probe ( void  )

Definition at line 982 of file ec.c.

int __init acpi_ec_init ( void  )

Definition at line 1068 of file ec.c.

void acpi_ec_remove_query_handler ( struct acpi_ec ec,
u8  query_bit 
)

Definition at line 547 of file ec.c.

void acpi_ec_unblock_transactions ( void  )

Definition at line 477 of file ec.c.

void acpi_ec_unblock_transactions_early ( void  )

Definition at line 490 of file ec.c.

int ec_burst_disable ( void  )

Definition at line 397 of file ec.c.

int ec_burst_enable ( void  )

Definition at line 388 of file ec.c.

acpi_handle ec_get_handle ( void  )

Definition at line 455 of file ec.c.

int ec_read ( u8  addr,
u8 val 
)

Definition at line 406 of file ec.c.

int ec_transaction ( u8  command,
const u8 wdata,
unsigned  wdata_len,
u8 rdata,
unsigned  rdata_len 
)

Definition at line 439 of file ec.c.

int ec_write ( u8  addr,
u8  val 
)

Definition at line 425 of file ec.c.

EXPORT_SYMBOL ( first_ec  )
EXPORT_SYMBOL ( ec_burst_enable  )
EXPORT_SYMBOL ( ec_burst_disable  )
EXPORT_SYMBOL ( ec_read  )
EXPORT_SYMBOL ( ec_write  )
EXPORT_SYMBOL ( ec_transaction  )
EXPORT_SYMBOL ( ec_get_handle  )
EXPORT_SYMBOL_GPL ( acpi_ec_add_query_handler  )
EXPORT_SYMBOL_GPL ( acpi_ec_remove_query_handler  )
module_param ( ec_delay  ,
uint  ,
0644   
)
module_param ( ec_storm_threshold  ,
uint  ,
0644   
)
MODULE_PARM_DESC ( ec_delay  ,
"Timeout(ms) waited until an EC command completes"   
)
MODULE_PARM_DESC ( ec_storm_threshold  ,
"Maxim false GPE numbers not considered as GPE storm"   
)

Variable Documentation

struct acpi_ec* boot_ec

Definition at line 120 of file ec.c.

struct acpi_ec * first_ec

Definition at line 120 of file ec.c.