linux/drivers/input/touchscreen/cyttsp5.c

// SPDX-License-Identifier: GPL-2.0
/*
 * Parade TrueTouch(TM) Standard Product V5 Module.
 *
 * Copyright (C) 2015 Parade Technologies
 * Copyright (C) 2012-2015 Cypress Semiconductor
 * Copyright (C) 2018 Bootlin
 *
 * Authors: Mylène Josserand <[email protected]>
 *                Alistair Francis <[email protected]>
 */

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

#define CYTTSP5_NAME
#define CY_I2C_DATA_SIZE
#define HID_VERSION
#define CY_MAX_INPUT
#define CYTTSP5_PREALLOCATED_CMD_BUFFER
#define CY_BITS_PER_BTN
#define CY_NUM_BTN_EVENT_ID

#define MAX_AREA
#define HID_OUTPUT_BL_SOP
#define HID_OUTPUT_BL_EOP
#define HID_OUTPUT_BL_LAUNCH_APP
#define HID_OUTPUT_BL_LAUNCH_APP_SIZE
#define HID_OUTPUT_GET_SYSINFO
#define HID_OUTPUT_GET_SYSINFO_SIZE
#define HID_OUTPUT_MAX_CMD_SIZE

#define HID_DESC_REG
#define HID_INPUT_REG
#define HID_OUTPUT_REG
#define HID_COMMAND_REG

#define REPORT_ID_TOUCH
#define REPORT_ID_BTN
#define REPORT_SIZE_5
#define REPORT_SIZE_8
#define REPORT_SIZE_16

/* Touch reports offsets */
/* Header offsets */
#define TOUCH_REPORT_DESC_HDR_CONTACTCOUNT
/* Record offsets */
#define TOUCH_REPORT_DESC_CONTACTID
#define TOUCH_REPORT_DESC_X
#define TOUCH_REPORT_DESC_Y
#define TOUCH_REPORT_DESC_P
#define TOUCH_REPORT_DESC_MAJ
#define TOUCH_REPORT_DESC_MIN

/* HID */
#define HID_TOUCH_REPORT_ID
#define HID_BTN_REPORT_ID
#define HID_APP_RESPONSE_REPORT_ID
#define HID_APP_OUTPUT_REPORT_ID
#define HID_BL_RESPONSE_REPORT_ID
#define HID_BL_OUTPUT_REPORT_ID
#define HID_RESPONSE_REPORT_ID

#define HID_OUTPUT_RESPONSE_REPORT_OFFSET
#define HID_OUTPUT_RESPONSE_CMD_OFFSET
#define HID_OUTPUT_RESPONSE_CMD_MASK

#define HID_SYSINFO_SENSING_OFFSET
#define HID_SYSINFO_BTN_OFFSET
#define HID_SYSINFO_BTN_MASK
#define HID_SYSINFO_MAX_BTN

#define HID_CMD_SET_POWER

#define HID_POWER_ON
#define HID_POWER_SLEEP

#define CY_HID_OUTPUT_TIMEOUT_MS
#define CY_HID_OUTPUT_GET_SYSINFO_TIMEOUT_MS
#define CY_HID_GET_HID_DESCRIPTOR_TIMEOUT_MS
#define CY_HID_SET_POWER_TIMEOUT

/* maximum number of concurrent tracks */
#define TOUCH_REPORT_SIZE
#define TOUCH_INPUT_HEADER_SIZE
#define BTN_REPORT_SIZE
#define BTN_INPUT_HEADER_SIZE

#define MAX_CY_TCH_T_IDS

/* All usage pages for Touch Report */
#define TOUCH_REPORT_USAGE_PG_X
#define TOUCH_REPORT_USAGE_PG_Y
#define TOUCH_REPORT_USAGE_PG_P
#define TOUCH_REPORT_USAGE_PG_CONTACTID
#define TOUCH_REPORT_USAGE_PG_CONTACTCOUNT
#define TOUCH_REPORT_USAGE_PG_MAJ
#define TOUCH_REPORT_USAGE_PG_MIN
#define TOUCH_COL_USAGE_PG

#define SET_CMD_LOW(byte, bits)
#define SET_CMD_HIGH(byte, bits)
#define SET_CMD_OPCODE(byte, opcode)
#define SET_CMD_REPORT_TYPE(byte, type)
#define SET_CMD_REPORT_ID(byte, id)

/* System Information interface definitions */
struct cyttsp5_sensing_conf_data_dev {} __packed;

struct cyttsp5_sensing_conf_data {};

enum cyttsp5_tch_abs {};

struct cyttsp5_tch_abs_params {};

struct cyttsp5_touch {};

struct cyttsp5_sysinfo {};

struct cyttsp5_hid_desc {} __packed;

struct cyttsp5 {};

/*
 * For what is understood in the datasheet, the register does not
 * matter. For consistency, use the Input Register address
 * but it does mean anything to the device. The important data
 * to send is the I2C address
 */
static int cyttsp5_read(struct cyttsp5 *ts, u8 *buf, u32 max)
{}

static int cyttsp5_write(struct cyttsp5 *ts, unsigned int reg, u8 *data,
			 size_t size)
{}

static void cyttsp5_get_touch_axis(int *axis, int size, int max, u8 *xy_data,
				   int bofs)
{}

static void cyttsp5_get_touch_record(struct cyttsp5 *ts,
				     struct cyttsp5_touch *touch, u8 *xy_data)
{}

static void cyttsp5_get_mt_touches(struct cyttsp5 *ts,
				   struct cyttsp5_touch *tch, int num_cur_tch)
{}

static int cyttsp5_mt_attention(struct device *dev)
{}

static int cyttsp5_setup_input_device(struct device *dev)
{}

static int cyttsp5_parse_dt_key_code(struct device *dev)
{}

static int cyttsp5_btn_attention(struct device *dev)
{}

static int cyttsp5_validate_cmd_response(struct cyttsp5 *ts, u8 code)
{}

static void cyttsp5_si_get_btn_data(struct cyttsp5 *ts)
{}

static int cyttsp5_get_sysinfo_regs(struct cyttsp5 *ts)
{}

static int cyttsp5_hid_output_get_sysinfo(struct cyttsp5 *ts)
{}

static int cyttsp5_power_control(struct cyttsp5 *ts, bool on)
{}

static int cyttsp5_hid_output_bl_launch_app(struct cyttsp5 *ts)
{}

static int cyttsp5_get_hid_descriptor(struct cyttsp5 *ts,
				      struct cyttsp5_hid_desc *desc)
{}

static int fill_tch_abs(struct cyttsp5_tch_abs_params *tch_abs, int report_size,
			int offset)
{}

static irqreturn_t cyttsp5_handle_irq(int irq, void *handle)
{}

static int cyttsp5_deassert_int(struct cyttsp5 *ts)
{}

static int cyttsp5_fill_all_touch(struct cyttsp5 *ts)
{}

static int cyttsp5_startup(struct cyttsp5 *ts)
{}

static void cyttsp5_cleanup(void *data)
{}

static int cyttsp5_probe(struct device *dev, struct regmap *regmap, int irq,
			 const char *name)
{}

static int cyttsp5_i2c_probe(struct i2c_client *client)
{}

static const struct of_device_id cyttsp5_of_match[] =;
MODULE_DEVICE_TABLE(of, cyttsp5_of_match);

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

static int __maybe_unused cyttsp5_suspend(struct device *dev)
{}

static int __maybe_unused cyttsp5_resume(struct device *dev)
{}

static SIMPLE_DEV_PM_OPS(cyttsp5_pm, cyttsp5_suspend, cyttsp5_resume);

static struct i2c_driver cyttsp5_i2c_driver =;
module_i2c_driver();

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