#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/platform_device.h>
#include <linux/serio.h>
#include <linux/libps2.h>
#include <linux/unaligned.h>
#include "psmouse.h"
#include "elantech.h"
#include "elan_i2c.h"
#define elantech_debug(fmt, ...) …
static int synaptics_send_cmd(struct psmouse *psmouse, unsigned char c,
unsigned char *param)
{ … }
static int elantech_send_cmd(struct psmouse *psmouse, unsigned char c,
unsigned char *param)
{ … }
static int elantech_ps2_command(struct psmouse *psmouse,
unsigned char *param, int command)
{ … }
static int elantech_read_reg_params(struct psmouse *psmouse, u8 reg, u8 *param)
{ … }
static int elantech_write_reg_params(struct psmouse *psmouse, u8 reg, u8 *param)
{ … }
static int elantech_read_reg(struct psmouse *psmouse, unsigned char reg,
unsigned char *val)
{ … }
static int elantech_write_reg(struct psmouse *psmouse, unsigned char reg,
unsigned char val)
{ … }
static void elantech_packet_dump(struct psmouse *psmouse)
{ … }
static inline int elantech_is_buttonpad(struct elantech_device_info *info)
{ … }
static void elantech_report_absolute_v1(struct psmouse *psmouse)
{ … }
static void elantech_set_slot(struct input_dev *dev, int slot, bool active,
unsigned int x, unsigned int y)
{ … }
static void elantech_report_semi_mt_data(struct input_dev *dev,
unsigned int num_fingers,
unsigned int x1, unsigned int y1,
unsigned int x2, unsigned int y2)
{ … }
static void elantech_report_absolute_v2(struct psmouse *psmouse)
{ … }
static void elantech_report_trackpoint(struct psmouse *psmouse,
int packet_type)
{ … }
static void elantech_report_absolute_v3(struct psmouse *psmouse,
int packet_type)
{ … }
static void elantech_input_sync_v4(struct psmouse *psmouse)
{ … }
static void process_packet_status_v4(struct psmouse *psmouse)
{ … }
static void process_packet_head_v4(struct psmouse *psmouse)
{ … }
static void process_packet_motion_v4(struct psmouse *psmouse)
{ … }
static void elantech_report_absolute_v4(struct psmouse *psmouse,
int packet_type)
{ … }
static int elantech_packet_check_v1(struct psmouse *psmouse)
{ … }
static int elantech_debounce_check_v2(struct psmouse *psmouse)
{ … }
static int elantech_packet_check_v2(struct psmouse *psmouse)
{ … }
static int elantech_packet_check_v3(struct psmouse *psmouse)
{ … }
static int elantech_packet_check_v4(struct psmouse *psmouse)
{ … }
static psmouse_ret_t elantech_process_byte(struct psmouse *psmouse)
{ … }
static void elantech_set_rate_restore_reg_07(struct psmouse *psmouse,
unsigned int rate)
{ … }
static int elantech_set_absolute_mode(struct psmouse *psmouse)
{ … }
static unsigned int elantech_convert_res(unsigned int val)
{ … }
static int elantech_get_resolution_v4(struct psmouse *psmouse,
unsigned int *x_res,
unsigned int *y_res,
unsigned int *bus)
{ … }
static void elantech_set_buttonpad_prop(struct psmouse *psmouse)
{ … }
static const struct dmi_system_id elantech_dmi_has_middle_button[] = …;
static int elantech_set_input_params(struct psmouse *psmouse)
{ … }
struct elantech_attr_data { … };
static ssize_t elantech_show_int_attr(struct psmouse *psmouse, void *data,
char *buf)
{ … }
static ssize_t elantech_set_int_attr(struct psmouse *psmouse,
void *data, const char *buf, size_t count)
{ … }
#define ELANTECH_INT_ATTR(_name, _register) …
#define ELANTECH_INFO_ATTR(_name) …
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INT_ATTR(…);
ELANTECH_INFO_ATTR(…);
ELANTECH_INFO_ATTR(…);
ELANTECH_INFO_ATTR(…);
static struct attribute *elantech_attrs[] = …;
static const struct attribute_group elantech_attr_group = …;
static bool elantech_is_signature_valid(const unsigned char *param)
{ … }
int elantech_detect(struct psmouse *psmouse, bool set_properties)
{ … }
static void elantech_disconnect(struct psmouse *psmouse)
{ … }
static const struct dmi_system_id elantech_needs_reenable[] = …;
static int elantech_reconnect(struct psmouse *psmouse)
{ … }
static const struct dmi_system_id elantech_dmi_force_crc_enabled[] = …;
static const struct dmi_system_id no_hw_res_dmi_table[] = …;
static int elantech_change_report_id(struct psmouse *psmouse)
{ … }
static int elantech_set_properties(struct elantech_device_info *info)
{ … }
static int elantech_query_info(struct psmouse *psmouse,
struct elantech_device_info *info)
{ … }
#if defined(CONFIG_MOUSE_PS2_ELANTECH_SMBUS)
enum { … };
static int elantech_smbus = …;
module_param_named(elantech_smbus, elantech_smbus, int, 0644);
MODULE_PARM_DESC(…) …;
static const char * const i2c_blacklist_pnp_ids[] = …;
static int elantech_create_smbus(struct psmouse *psmouse,
struct elantech_device_info *info,
bool leave_breadcrumbs)
{ … }
static int elantech_setup_smbus(struct psmouse *psmouse,
struct elantech_device_info *info,
bool leave_breadcrumbs)
{ … }
static bool elantech_use_host_notify(struct psmouse *psmouse,
struct elantech_device_info *info)
{ … }
int elantech_init_smbus(struct psmouse *psmouse)
{ … }
#endif
static int elantech_setup_ps2(struct psmouse *psmouse,
struct elantech_device_info *info)
{ … }
int elantech_init_ps2(struct psmouse *psmouse)
{ … }
int elantech_init(struct psmouse *psmouse)
{ … }