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

Go to the source code of this file.

Data Structures

struct  eeepc_laptop
 
struct  eeepc_cpufv
 

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define EEEPC_LAPTOP_VERSION   "0.1"
 
#define EEEPC_LAPTOP_NAME   "Eee PC Hotkey Driver"
 
#define EEEPC_LAPTOP_FILE   "eeepc"
 
#define EEEPC_ACPI_CLASS   "hotkey"
 
#define EEEPC_ACPI_DEVICE_NAME   "Hotkey"
 
#define EEEPC_ACPI_HID   "ASUS010"
 
#define NOTIFY_BRN_MIN   0x20
 
#define NOTIFY_BRN_MAX   0x2f
 
#define EEEPC_CREATE_DEVICE_ATTR(_name, _mode, _cm)
 
#define EEEPC_EC_SC00   0x61
 
#define EEEPC_EC_FAN_PWM   (EEEPC_EC_SC00 + 2) /* Fan PWM duty cycle (%) */
 
#define EEEPC_EC_FAN_HRPM   (EEEPC_EC_SC00 + 5) /* High byte, fan speed (RPM) */
 
#define EEEPC_EC_FAN_LRPM   (EEEPC_EC_SC00 + 6) /* Low byte, fan speed (RPM) */
 
#define EEEPC_EC_SFB0   0xD0
 
#define EEEPC_EC_FAN_CTRL   (EEEPC_EC_SFB0 + 3) /* Byte containing SF25 */
 
#define EEEPC_CREATE_SENSOR_ATTR(_name, _mode, _set, _get)
 

Enumerations

enum  {
  DISABLE_ASL_WLAN = 0x0001, DISABLE_ASL_BLUETOOTH = 0x0002, DISABLE_ASL_IRDA = 0x0004, DISABLE_ASL_CAMERA = 0x0008,
  DISABLE_ASL_TV = 0x0010, DISABLE_ASL_GPS = 0x0020, DISABLE_ASL_DISPLAYSWITCH = 0x0040, DISABLE_ASL_MODEM = 0x0080,
  DISABLE_ASL_CARDREADER = 0x0100, DISABLE_ASL_3G = 0x0200, DISABLE_ASL_WIMAX = 0x0400, DISABLE_ASL_HWCF = 0x0800
}
 
enum  {
  CM_ASL_WLAN = 0, CM_ASL_BLUETOOTH, CM_ASL_IRDA, CM_ASL_1394,
  CM_ASL_CAMERA, CM_ASL_TV, CM_ASL_GPS, CM_ASL_DVDROM,
  CM_ASL_DISPLAYSWITCH, CM_ASL_PANELBRIGHT, CM_ASL_BIOSFLASH, CM_ASL_ACPIFLASH,
  CM_ASL_CPUFV, CM_ASL_CPUTEMPERATURE, CM_ASL_FANCPU, CM_ASL_FANCHASSIS,
  CM_ASL_USBPORT1, CM_ASL_USBPORT2, CM_ASL_USBPORT3, CM_ASL_MODEM,
  CM_ASL_CARDREADER, CM_ASL_3G, CM_ASL_WIMAX, CM_ASL_HWCF,
  CM_ASL_LID, CM_ASL_TYPE, CM_ASL_PANELPOWER, CM_ASL_TPD
}
 

Functions

 MODULE_AUTHOR ("Corentin Chary, Eric Cooper")
 
 MODULE_DESCRIPTION (EEEPC_LAPTOP_NAME)
 
 MODULE_LICENSE ("GPL")
 
 module_param (hotplug_disabled, bool, 0444)
 
 MODULE_PARM_DESC (hotplug_disabled,"Disable hotplug for wireless device. ""If your laptop need that, please report to ""acpi4asus-user@lists.sourceforge.net.")
 
 EEEPC_CREATE_DEVICE_ATTR (camera, 0644, CM_ASL_CAMERA)
 
 EEEPC_CREATE_DEVICE_ATTR (cardr, 0644, CM_ASL_CARDREADER)
 
 EEEPC_CREATE_DEVICE_ATTR (disp, 0200, CM_ASL_DISPLAYSWITCH)
 
 EEEPC_CREATE_SENSOR_ATTR (fan1_input, S_IRUGO, eeepc_get_fan_rpm, NULL)
 
 EEEPC_CREATE_SENSOR_ATTR (pwm1, S_IRUGO|S_IWUSR, eeepc_get_fan_pwm, eeepc_set_fan_pwm)
 
 EEEPC_CREATE_SENSOR_ATTR (pwm1_enable, S_IRUGO|S_IWUSR, eeepc_get_fan_ctrl, eeepc_set_fan_ctrl)
 
 MODULE_DEVICE_TABLE (acpi, eeepc_device_ids)
 
 module_init (eeepc_laptop_init)
 
 module_exit (eeepc_laptop_exit)
 

Macro Definition Documentation

#define EEEPC_ACPI_CLASS   "hotkey"

Definition at line 46 of file eeepc-laptop.c.

#define EEEPC_ACPI_DEVICE_NAME   "Hotkey"

Definition at line 47 of file eeepc-laptop.c.

#define EEEPC_ACPI_HID   "ASUS010"

Definition at line 48 of file eeepc-laptop.c.

#define EEEPC_CREATE_DEVICE_ATTR (   _name,
  _mode,
  _cm 
)
Value:
static ssize_t show_##_name(struct device *dev, \
char *buf) \
{ \
return show_sys_acpi(dev, _cm, buf); \
} \
static ssize_t store_##_name(struct device *dev, \
const char *buf, size_t count) \
{ \
return store_sys_acpi(dev, _cm, buf, count); \
} \
static struct device_attribute dev_attr_##_name = { \
.attr = { \
.name = __stringify(_name), \
.mode = _mode }, \
.show = show_##_name, \
.store = store_##_name, \
}

Definition at line 307 of file eeepc-laptop.c.

#define EEEPC_CREATE_SENSOR_ATTR (   _name,
  _mode,
  _set,
  _get 
)
Value:
static ssize_t show_##_name(struct device *dev, \
char *buf) \
{ \
return show_sys_hwmon(_set, buf); \
} \
static ssize_t store_##_name(struct device *dev, \
const char *buf, size_t count) \
{ \
return store_sys_hwmon(_get, buf, count); \
} \
static SENSOR_DEVICE_ATTR(_name, _mode, show_##_name, store_##_name, 0);

Definition at line 1063 of file eeepc-laptop.c.

#define EEEPC_EC_FAN_CTRL   (EEEPC_EC_SFB0 + 3) /* Byte containing SF25 */

Definition at line 998 of file eeepc-laptop.c.

#define EEEPC_EC_FAN_HRPM   (EEEPC_EC_SC00 + 5) /* High byte, fan speed (RPM) */

Definition at line 994 of file eeepc-laptop.c.

#define EEEPC_EC_FAN_LRPM   (EEEPC_EC_SC00 + 6) /* Low byte, fan speed (RPM) */

Definition at line 995 of file eeepc-laptop.c.

#define EEEPC_EC_FAN_PWM   (EEEPC_EC_SC00 + 2) /* Fan PWM duty cycle (%) */

Definition at line 993 of file eeepc-laptop.c.

#define EEEPC_EC_SC00   0x61

Definition at line 992 of file eeepc-laptop.c.

#define EEEPC_EC_SFB0   0xD0

Definition at line 997 of file eeepc-laptop.c.

#define EEEPC_LAPTOP_FILE   "eeepc"

Definition at line 44 of file eeepc-laptop.c.

#define EEEPC_LAPTOP_NAME   "Eee PC Hotkey Driver"

Definition at line 43 of file eeepc-laptop.c.

#define EEEPC_LAPTOP_VERSION   "0.1"

Definition at line 42 of file eeepc-laptop.c.

#define NOTIFY_BRN_MAX   0x2f

Definition at line 66 of file eeepc-laptop.c.

#define NOTIFY_BRN_MIN   0x20

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

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 19 of file eeepc-laptop.c.

Enumeration Type Documentation

anonymous enum
Enumerator:
DISABLE_ASL_WLAN 
DISABLE_ASL_BLUETOOTH 
DISABLE_ASL_IRDA 
DISABLE_ASL_CAMERA 
DISABLE_ASL_TV 
DISABLE_ASL_GPS 
DISABLE_ASL_DISPLAYSWITCH 
DISABLE_ASL_MODEM 
DISABLE_ASL_CARDREADER 
DISABLE_ASL_3G 
DISABLE_ASL_WIMAX 
DISABLE_ASL_HWCF 

Definition at line 68 of file eeepc-laptop.c.

anonymous enum
Enumerator:
CM_ASL_WLAN 
CM_ASL_BLUETOOTH 
CM_ASL_IRDA 
CM_ASL_1394 
CM_ASL_CAMERA 
CM_ASL_TV 
CM_ASL_GPS 
CM_ASL_DVDROM 
CM_ASL_DISPLAYSWITCH 
CM_ASL_PANELBRIGHT 
CM_ASL_BIOSFLASH 
CM_ASL_ACPIFLASH 
CM_ASL_CPUFV 
CM_ASL_CPUTEMPERATURE 
CM_ASL_FANCPU 
CM_ASL_FANCHASSIS 
CM_ASL_USBPORT1 
CM_ASL_USBPORT2 
CM_ASL_USBPORT3 
CM_ASL_MODEM 
CM_ASL_CARDREADER 
CM_ASL_3G 
CM_ASL_WIMAX 
CM_ASL_HWCF 
CM_ASL_LID 
CM_ASL_TYPE 
CM_ASL_PANELPOWER 
CM_ASL_TPD 

Definition at line 83 of file eeepc-laptop.c.

Function Documentation

EEEPC_CREATE_DEVICE_ATTR ( camera  ,
0644  ,
CM_ASL_CAMERA   
)
EEEPC_CREATE_DEVICE_ATTR ( cardr  ,
0644  ,
CM_ASL_CARDREADER   
)
EEEPC_CREATE_DEVICE_ATTR ( disp  ,
0200  ,
CM_ASL_DISPLAYSWITCH   
)
EEEPC_CREATE_SENSOR_ATTR ( fan1_input  ,
S_IRUGO  ,
eeepc_get_fan_rpm  ,
NULL   
)
EEEPC_CREATE_SENSOR_ATTR ( pwm1  ,
S_IRUGO S_IWUSR,
eeepc_get_fan_pwm  ,
eeepc_set_fan_pwm   
)
EEEPC_CREATE_SENSOR_ATTR ( pwm1_enable  ,
S_IRUGO S_IWUSR,
eeepc_get_fan_ctrl  ,
eeepc_set_fan_ctrl   
)
MODULE_AUTHOR ( "Corentin  Chary,
Eric Cooper"   
)
MODULE_DESCRIPTION ( EEEPC_LAPTOP_NAME  )
MODULE_DEVICE_TABLE ( acpi  ,
eeepc_device_ids   
)
module_exit ( eeepc_laptop_exit  )
module_init ( eeepc_laptop_init  )
MODULE_LICENSE ( "GPL"  )
module_param ( hotplug_disabled  ,
bool  ,
0444   
)
MODULE_PARM_DESC ( hotplug_disabled  ,
"Disable hotplug for wireless device. ""If your laptop need  that,
please report to""acpi4asus-user @lists.sourceforge.net."   
)