#include <linux/module.h>
#include <linux/i2c.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/delay.h>
#include <linux/workqueue.h>
#include <linux/slab.h>
#include <linux/pm.h>
#define DRIVER_NAME …
#define PRODUCT_ID_LENGTH …
#define REGISTER_LENGTH …
#define SOFT_RESET_DELAY_US …
#define HARD_RESET_DELAY_MS …
#define PAGE_SEL_REG …
#define DEVICE_STATUS_REG …
#define DEV_CONTROL_REG …
#define INTERRUPT_EN_REG …
#define ERR_STAT_REG …
#define INT_REQ_STAT_REG …
#define DEV_COMMAND_REG …
#define RMI_PROT_VER_REG …
#define MANUFACT_ID_REG …
#define PHYS_INT_VER_REG …
#define PROD_PROPERTY_REG …
#define INFO_QUERY_REG0 …
#define INFO_QUERY_REG1 …
#define INFO_QUERY_REG2 …
#define INFO_QUERY_REG3 …
#define PRODUCT_ID_REG0 …
#define PRODUCT_ID_REG1 …
#define PRODUCT_ID_REG2 …
#define PRODUCT_ID_REG3 …
#define PRODUCT_ID_REG4 …
#define PRODUCT_ID_REG5 …
#define PRODUCT_ID_REG6 …
#define PRODUCT_ID_REG7 …
#define PRODUCT_ID_REG8 …
#define PRODUCT_ID_REG9 …
#define PRODUCT_ID_REG10 …
#define PRODUCT_ID_REG11 …
#define PRODUCT_ID_REG12 …
#define PRODUCT_ID_REG13 …
#define PRODUCT_ID_REG14 …
#define PRODUCT_ID_REG15 …
#define DATA_REG0 …
#define ABS_PRESSURE_REG …
#define ABS_MSB_X_REG …
#define ABS_LSB_X_REG …
#define ABS_MSB_Y_REG …
#define ABS_LSB_Y_REG …
#define REL_X_REG …
#define REL_Y_REG …
#define DEV_QUERY_REG0 …
#define DEV_QUERY_REG1 …
#define DEV_QUERY_REG2 …
#define DEV_QUERY_REG3 …
#define DEV_QUERY_REG4 …
#define DEV_QUERY_REG5 …
#define DEV_QUERY_REG6 …
#define DEV_QUERY_REG7 …
#define DEV_QUERY_REG8 …
#define GENERAL_2D_CONTROL_REG …
#define SENSOR_SENSITIVITY_REG …
#define SENS_MAX_POS_MSB_REG …
#define SENS_MAX_POS_LSB_REG …
#define REPORT_RATE_1ST_BIT …
#define F10_ABS_INT_ENA …
#define F10_REL_INT_ENA …
#define F20_INT_ENA …
#define F10_ABS_INT_REQ …
#define F10_REL_INT_REQ …
#define F20_INT_REQ …
#define STAT_CONFIGURED …
#define STAT_ERROR …
#define RESET_COMMAND …
#define REZERO_COMMAND …
#define GESTURE …
#define HAS_PALM_DETECT …
#define HAS_MULTI_FING …
#define HAS_SCROLLER …
#define HAS_2D_SCROLL …
#define NO_DECELERATION …
#define REDUCE_REPORTING …
#define NO_FILTER …
#define REPORT_RATE_MSK …
#define SLEEP_MODE_MSK …
#define FULL_AWAKE …
#define NORMAL_OP …
#define LOW_PWR_OP …
#define VERY_LOW_PWR_OP …
#define SENS_SLEEP …
#define SLEEP_MOD …
#define DEEP_SLEEP …
#define HIBERNATE …
#define INT_ENA_REQ_MSK …
#define INT_ENA_ABS_MSK …
#define INT_ENA_REL_MSK …
#define INT_ENA_F20_MSK …
#define CONFIGURED_MSK …
#define ERROR_MSK …
#define FINGER_WIDTH_MSK …
#define GESTURE_MSK …
#define SENSOR_STATUS_MSK …
#define MSB_POSITION_MSK …
#define NUM_EXTRA_POS_MSK …
#define THREAD_IRQ_SLEEP_SECS …
#define THREAD_IRQ_SLEEP_MSECS …
#define NO_DATA_THRES …
#define NO_DATA_SLEEP_MSECS …
static bool no_decel = …;
module_param(no_decel, bool, 0644);
MODULE_PARM_DESC(…) …;
static bool reduce_report;
module_param(reduce_report, bool, 0644);
MODULE_PARM_DESC(…) …;
static bool no_filter;
module_param(no_filter, bool, 0644);
MODULE_PARM_DESC(…) …;
static bool polling_req;
module_param(polling_req, bool, 0444);
MODULE_PARM_DESC(…) …;
static int scan_rate = …;
module_param(scan_rate, int, 0644);
MODULE_PARM_DESC(…) …;
struct synaptics_i2c { … };
static inline void set_scan_rate(struct synaptics_i2c *touch, int scan_rate)
{ … }
static s32 synaptics_i2c_reg_get(struct i2c_client *client, u16 reg)
{ … }
static s32 synaptics_i2c_reg_set(struct i2c_client *client, u16 reg, u8 val)
{ … }
static s32 synaptics_i2c_word_get(struct i2c_client *client, u16 reg)
{ … }
static int synaptics_i2c_config(struct i2c_client *client)
{ … }
static int synaptics_i2c_reset_config(struct i2c_client *client)
{ … }
static int synaptics_i2c_check_error(struct i2c_client *client)
{ … }
static bool synaptics_i2c_get_input(struct synaptics_i2c *touch)
{ … }
static irqreturn_t synaptics_i2c_irq(int irq, void *dev_id)
{ … }
static void synaptics_i2c_check_params(struct synaptics_i2c *touch)
{ … }
static unsigned long synaptics_i2c_adjust_delay(struct synaptics_i2c *touch,
bool have_data)
{ … }
static void synaptics_i2c_work_handler(struct work_struct *work)
{ … }
static int synaptics_i2c_open(struct input_dev *input)
{ … }
static void synaptics_i2c_close(struct input_dev *input)
{ … }
static void synaptics_i2c_set_input_params(struct synaptics_i2c *touch)
{ … }
static struct synaptics_i2c *synaptics_i2c_touch_create(struct i2c_client *client)
{ … }
static int synaptics_i2c_probe(struct i2c_client *client)
{ … }
static void synaptics_i2c_remove(struct i2c_client *client)
{ … }
static int synaptics_i2c_suspend(struct device *dev)
{ … }
static int synaptics_i2c_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(synaptics_i2c_pm, synaptics_i2c_suspend,
synaptics_i2c_resume);
static const struct i2c_device_id synaptics_i2c_id_table[] = …;
MODULE_DEVICE_TABLE(i2c, synaptics_i2c_id_table);
#ifdef CONFIG_OF
static const struct of_device_id synaptics_i2c_of_match[] = …;
MODULE_DEVICE_TABLE(of, synaptics_i2c_of_match);
#endif
static struct i2c_driver synaptics_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;