Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Data Structures | Macros | Functions
asus-laptop.c File Reference
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/types.h>
#include <linux/err.h>
#include <linux/proc_fs.h>
#include <linux/backlight.h>
#include <linux/fb.h>
#include <linux/leds.h>
#include <linux/platform_device.h>
#include <linux/uaccess.h>
#include <linux/input.h>
#include <linux/input/sparse-keymap.h>
#include <linux/input-polldev.h>
#include <linux/rfkill.h>
#include <linux/slab.h>
#include <linux/dmi.h>
#include <acpi/acpi_drivers.h>
#include <acpi/acpi_bus.h>

Go to the source code of this file.

Data Structures

struct  asus_led
 
struct  asus_rfkill
 
struct  asus_laptop
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define ASUS_LAPTOP_VERSION   "0.42"
 
#define ASUS_LAPTOP_NAME   "Asus Laptop Support"
 
#define ASUS_LAPTOP_CLASS   "hotkey"
 
#define ASUS_LAPTOP_DEVICE_NAME   "Hotkey"
 
#define ASUS_LAPTOP_FILE   KBUILD_MODNAME
 
#define ASUS_LAPTOP_PREFIX   "\\_SB.ATKD."
 
#define ATKD_BR_UP   0x10 /* (event & ~ATKD_BR_UP) = brightness level */
 
#define ATKD_BR_DOWN   0x20 /* (event & ~ATKD_BR_DOWN) = britghness level */
 
#define ATKD_BR_MIN   ATKD_BR_UP
 
#define ATKD_BR_MAX   (ATKD_BR_DOWN | 0xF) /* 0x2f */
 
#define ATKD_LCD_ON   0x33
 
#define ATKD_LCD_OFF   0x34
 
#define WL_HWRS   0x80
 
#define BT_HWRS   0x100
 
#define WL_RSTS   0x01 /* internal Wifi */
 
#define BT_RSTS   0x02 /* internal Bluetooth */
 
#define WM_RSTS   0x08 /* internal wimax */
 
#define WW_RSTS   0x20 /* internal wwan */
 
#define TYPE_UNKNOWN   0
 
#define TYPE_LED   1
 
#define TYPE_RFKILL   2
 
#define METHOD_MLED   "MLED"
 
#define METHOD_TLED   "TLED"
 
#define METHOD_RLED   "RLED" /* W1JC */
 
#define METHOD_PLED   "PLED" /* A7J */
 
#define METHOD_GLED   "GLED" /* G1, G2 (probably) */
 
#define METHOD_LEDD   "SLCM"
 
#define METHOD_WLAN   "WLED"
 
#define METHOD_BLUETOOTH   "BLED"
 
#define METHOD_WWAN   "GSMC"
 
#define METHOD_WIMAX   "WMXC"
 
#define METHOD_WL_STATUS   "RSTS"
 
#define METHOD_BRIGHTNESS_SET   "SPLV"
 
#define METHOD_BRIGHTNESS_GET   "GPLV"
 
#define METHOD_SWITCH_DISPLAY   "SDSP"
 
#define METHOD_ALS_CONTROL   "ALSC" /* Z71A Z71V */
 
#define METHOD_ALS_LEVEL   "ALSL" /* Z71A Z71V */
 
#define METHOD_GPS_ON   "SDON"
 
#define METHOD_GPS_OFF   "SDOF"
 
#define METHOD_GPS_STATUS   "GPST"
 
#define METHOD_KBD_LIGHT_SET   "SLKB"
 
#define METHOD_KBD_LIGHT_GET   "GLKB"
 
#define DEVICE_NAME_PEGA   "Lucid"
 
#define METHOD_PEGA_ENABLE   "ENPR"
 
#define METHOD_PEGA_DISABLE   "DAPR"
 
#define PEGA_WLAN   0x00
 
#define PEGA_BLUETOOTH   0x01
 
#define PEGA_WWAN   0x02
 
#define PEGA_ALS   0x04
 
#define PEGA_ALS_POWER   0x05
 
#define METHOD_PEGA_READ   "RDLN"
 
#define PEGA_READ_ALS_H   0x02
 
#define PEGA_READ_ALS_L   0x03
 
#define PEGA_ACCEL_NAME   "pega_accel"
 
#define PEGA_ACCEL_DESC   "Pegatron Lucid Tablet Accelerometer"
 
#define METHOD_XLRX   "XLRX"
 
#define METHOD_XLRY   "XLRY"
 
#define METHOD_XLRZ   "XLRZ"
 
#define PEGA_ACC_CLAMP   512 /* 1G accel is reported as ~256, so clamp to 2G */
 
#define PEGA_ACC_RETRIES   3
 

Functions

 MODULE_AUTHOR ("Julien Lerouge, Karol Kozimor, Corentin Chary")
 
 MODULE_DESCRIPTION (ASUS_LAPTOP_NAME)
 
 MODULE_LICENSE ("GPL")
 
 module_param (wapf, uint, 0444)
 
 MODULE_PARM_DESC (wapf,"WAPF value")
 
 module_param (wled_type, charp, 0444)
 
 MODULE_PARM_DESC (wled_type,"Set the wled type on boot ""(unknown, led or rfkill). ""default is unknown")
 
 module_param (bled_type, charp, 0444)
 
 MODULE_PARM_DESC (bled_type,"Set the bled type on boot ""(unknown, led or rfkill). ""default is unknown")
 
 module_param (wlan_status, int, 0444)
 
 MODULE_PARM_DESC (wlan_status,"Set the wireless status on boot ""(0 = disabled, 1 = enabled, -1 = don't do anything). ""default is -1")
 
 module_param (bluetooth_status, int, 0444)
 
 MODULE_PARM_DESC (bluetooth_status,"Set the wireless status on boot ""(0 = disabled, 1 = enabled, -1 = don't do anything). ""default is -1")
 
 module_param (wimax_status, int, 0444)
 
 MODULE_PARM_DESC (wimax_status,"Set the wireless status on boot ""(0 = disabled, 1 = enabled, -1 = don't do anything). ""default is -1")
 
 module_param (wwan_status, int, 0444)
 
 MODULE_PARM_DESC (wwan_status,"Set the wireless status on boot ""(0 = disabled, 1 = enabled, -1 = don't do anything). ""default is -1")
 
 module_param (als_status, int, 0444)
 
 MODULE_PARM_DESC (als_status,"Set the ALS status on boot ""(0 = disabled, 1 = enabled). ""default is 0")
 
 MODULE_DEVICE_TABLE (acpi, asus_device_ids)
 
 module_init (asus_laptop_init)
 
 module_exit (asus_laptop_exit)
 

Macro Definition Documentation

#define ASUS_LAPTOP_CLASS   "hotkey"

Definition at line 62 of file asus-laptop.c.

#define ASUS_LAPTOP_DEVICE_NAME   "Hotkey"

Definition at line 63 of file asus-laptop.c.

#define ASUS_LAPTOP_FILE   KBUILD_MODNAME

Definition at line 64 of file asus-laptop.c.

#define ASUS_LAPTOP_NAME   "Asus Laptop Support"

Definition at line 61 of file asus-laptop.c.

#define ASUS_LAPTOP_PREFIX   "\\_SB.ATKD."

Definition at line 65 of file asus-laptop.c.

#define ASUS_LAPTOP_VERSION   "0.42"

Definition at line 59 of file asus-laptop.c.

#define ATKD_BR_DOWN   0x20 /* (event & ~ATKD_BR_DOWN) = britghness level */

Definition at line 132 of file asus-laptop.c.

#define ATKD_BR_MAX   (ATKD_BR_DOWN | 0xF) /* 0x2f */

Definition at line 134 of file asus-laptop.c.

#define ATKD_BR_MIN   ATKD_BR_UP

Definition at line 133 of file asus-laptop.c.

#define ATKD_BR_UP   0x10 /* (event & ~ATKD_BR_UP) = brightness level */

Definition at line 131 of file asus-laptop.c.

#define ATKD_LCD_OFF   0x34

Definition at line 136 of file asus-laptop.c.

#define ATKD_LCD_ON   0x33

Definition at line 135 of file asus-laptop.c.

#define BT_HWRS   0x100

Definition at line 142 of file asus-laptop.c.

#define BT_RSTS   0x02 /* internal Bluetooth */

Definition at line 149 of file asus-laptop.c.

#define DEVICE_NAME_PEGA   "Lucid"

Definition at line 203 of file asus-laptop.c.

#define METHOD_ALS_CONTROL   "ALSC" /* Z71A Z71V */

Definition at line 189 of file asus-laptop.c.

#define METHOD_ALS_LEVEL   "ALSL" /* Z71A Z71V */

Definition at line 190 of file asus-laptop.c.

#define METHOD_BLUETOOTH   "BLED"

Definition at line 174 of file asus-laptop.c.

#define METHOD_BRIGHTNESS_GET   "GPLV"

Definition at line 184 of file asus-laptop.c.

#define METHOD_BRIGHTNESS_SET   "SPLV"

Definition at line 183 of file asus-laptop.c.

#define METHOD_GLED   "GLED" /* G1, G2 (probably) */

Definition at line 163 of file asus-laptop.c.

#define METHOD_GPS_OFF   "SDOF"

Definition at line 195 of file asus-laptop.c.

#define METHOD_GPS_ON   "SDON"

Definition at line 194 of file asus-laptop.c.

#define METHOD_GPS_STATUS   "GPST"

Definition at line 196 of file asus-laptop.c.

#define METHOD_KBD_LIGHT_GET   "GLKB"

Definition at line 200 of file asus-laptop.c.

#define METHOD_KBD_LIGHT_SET   "SLKB"

Definition at line 199 of file asus-laptop.c.

#define METHOD_LEDD   "SLCM"

Definition at line 166 of file asus-laptop.c.

#define METHOD_MLED   "MLED"

Definition at line 159 of file asus-laptop.c.

#define METHOD_PEGA_DISABLE   "DAPR"

Definition at line 206 of file asus-laptop.c.

#define METHOD_PEGA_ENABLE   "ENPR"

Definition at line 205 of file asus-laptop.c.

#define METHOD_PEGA_READ   "RDLN"

Definition at line 213 of file asus-laptop.c.

#define METHOD_PLED   "PLED" /* A7J */

Definition at line 162 of file asus-laptop.c.

#define METHOD_RLED   "RLED" /* W1JC */

Definition at line 161 of file asus-laptop.c.

#define METHOD_SWITCH_DISPLAY   "SDSP"

Definition at line 187 of file asus-laptop.c.

#define METHOD_TLED   "TLED"

Definition at line 160 of file asus-laptop.c.

#define METHOD_WIMAX   "WMXC"

Definition at line 178 of file asus-laptop.c.

#define METHOD_WL_STATUS   "RSTS"

Definition at line 180 of file asus-laptop.c.

#define METHOD_WLAN   "WLED"

Definition at line 173 of file asus-laptop.c.

#define METHOD_WWAN   "GSMC"

Definition at line 177 of file asus-laptop.c.

#define METHOD_XLRX   "XLRX"

Definition at line 219 of file asus-laptop.c.

#define METHOD_XLRY   "XLRY"

Definition at line 220 of file asus-laptop.c.

#define METHOD_XLRZ   "XLRZ"

Definition at line 221 of file asus-laptop.c.

#define PEGA_ACC_CLAMP   512 /* 1G accel is reported as ~256, so clamp to 2G */

Definition at line 222 of file asus-laptop.c.

#define PEGA_ACC_RETRIES   3

Definition at line 223 of file asus-laptop.c.

#define PEGA_ACCEL_DESC   "Pegatron Lucid Tablet Accelerometer"

Definition at line 218 of file asus-laptop.c.

#define PEGA_ACCEL_NAME   "pega_accel"

Definition at line 217 of file asus-laptop.c.

#define PEGA_ALS   0x04

Definition at line 210 of file asus-laptop.c.

#define PEGA_ALS_POWER   0x05

Definition at line 211 of file asus-laptop.c.

#define PEGA_BLUETOOTH   0x01

Definition at line 208 of file asus-laptop.c.

#define PEGA_READ_ALS_H   0x02

Definition at line 214 of file asus-laptop.c.

#define PEGA_READ_ALS_L   0x03

Definition at line 215 of file asus-laptop.c.

#define PEGA_WLAN   0x00

Definition at line 207 of file asus-laptop.c.

#define PEGA_WWAN   0x02

Definition at line 209 of file asus-laptop.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 37 of file asus-laptop.c.

#define TYPE_LED   1

Definition at line 155 of file asus-laptop.c.

#define TYPE_RFKILL   2

Definition at line 156 of file asus-laptop.c.

#define TYPE_UNKNOWN   0

Definition at line 154 of file asus-laptop.c.

#define WL_HWRS   0x80

Definition at line 141 of file asus-laptop.c.

#define WL_RSTS   0x01 /* internal Wifi */

Definition at line 148 of file asus-laptop.c.

#define WM_RSTS   0x08 /* internal wimax */

Definition at line 150 of file asus-laptop.c.

#define WW_RSTS   0x20 /* internal wwan */

Definition at line 151 of file asus-laptop.c.

Function Documentation

MODULE_AUTHOR ( "Julien  Lerouge,
Karol  Kozimor,
Corentin Chary"   
)
MODULE_DESCRIPTION ( ASUS_LAPTOP_NAME  )
MODULE_DEVICE_TABLE ( acpi  ,
asus_device_ids   
)
module_exit ( asus_laptop_exit  )
module_init ( asus_laptop_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( wapf  ,
uint  ,
0444   
)
module_param ( wled_type  ,
charp  ,
0444   
)
module_param ( bled_type  ,
charp  ,
0444   
)
module_param ( wlan_status  ,
int  ,
0444   
)
module_param ( bluetooth_status  ,
int  ,
0444   
)
module_param ( wimax_status  ,
int  ,
0444   
)
module_param ( wwan_status  ,
int  ,
0444   
)
module_param ( als_status  ,
int  ,
0444   
)
MODULE_PARM_DESC ( wapf  ,
"WAPF value  
)
MODULE_PARM_DESC ( wled_type  ,
"Set the wled type on boot ""(unknown, led or rfkill). ""default is unknown  
)
MODULE_PARM_DESC ( bled_type  ,
"Set the bled type on boot ""(unknown, led or rfkill). ""default is unknown  
)
MODULE_PARM_DESC ( wlan_status  ,
"Set the wireless status on boot ""(0 = disabled, 1 = enabled, -1 = don't do anything). ""default is -1"   
)
MODULE_PARM_DESC ( bluetooth_status  ,
"Set the wireless status on boot ""(0 = disabled, 1 = enabled, -1 = don't do anything). ""default is -1"   
)
MODULE_PARM_DESC ( wimax_status  ,
"Set the wireless status on boot ""(0 = disabled, 1 = enabled, -1 = don't do anything). ""default is -1"   
)
MODULE_PARM_DESC ( wwan_status  ,
"Set the wireless status on boot ""(0 = disabled, 1 = enabled, -1 = don't do anything). ""default is -1"   
)
MODULE_PARM_DESC ( als_status  ,
"Set the ALS status on boot ""(0 = disabled, 1 = enabled). ""default is 0"   
)