linux/drivers/input/touchscreen/sis_i2c.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Touch Screen driver for SiS 9200 family I2C Touch panels
 *
 * Copyright (C) 2015 SiS, Inc.
 * Copyright (C) 2016 Nextfour Group
 */

#include <linux/crc-itu-t.h>
#include <linux/delay.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/interrupt.h>
#include <linux/gpio/consumer.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/unaligned.h>

#define SIS_I2C_NAME

/*
 * The I2C packet format:
 * le16		byte count
 * u8		Report ID
 * <contact data - variable length>
 * u8		Number of contacts
 * le16		Scan Time (optional)
 * le16		CRC
 *
 * One touch point information consists of 6+ bytes, the order is:
 * u8		contact state
 * u8		finger id
 * le16		x axis
 * le16		y axis
 * u8		contact width (optional)
 * u8		contact height (optional)
 * u8		pressure (optional)
 *
 * Maximum amount of data transmitted in one shot is 64 bytes, if controller
 * needs to report more contacts than fit in one packet it will send true
 * number of contacts in first packet and 0 as number of contacts in second
 * packet.
 */

#define SIS_MAX_PACKET_SIZE

#define SIS_PKT_LEN_OFFSET
#define SIS_PKT_REPORT_OFFSET
#define SIS_PKT_CONTACT_OFFSET

#define SIS_SCAN_TIME_LEN

/* Supported report types */
#define SIS_ALL_IN_ONE_PACKAGE
#define SIS_PKT_IS_TOUCH(x)
#define SIS_PKT_IS_HIDI2C(x)

/* Contact properties within report */
#define SIS_PKT_HAS_AREA(x)
#define SIS_PKT_HAS_PRESSURE(x)
#define SIS_PKT_HAS_SCANTIME(x)

/* Contact size */
#define SIS_BASE_LEN_PER_CONTACT
#define SIS_AREA_LEN_PER_CONTACT
#define SIS_PRESSURE_LEN_PER_CONTACT

/* Offsets within contact data */
#define SIS_CONTACT_STATUS_OFFSET
#define SIS_CONTACT_ID_OFFSET
#define SIS_CONTACT_X_OFFSET
#define SIS_CONTACT_Y_OFFSET
#define SIS_CONTACT_WIDTH_OFFSET
#define SIS_CONTACT_HEIGHT_OFFSET
#define SIS_CONTACT_PRESSURE_OFFSET(id)

/* Individual contact state */
#define SIS_STATUS_UP
#define SIS_STATUS_DOWN

/* Touchscreen parameters */
#define SIS_MAX_FINGERS
#define SIS_MAX_X
#define SIS_MAX_Y
#define SIS_MAX_PRESSURE

/* Resolution diagonal */
#define SIS_AREA_LENGTH_LONGER
/*((SIS_MAX_X^2) + (SIS_MAX_Y^2))^0.5*/
#define SIS_AREA_LENGTH_SHORT
#define SIS_AREA_UNIT

struct sis_ts_data {};

static int sis_read_packet(struct i2c_client *client, u8 *buf,
			   unsigned int *num_contacts,
			   unsigned int *contact_size)
{}

static int sis_ts_report_contact(struct sis_ts_data *ts, const u8 *data, u8 id)
{}

static void sis_ts_handle_packet(struct sis_ts_data *ts)
{}

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

static void sis_ts_reset(struct sis_ts_data *ts)
{}

static int sis_ts_probe(struct i2c_client *client)
{}

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

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

static struct i2c_driver sis_ts_driver =;
module_i2c_driver();

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