#include <linux/module.h>
#include <linux/delay.h>
#include <linux/dmi.h>
#include <linux/input/mt.h>
#include <linux/serio.h>
#include <linux/libps2.h>
#include <linux/rmi.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include "psmouse.h"
#include "synaptics.h"
#define XMIN …
#define XMAX …
#define YMIN …
#define YMAX …
#define XMIN_NOMINAL …
#define XMAX_NOMINAL …
#define YMIN_NOMINAL …
#define YMAX_NOMINAL …
#define ABS_POS_BITS …
#define X_MAX_POSITIVE …
#define Y_MAX_POSITIVE …
#define DMAX …
static int synaptics_mode_cmd(struct psmouse *psmouse, u8 mode)
{ … }
int synaptics_detect(struct psmouse *psmouse, bool set_properties)
{ … }
void synaptics_reset(struct psmouse *psmouse)
{ … }
#if defined(CONFIG_MOUSE_PS2_SYNAPTICS) || \
defined(CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS)
static const char * const topbuttonpad_pnp_ids[] = …;
static const char * const smbus_pnp_ids[] = …;
static const char * const forcepad_pnp_ids[] = …;
static int synaptics_send_cmd(struct psmouse *psmouse, u8 cmd, u8 *param)
{ … }
static int synaptics_query_int(struct psmouse *psmouse, u8 query_cmd, u32 *val)
{ … }
static int synaptics_identify(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
static int synaptics_model_id(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
static int synaptics_firmware_id(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
static int synaptics_query_modes(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
static int synaptics_capability(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
static int synaptics_resolution(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
static int synaptics_query_hardware(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
#endif
#ifdef CONFIG_MOUSE_PS2_SYNAPTICS
static bool cr48_profile_sensor;
#define ANY_BOARD_ID …
struct min_max_quirk { … };
static const struct min_max_quirk min_max_pnpid_table[] = …;
static int synaptics_invert_y(int y)
{ … }
static void synaptics_apply_quirks(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
static bool synaptics_has_agm(struct synaptics_data *priv)
{ … }
static int synaptics_set_advanced_gesture_mode(struct psmouse *psmouse)
{ … }
static int synaptics_set_mode(struct psmouse *psmouse)
{ … }
static void synaptics_set_rate(struct psmouse *psmouse, unsigned int rate)
{ … }
static int synaptics_pt_write(struct serio *serio, u8 c)
{ … }
static int synaptics_pt_start(struct serio *serio)
{ … }
static void synaptics_pt_stop(struct serio *serio)
{ … }
static int synaptics_is_pt_packet(u8 *buf)
{ … }
static void synaptics_pass_pt_packet(struct serio *ptport, u8 *packet)
{ … }
static void synaptics_pt_activate(struct psmouse *psmouse)
{ … }
static void synaptics_pt_create(struct psmouse *psmouse)
{ … }
static void synaptics_parse_agm(const u8 buf[],
struct synaptics_data *priv,
struct synaptics_hw_state *hw)
{ … }
static void synaptics_parse_ext_buttons(const u8 buf[],
struct synaptics_data *priv,
struct synaptics_hw_state *hw)
{ … }
static int synaptics_parse_hw_state(const u8 buf[],
struct synaptics_data *priv,
struct synaptics_hw_state *hw)
{ … }
static void synaptics_report_semi_mt_slot(struct input_dev *dev, int slot,
bool active, int x, int y)
{ … }
static void synaptics_report_semi_mt_data(struct input_dev *dev,
const struct synaptics_hw_state *a,
const struct synaptics_hw_state *b,
int num_fingers)
{ … }
static void synaptics_report_ext_buttons(struct psmouse *psmouse,
const struct synaptics_hw_state *hw)
{ … }
static void synaptics_report_buttons(struct psmouse *psmouse,
const struct synaptics_hw_state *hw)
{ … }
static void synaptics_report_mt_data(struct psmouse *psmouse,
const struct synaptics_hw_state *sgm,
int num_fingers)
{ … }
static void synaptics_image_sensor_process(struct psmouse *psmouse,
struct synaptics_hw_state *sgm)
{ … }
static bool synaptics_has_multifinger(struct synaptics_data *priv)
{ … }
static void synaptics_process_packet(struct psmouse *psmouse)
{ … }
static bool synaptics_validate_byte(struct psmouse *psmouse,
int idx, enum synaptics_pkt_type pkt_type)
{ … }
static enum synaptics_pkt_type
synaptics_detect_pkt_type(struct psmouse *psmouse)
{ … }
static psmouse_ret_t synaptics_process_byte(struct psmouse *psmouse)
{ … }
static void set_abs_position_params(struct input_dev *dev,
struct synaptics_device_info *info,
int x_code, int y_code)
{ … }
static int set_input_params(struct psmouse *psmouse,
struct synaptics_data *priv)
{ … }
static ssize_t synaptics_show_disable_gesture(struct psmouse *psmouse,
void *data, char *buf)
{ … }
static ssize_t synaptics_set_disable_gesture(struct psmouse *psmouse,
void *data, const char *buf,
size_t len)
{ … }
PSMOUSE_DEFINE_ATTR(…);
static void synaptics_disconnect(struct psmouse *psmouse)
{ … }
static int synaptics_reconnect(struct psmouse *psmouse)
{ … }
static bool impaired_toshiba_kbc;
static const struct dmi_system_id toshiba_dmi_table[] __initconst = …;
static bool broken_olpc_ec;
static const struct dmi_system_id olpc_dmi_table[] __initconst = …;
static const struct dmi_system_id __initconst cr48_dmi_table[] = …;
void __init synaptics_module_init(void)
{ … }
static int synaptics_init_ps2(struct psmouse *psmouse,
struct synaptics_device_info *info,
bool absolute_mode)
{ … }
static int __synaptics_init(struct psmouse *psmouse, bool absolute_mode)
{ … }
int synaptics_init_absolute(struct psmouse *psmouse)
{ … }
int synaptics_init_relative(struct psmouse *psmouse)
{ … }
static int synaptics_setup_ps2(struct psmouse *psmouse,
struct synaptics_device_info *info)
{ … }
#else
void __init synaptics_module_init(void)
{
}
static int __maybe_unused
synaptics_setup_ps2(struct psmouse *psmouse,
struct synaptics_device_info *info)
{
return -ENOSYS;
}
#endif
#ifdef CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS
enum { … };
static int synaptics_intertouch = …;
module_param_named(synaptics_intertouch, synaptics_intertouch, int, 0644);
MODULE_PARM_DESC(…) …;
static int synaptics_create_intertouch(struct psmouse *psmouse,
struct synaptics_device_info *info,
bool leave_breadcrumbs)
{ … }
static int synaptics_setup_intertouch(struct psmouse *psmouse,
struct synaptics_device_info *info,
bool leave_breadcrumbs)
{ … }
int synaptics_init_smbus(struct psmouse *psmouse)
{ … }
#else
static int __maybe_unused
synaptics_setup_intertouch(struct psmouse *psmouse,
struct synaptics_device_info *info,
bool leave_breadcrumbs)
{
return -ENOSYS;
}
int synaptics_init_smbus(struct psmouse *psmouse)
{
return -ENOSYS;
}
#endif
#if defined(CONFIG_MOUSE_PS2_SYNAPTICS) || \
defined(CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS)
int synaptics_init(struct psmouse *psmouse)
{ … }
#else
int synaptics_init(struct psmouse *psmouse)
{
return -ENOSYS;
}
#endif