Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros | Functions
hdaps.c File Reference
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/input-polldev.h>
#include <linux/kernel.h>
#include <linux/mutex.h>
#include <linux/module.h>
#include <linux/timer.h>
#include <linux/dmi.h>
#include <linux/jiffies.h>
#include <linux/io.h>

Go to the source code of this file.

Macros

#define pr_fmt(fmt)   KBUILD_MODNAME ": " fmt
 
#define HDAPS_LOW_PORT   0x1600 /* first port used by hdaps */
 
#define HDAPS_NR_PORTS   0x30 /* number of ports: 0x1600 - 0x162f */
 
#define HDAPS_PORT_STATE   0x1611 /* device state */
 
#define HDAPS_PORT_YPOS   0x1612 /* y-axis position */
 
#define HDAPS_PORT_XPOS   0x1614 /* x-axis position */
 
#define HDAPS_PORT_TEMP1   0x1616 /* device temperature, in Celsius */
 
#define HDAPS_PORT_YVAR   0x1617 /* y-axis variance (what is this?) */
 
#define HDAPS_PORT_XVAR   0x1619 /* x-axis variance (what is this?) */
 
#define HDAPS_PORT_TEMP2   0x161b /* device temperature (again?) */
 
#define HDAPS_PORT_UNKNOWN   0x161c /* what is this? */
 
#define HDAPS_PORT_KMACT   0x161d /* keyboard or mouse activity */
 
#define STATE_FRESH   0x50 /* accelerometer data is fresh */
 
#define KEYBD_MASK   0x20 /* set if keyboard activity */
 
#define MOUSE_MASK   0x40 /* set if mouse activity */
 
#define KEYBD_ISSET(n)   (!! (n & KEYBD_MASK)) /* keyboard used? */
 
#define MOUSE_ISSET(n)   (!! (n & MOUSE_MASK)) /* mouse used? */
 
#define INIT_TIMEOUT_MSECS   4000 /* wait up to 4s for device init ... */
 
#define INIT_WAIT_MSECS   200 /* ... in 200ms increments */
 
#define HDAPS_POLL_INTERVAL   50 /* poll for input every 1/20s (50 ms)*/
 
#define HDAPS_INPUT_FUZZ   4 /* input event threshold */
 
#define HDAPS_INPUT_FLAT   4
 
#define HDAPS_X_AXIS   (1 << 0)
 
#define HDAPS_Y_AXIS   (1 << 1)
 
#define HDAPS_BOTH_AXES   (HDAPS_X_AXIS | HDAPS_Y_AXIS)
 
#define HDAPS_DMI_MATCH_INVERT(vendor, model, axes)
 
#define HDAPS_DMI_MATCH_NORMAL(vendor, model)   HDAPS_DMI_MATCH_INVERT(vendor, model, 0)
 

Functions

 module_init (hdaps_init)
 
 module_exit (hdaps_exit)
 
 module_param_named (invert, hdaps_invert, int, 0)
 
 MODULE_PARM_DESC (invert,"invert data along each axis. 1 invert x-axis, ""2 invert y-axis, 3 invert both axes.")
 
 MODULE_AUTHOR ("Robert Love")
 
 MODULE_DESCRIPTION ("IBM Hard Drive Active Protection System (HDAPS) driver")
 
 MODULE_LICENSE ("GPL v2")
 

Macro Definition Documentation

#define HDAPS_BOTH_AXES   (HDAPS_X_AXIS | HDAPS_Y_AXIS)

Definition at line 71 of file hdaps.c.

#define HDAPS_DMI_MATCH_INVERT (   vendor,
  model,
  axes 
)
Value:
{ \
.ident = vendor " " model, \
.callback = hdaps_dmi_match_invert, \
.driver_data = (void *)axes, \
.matches = { \
DMI_MATCH(DMI_BOARD_VENDOR, vendor), \
DMI_MATCH(DMI_PRODUCT_VERSION, model) \
} \
}

Definition at line 501 of file hdaps.c.

#define HDAPS_DMI_MATCH_NORMAL (   vendor,
  model 
)    HDAPS_DMI_MATCH_INVERT(vendor, model, 0)

Definition at line 511 of file hdaps.c.

#define HDAPS_INPUT_FLAT   4

Definition at line 67 of file hdaps.c.

#define HDAPS_INPUT_FUZZ   4 /* input event threshold */

Definition at line 66 of file hdaps.c.

#define HDAPS_LOW_PORT   0x1600 /* first port used by hdaps */

Definition at line 42 of file hdaps.c.

#define HDAPS_NR_PORTS   0x30 /* number of ports: 0x1600 - 0x162f */

Definition at line 43 of file hdaps.c.

#define HDAPS_POLL_INTERVAL   50 /* poll for input every 1/20s (50 ms)*/

Definition at line 65 of file hdaps.c.

#define HDAPS_PORT_KMACT   0x161d /* keyboard or mouse activity */

Definition at line 53 of file hdaps.c.

#define HDAPS_PORT_STATE   0x1611 /* device state */

Definition at line 45 of file hdaps.c.

#define HDAPS_PORT_TEMP1   0x1616 /* device temperature, in Celsius */

Definition at line 48 of file hdaps.c.

#define HDAPS_PORT_TEMP2   0x161b /* device temperature (again?) */

Definition at line 51 of file hdaps.c.

#define HDAPS_PORT_UNKNOWN   0x161c /* what is this? */

Definition at line 52 of file hdaps.c.

#define HDAPS_PORT_XPOS   0x1614 /* x-axis position */

Definition at line 47 of file hdaps.c.

#define HDAPS_PORT_XVAR   0x1619 /* x-axis variance (what is this?) */

Definition at line 50 of file hdaps.c.

#define HDAPS_PORT_YPOS   0x1612 /* y-axis position */

Definition at line 46 of file hdaps.c.

#define HDAPS_PORT_YVAR   0x1617 /* y-axis variance (what is this?) */

Definition at line 49 of file hdaps.c.

#define HDAPS_X_AXIS   (1 << 0)

Definition at line 69 of file hdaps.c.

#define HDAPS_Y_AXIS   (1 << 1)

Definition at line 70 of file hdaps.c.

#define INIT_TIMEOUT_MSECS   4000 /* wait up to 4s for device init ... */

Definition at line 62 of file hdaps.c.

#define INIT_WAIT_MSECS   200 /* ... in 200ms increments */

Definition at line 63 of file hdaps.c.

#define KEYBD_ISSET (   n)    (!! (n & KEYBD_MASK)) /* keyboard used? */

Definition at line 59 of file hdaps.c.

#define KEYBD_MASK   0x20 /* set if keyboard activity */

Definition at line 57 of file hdaps.c.

#define MOUSE_ISSET (   n)    (!! (n & MOUSE_MASK)) /* mouse used? */

Definition at line 60 of file hdaps.c.

#define MOUSE_MASK   0x40 /* set if mouse activity */

Definition at line 58 of file hdaps.c.

#define pr_fmt (   fmt)    KBUILD_MODNAME ": " fmt

Definition at line 29 of file hdaps.c.

#define STATE_FRESH   0x50 /* accelerometer data is fresh */

Definition at line 55 of file hdaps.c.

Function Documentation

MODULE_AUTHOR ( "Robert Love"  )
MODULE_DESCRIPTION ( "IBM Hard Drive Active Protection System (HDAPS) driver )
module_exit ( hdaps_exit  )
module_init ( hdaps_init  )
MODULE_LICENSE ( "GPL v2 )
module_param_named ( invert  ,
hdaps_invert  ,
int  ,
 
)
MODULE_PARM_DESC ( invert  ,
"invert data along each axis. 1 invert x axis,
""2 invert y axis,
3 invert both axes."   
)