Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
sbs.c File Reference
#include <linux/init.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/acpi.h>
#include <linux/timer.h>
#include <linux/jiffies.h>
#include <linux/delay.h>
#include <linux/power_supply.h>
#include "sbshc.h"

Go to the source code of this file.

Data Structures

struct  acpi_battery
 
struct  acpi_sbs
 
struct  acpi_battery_reader
 

Macros

#define PREFIX   "ACPI: "
 
#define ACPI_SBS_CLASS   "sbs"
 
#define ACPI_AC_CLASS   "ac_adapter"
 
#define ACPI_BATTERY_CLASS   "battery"
 
#define ACPI_SBS_DEVICE_NAME   "Smart Battery System"
 
#define ACPI_SBS_FILE_INFO   "info"
 
#define ACPI_SBS_FILE_STATE   "state"
 
#define ACPI_SBS_FILE_ALARM   "alarm"
 
#define ACPI_BATTERY_DIR_NAME   "BAT%i"
 
#define ACPI_AC_DIR_NAME   "AC0"
 
#define ACPI_SBS_NOTIFY_STATUS   0x80
 
#define ACPI_SBS_NOTIFY_INFO   0x81
 
#define MAX_SBS_BAT   4
 
#define ACPI_SBS_BLOCK_MAX   32
 
#define to_acpi_battery(x)   container_of(x, struct acpi_battery, bat)
 
#define to_acpi_sbs(x)   container_of(x, struct acpi_sbs, charger)
 

Functions

 MODULE_AUTHOR ("Alexey Starikovskiy <[email protected]>")
 
 MODULE_DESCRIPTION ("Smart Battery System ACPI interface driver")
 
 MODULE_LICENSE ("GPL")
 
 module_param (cache_time, uint, 0644)
 
 MODULE_PARM_DESC (cache_time,"cache time in milliseconds")
 
struct proc_dir_entryacpi_lock_ac_dir (void)
 
struct proc_dir_entryacpi_lock_battery_dir (void)
 
void acpi_unlock_ac_dir (struct proc_dir_entry *acpi_ac_dir)
 
void acpi_unlock_battery_dir (struct proc_dir_entry *acpi_battery_dir)
 
 MODULE_DEVICE_TABLE (acpi, sbs_device_ids)
 
 module_init (acpi_sbs_init)
 
 module_exit (acpi_sbs_exit)
 

Macro Definition Documentation

#define ACPI_AC_CLASS   "ac_adapter"

Definition at line 50 of file sbs.c.

#define ACPI_AC_DIR_NAME   "AC0"

Definition at line 57 of file sbs.c.

#define ACPI_BATTERY_CLASS   "battery"

Definition at line 51 of file sbs.c.

#define ACPI_BATTERY_DIR_NAME   "BAT%i"

Definition at line 56 of file sbs.c.

#define ACPI_SBS_BLOCK_MAX   32

Definition at line 76 of file sbs.c.

#define ACPI_SBS_CLASS   "sbs"

Definition at line 49 of file sbs.c.

#define ACPI_SBS_DEVICE_NAME   "Smart Battery System"

Definition at line 52 of file sbs.c.

#define ACPI_SBS_FILE_ALARM   "alarm"

Definition at line 55 of file sbs.c.

#define ACPI_SBS_FILE_INFO   "info"

Definition at line 53 of file sbs.c.

#define ACPI_SBS_FILE_STATE   "state"

Definition at line 54 of file sbs.c.

#define ACPI_SBS_NOTIFY_INFO   0x81

Definition at line 60 of file sbs.c.

#define ACPI_SBS_NOTIFY_STATUS   0x80

Definition at line 59 of file sbs.c.

#define MAX_SBS_BAT   4

Definition at line 75 of file sbs.c.

#define PREFIX   "ACPI: "

Definition at line 47 of file sbs.c.

#define to_acpi_battery (   x)    container_of(x, struct acpi_battery, bat)

Definition at line 115 of file sbs.c.

#define to_acpi_sbs (   x)    container_of(x, struct acpi_sbs, charger)

Definition at line 131 of file sbs.c.

Function Documentation

struct proc_dir_entry* acpi_lock_ac_dir ( void  )
read

Definition at line 45 of file cm_sbs.c.

struct proc_dir_entry* acpi_lock_battery_dir ( void  )
read

Definition at line 74 of file cm_sbs.c.

void acpi_unlock_ac_dir ( struct proc_dir_entry acpi_ac_dir)

Definition at line 61 of file cm_sbs.c.

void acpi_unlock_battery_dir ( struct proc_dir_entry acpi_battery_dir)

Definition at line 92 of file cm_sbs.c.

MODULE_AUTHOR ( "Alexey Starikovskiy <[email protected]>"  )
MODULE_DESCRIPTION ( "Smart Battery System ACPI interface driver )
MODULE_DEVICE_TABLE ( acpi  ,
sbs_device_ids   
)
module_exit ( acpi_sbs_exit  )
module_init ( acpi_sbs_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( cache_time  ,
uint  ,
0644   
)
MODULE_PARM_DESC ( cache_time  ,
"cache time in milliseconds"   
)