#define pr_fmt(fmt) …
#include <linux/delay.h>
#include <linux/platform_device.h>
#include <linux/input.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>
#define HDAPS_LOW_PORT …
#define HDAPS_NR_PORTS …
#define HDAPS_PORT_STATE …
#define HDAPS_PORT_YPOS …
#define HDAPS_PORT_XPOS …
#define HDAPS_PORT_TEMP1 …
#define HDAPS_PORT_YVAR …
#define HDAPS_PORT_XVAR …
#define HDAPS_PORT_TEMP2 …
#define HDAPS_PORT_UNKNOWN …
#define HDAPS_PORT_KMACT …
#define STATE_FRESH …
#define KEYBD_MASK …
#define MOUSE_MASK …
#define KEYBD_ISSET(n) …
#define MOUSE_ISSET(n) …
#define INIT_TIMEOUT_MSECS …
#define INIT_WAIT_MSECS …
#define HDAPS_POLL_INTERVAL …
#define HDAPS_INPUT_FUZZ …
#define HDAPS_INPUT_FLAT …
#define HDAPS_X_AXIS …
#define HDAPS_Y_AXIS …
#define HDAPS_BOTH_AXES …
static struct platform_device *pdev;
static struct input_dev *hdaps_idev;
static unsigned int hdaps_invert;
static u8 km_activity;
static int rest_x;
static int rest_y;
static DEFINE_MUTEX(hdaps_mtx);
static inline u8 __get_latch(u16 port)
{ … }
static inline int __check_latch(u16 port, u8 val)
{ … }
static int __wait_latch(u16 port, u8 val)
{ … }
static void __device_refresh(void)
{ … }
static int __device_refresh_sync(void)
{ … }
static inline void __device_complete(void)
{ … }
static int hdaps_readb_one(unsigned int port, u8 *val)
{ … }
static int __hdaps_read_pair(unsigned int port1, unsigned int port2,
int *x, int *y)
{ … }
static int hdaps_read_pair(unsigned int port1, unsigned int port2,
int *val1, int *val2)
{ … }
static int hdaps_device_init(void)
{ … }
static int hdaps_probe(struct platform_device *dev)
{ … }
#ifdef CONFIG_PM_SLEEP
static int hdaps_resume(struct device *dev)
{ … }
#endif
static SIMPLE_DEV_PM_OPS(hdaps_pm, NULL, hdaps_resume);
static struct platform_driver hdaps_driver = …;
static void hdaps_calibrate(void)
{ … }
static void hdaps_mousedev_poll(struct input_dev *input_dev)
{ … }
static ssize_t hdaps_position_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t hdaps_variance_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t hdaps_temp1_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t hdaps_temp2_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t hdaps_keyboard_activity_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t hdaps_mouse_activity_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static ssize_t hdaps_calibrate_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t hdaps_calibrate_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static ssize_t hdaps_invert_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static ssize_t hdaps_invert_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(position, 0444, hdaps_position_show, NULL);
static DEVICE_ATTR(variance, 0444, hdaps_variance_show, NULL);
static DEVICE_ATTR(temp1, 0444, hdaps_temp1_show, NULL);
static DEVICE_ATTR(temp2, 0444, hdaps_temp2_show, NULL);
static DEVICE_ATTR(keyboard_activity, 0444, hdaps_keyboard_activity_show, NULL);
static DEVICE_ATTR(mouse_activity, 0444, hdaps_mouse_activity_show, NULL);
static DEVICE_ATTR(calibrate, 0644, hdaps_calibrate_show,hdaps_calibrate_store);
static DEVICE_ATTR(invert, 0644, hdaps_invert_show, hdaps_invert_store);
static struct attribute *hdaps_attributes[] = …;
static const struct attribute_group hdaps_attribute_group = …;
static int __init hdaps_dmi_match(const struct dmi_system_id *id)
{ … }
static int __init hdaps_dmi_match_invert(const struct dmi_system_id *id)
{ … }
#define HDAPS_DMI_MATCH_INVERT(vendor, model, axes) …
#define HDAPS_DMI_MATCH_NORMAL(vendor, model) …
static const struct dmi_system_id hdaps_whitelist[] __initconst = …;
static int __init hdaps_init(void)
{ … }
static void __exit hdaps_exit(void)
{ … }
module_init(…) …;
module_exit(hdaps_exit);
module_param_named(invert, hdaps_invert, int, 0);
MODULE_PARM_DESC(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;