--- ibm_hdaps.c.org 2005-07-04 07:33:17.000000000 +0200 +++ ibm_hdaps.c 2005-07-04 07:42:58.000000000 +0200 @@ -34,31 +34,18 @@ #include #include #include +#include "ibm_hdaps.h" +#define DRV_NAME "ibm_hdaps" +#define DRV_DESCRIPTION "IBM ThinkPad Accelerometer driver" +#define DRV_COPYRIGHT "Copyright (c) 2005 Jesper Juhl " +#define DRV_VERSION "0.2" -#define HDAPS_LOW_PORT 0x1600 /* first port used by accelerometer */ -#define HDAPS_NR_PORTS 0x30 /* nr of ports total - 0x1600 through 0x162f */ - -#define STATE_STALE 0x00 /* accelerometer data is stale */ -#define STATE_FRESH 0x50 /* accelerometer data fresh fresh */ - -#define REFRESH_ASYNC 0x00 /* do asynchronous refresh */ -#define REFRESH_SYNC 0x01 /* do synchronous refresh */ - -/* - * where to find the various accelerometer data - * these map to the members of struct hdaps_accel_data - */ -#define HDAPS_PORT_STATE 0x1611 -#define HDAPS_PORT_XACCEL 0x1612 -#define HDAPS_PORT_YACCEL 0x1614 -#define HDAPS_PORT_TEMP 0x1616 -#define HDAPS_PORT_XVAR 0x1617 -#define HDAPS_PORT_YVAR 0x1619 -#define HDAPS_PORT_TEMP2 0x161b -#define HDAPS_PORT_UNKNOWN 0x161c -#define HDAPS_PORT_KMACCT 0x161d +MODULE_LICENSE("GPL"); +MODULE_AUTHOR(DRV_COPYRIGHT); +MODULE_DESCRIPTION(DRV_DESCRIPTION); +MODULE_VERSION(DRV_VERSION); static short debug = 0; @@ -345,6 +332,9 @@ int retval; struct hdaps_accel_data data; + printk(KERN_INFO DRV_NAME ": " DRV_DESCRIPTION ", " DRV_VERSION "\n"); + printk(KERN_INFO DRV_NAME ": " DRV_COPYRIGHT "\n"); + printk(KERN_WARNING "init 1 %08ld\n", jiffies); if (!request_region(HDAPS_LOW_PORT, HDAPS_NR_PORTS, "ibm_hdaps")) return -ENXIO; @@ -367,7 +357,6 @@ } if (0) for (i = 0; i < 50; i++) { - int j; unsigned long tmp; accelerometer_read(&data); printk(KERN_WARNING "state = %d\n", data.state); @@ -405,8 +394,3 @@ module_init(ibm_hdaps_init); module_exit(ibm_hdaps_exit); -MODULE_LICENSE("GPL"); -MODULE_AUTHOR("Jesper Juhl"); - -MODULE_DESCRIPTION("IBM ThinkPad Accelerometer driver"); -MODULE_VERSION("0.2");