linux/drivers/input/touchscreen/ilitek_ts_i2c.c

// SPDX-License-Identifier: GPL-2.0
/*
 * ILITEK Touch IC driver for 23XX, 25XX and Lego series
 *
 * Copyright (C) 2011 ILI Technology Corporation.
 * Copyright (C) 2020 Luca Hsu <[email protected]>
 * Copyright (C) 2021 Joe Hung <[email protected]>
 */

#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/i2c.h>
#include <linux/slab.h>
#include <linux/delay.h>
#include <linux/interrupt.h>
#include <linux/gpio/consumer.h>
#include <linux/errno.h>
#include <linux/acpi.h>
#include <linux/input/touchscreen.h>
#include <linux/unaligned.h>


#define ILITEK_TS_NAME
#define BL_V1_8
#define BL_V1_7
#define BL_V1_6

#define ILITEK_TP_CMD_GET_TP_RES
#define ILITEK_TP_CMD_GET_SCRN_RES
#define ILITEK_TP_CMD_SET_IC_SLEEP
#define ILITEK_TP_CMD_SET_IC_WAKE
#define ILITEK_TP_CMD_GET_FW_VER
#define ILITEK_TP_CMD_GET_PRL_VER
#define ILITEK_TP_CMD_GET_MCU_VER
#define ILITEK_TP_CMD_GET_IC_MODE

#define ILITEK_TP_I2C_REPORT_ID

#define REPORT_COUNT_ADDRESS
#define ILITEK_SUPPORT_MAX_POINT

struct ilitek_protocol_info {};

struct ilitek_ts_data {};

struct ilitek_protocol_map {};

enum ilitek_cmds {};

/* ILITEK I2C R/W APIs */
static int ilitek_i2c_write_and_read(struct ilitek_ts_data *ts,
				     u8 *cmd, int write_len, int delay,
				     u8 *data, int read_len)
{}

/* ILITEK ISR APIs */
static void ilitek_touch_down(struct ilitek_ts_data *ts, unsigned int id,
			      unsigned int x, unsigned int y)
{}

static int ilitek_process_and_report_v6(struct ilitek_ts_data *ts)
{}

/* APIs of cmds for ILITEK Touch IC */
static int api_protocol_set_cmd(struct ilitek_ts_data *ts,
				u16 idx, u8 *inbuf, u8 *outbuf)
{}

static int api_protocol_get_ptl_ver(struct ilitek_ts_data *ts,
				    u16 cmd, u8 *inbuf, u8 *outbuf)
{}

static int api_protocol_get_mcu_ver(struct ilitek_ts_data *ts,
				    u16 cmd, u8 *inbuf, u8 *outbuf)
{}

static int api_protocol_get_fw_ver(struct ilitek_ts_data *ts,
				   u16 cmd, u8 *inbuf, u8 *outbuf)
{}

static int api_protocol_get_scrn_res(struct ilitek_ts_data *ts,
				     u16 cmd, u8 *inbuf, u8 *outbuf)
{}

static int api_protocol_get_tp_res(struct ilitek_ts_data *ts,
				   u16 cmd, u8 *inbuf, u8 *outbuf)
{}

static int api_protocol_get_ic_mode(struct ilitek_ts_data *ts,
				    u16 cmd, u8 *inbuf, u8 *outbuf)
{}

static int api_protocol_set_ic_sleep(struct ilitek_ts_data *ts,
				     u16 cmd, u8 *inbuf, u8 *outbuf)
{}

static int api_protocol_set_ic_wake(struct ilitek_ts_data *ts,
				    u16 cmd, u8 *inbuf, u8 *outbuf)
{}

static const struct ilitek_protocol_map ptl_func_map[] =;

/* Probe APIs */
static void ilitek_reset(struct ilitek_ts_data *ts, int delay)
{}

static int ilitek_protocol_init(struct ilitek_ts_data *ts)
{}

static int ilitek_read_tp_info(struct ilitek_ts_data *ts, bool boot)
{}

static int ilitek_input_dev_init(struct device *dev, struct ilitek_ts_data *ts)
{}

static irqreturn_t ilitek_i2c_isr(int irq, void *dev_id)
{}

static ssize_t firmware_version_show(struct device *dev,
				     struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(firmware_version);

static ssize_t product_id_show(struct device *dev,
			       struct device_attribute *attr, char *buf)
{}
static DEVICE_ATTR_RO(product_id);

static struct attribute *ilitek_sysfs_attrs[] =;
ATTRIBUTE_GROUPS();

static int ilitek_ts_i2c_probe(struct i2c_client *client)
{}

static int ilitek_suspend(struct device *dev)
{}

static int ilitek_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(ilitek_pm_ops, ilitek_suspend, ilitek_resume);

static const struct i2c_device_id ilitek_ts_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, ilitek_ts_i2c_id);

#ifdef CONFIG_ACPI
static const struct acpi_device_id ilitekts_acpi_id[] =;
MODULE_DEVICE_TABLE(acpi, ilitekts_acpi_id);
#endif

#ifdef CONFIG_OF
static const struct of_device_id ilitek_ts_i2c_match[] =;
MODULE_DEVICE_TABLE(of, ilitek_ts_i2c_match);
#endif

static struct i2c_driver ilitek_ts_i2c_driver =;
module_i2c_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();