#include <linux/crc-ccitt.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/ihex.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/sizes.h>
#include <linux/slab.h>
#include <linux/unaligned.h>
#define ILI2XXX_POLL_PERIOD …
#define ILI210X_DATA_SIZE …
#define ILI211X_DATA_SIZE …
#define ILI251X_DATA_SIZE1 …
#define ILI251X_DATA_SIZE2 …
#define REG_TOUCHDATA …
#define REG_PANEL_INFO …
#define REG_FIRMWARE_VERSION …
#define REG_PROTOCOL_VERSION …
#define REG_KERNEL_VERSION …
#define REG_IC_BUSY …
#define REG_IC_BUSY_NOT_BUSY …
#define REG_GET_MODE …
#define REG_GET_MODE_AP …
#define REG_GET_MODE_BL …
#define REG_SET_MODE_AP …
#define REG_SET_MODE_BL …
#define REG_WRITE_DATA …
#define REG_WRITE_ENABLE …
#define REG_READ_DATA_CRC …
#define REG_CALIBRATE …
#define ILI251X_FW_FILENAME …
struct ili2xxx_chip { … };
struct ili210x { … };
static int ili210x_read_reg(struct i2c_client *client,
u8 reg, void *buf, size_t len)
{ … }
static int ili210x_read_touch_data(struct i2c_client *client, u8 *data)
{ … }
static bool ili210x_touchdata_to_coords(const u8 *touchdata,
unsigned int finger,
unsigned int *x, unsigned int *y,
unsigned int *z)
{ … }
static bool ili210x_check_continue_polling(const u8 *data, bool touch)
{ … }
static const struct ili2xxx_chip ili210x_chip = …;
static int ili211x_read_touch_data(struct i2c_client *client, u8 *data)
{ … }
static bool ili211x_touchdata_to_coords(const u8 *touchdata,
unsigned int finger,
unsigned int *x, unsigned int *y,
unsigned int *z)
{ … }
static bool ili211x_decline_polling(const u8 *data, bool touch)
{ … }
static const struct ili2xxx_chip ili211x_chip = …;
static bool ili212x_touchdata_to_coords(const u8 *touchdata,
unsigned int finger,
unsigned int *x, unsigned int *y,
unsigned int *z)
{ … }
static bool ili212x_check_continue_polling(const u8 *data, bool touch)
{ … }
static const struct ili2xxx_chip ili212x_chip = …;
static int ili251x_read_reg_common(struct i2c_client *client,
u8 reg, void *buf, size_t len,
unsigned int delay)
{ … }
static int ili251x_read_reg(struct i2c_client *client,
u8 reg, void *buf, size_t len)
{ … }
static int ili251x_read_touch_data(struct i2c_client *client, u8 *data)
{ … }
static bool ili251x_touchdata_to_coords(const u8 *touchdata,
unsigned int finger,
unsigned int *x, unsigned int *y,
unsigned int *z)
{ … }
static bool ili251x_check_continue_polling(const u8 *data, bool touch)
{ … }
static const struct ili2xxx_chip ili251x_chip = …;
static bool ili210x_report_events(struct ili210x *priv, u8 *touchdata)
{ … }
static irqreturn_t ili210x_irq(int irq, void *irq_data)
{ … }
static int ili251x_firmware_update_resolution(struct device *dev)
{ … }
static ssize_t ili251x_firmware_update_firmware_version(struct device *dev)
{ … }
static ssize_t ili251x_firmware_update_kernel_version(struct device *dev)
{ … }
static ssize_t ili251x_firmware_update_protocol_version(struct device *dev)
{ … }
static ssize_t ili251x_firmware_update_ic_mode(struct device *dev)
{ … }
static int ili251x_firmware_update_cached_state(struct device *dev)
{ … }
static ssize_t ili251x_firmware_version_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(firmware_version, 0444, ili251x_firmware_version_show, NULL);
static ssize_t ili251x_kernel_version_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(kernel_version, 0444, ili251x_kernel_version_show, NULL);
static ssize_t ili251x_protocol_version_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{ … }
static DEVICE_ATTR(protocol_version, 0444, ili251x_protocol_version_show, NULL);
static ssize_t ili251x_mode_show(struct device *dev,
struct device_attribute *attr, char *buf)
{ … }
static DEVICE_ATTR(mode, 0444, ili251x_mode_show, NULL);
static ssize_t ili210x_calibrate(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(calibrate, S_IWUSR, NULL, ili210x_calibrate);
static const u8 *ili251x_firmware_to_buffer(const struct firmware *fw,
u16 *ac_end, u16 *df_end)
{ … }
static int ili251x_switch_ic_mode(struct i2c_client *client, u8 cmd_mode)
{ … }
static int ili251x_firmware_busy(struct i2c_client *client)
{ … }
static int ili251x_firmware_write_to_ic(struct device *dev, const u8 *fwbuf,
u16 start, u16 end, u8 dataflash)
{ … }
static int ili251x_firmware_reset(struct i2c_client *client)
{ … }
static void ili210x_hardware_reset(struct gpio_desc *reset_gpio)
{ … }
static int ili210x_do_firmware_update(struct ili210x *priv,
const u8 *fwbuf, u16 ac_end, u16 df_end)
{ … }
static ssize_t ili210x_firmware_update_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{ … }
static DEVICE_ATTR(firmware_update, 0200, NULL, ili210x_firmware_update_store);
static struct attribute *ili210x_attrs[] = …;
static umode_t ili210x_attributes_visible(struct kobject *kobj,
struct attribute *attr, int index)
{ … }
static const struct attribute_group ili210x_group = …;
__ATTRIBUTE_GROUPS(…);
static void ili210x_power_down(void *data)
{ … }
static void ili210x_stop(void *data)
{ … }
static int ili210x_i2c_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id ili210x_i2c_id[] = …;
MODULE_DEVICE_TABLE(i2c, ili210x_i2c_id);
static const struct of_device_id ili210x_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, ili210x_dt_ids);
static struct i2c_driver ili210x_ts_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;