#include <linux/unaligned.h>
#include <linux/delay.h>
#include <linux/hid.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/of.h>
#include <linux/sizes.h>
#include <linux/spi/spi.h>
#define GOODIX_DEV_CONFIRM_ADDR …
#define GOODIX_HID_DESC_ADDR …
#define GOODIX_HID_REPORT_DESC_ADDR …
#define GOODIX_HID_SIGN_ADDR …
#define GOODIX_HID_GET_REPORT_CMD …
#define GOODIX_HID_SET_REPORT_CMD …
#define GOODIX_HID_MAX_INBUF_SIZE …
#define GOODIX_HID_ACK_READY_FLAG …
#define GOODIX_HID_REPORT_READY_FLAG …
#define GOODIX_DEV_CONFIRM_VAL …
#define GOODIX_SPI_WRITE_FLAG …
#define GOODIX_SPI_READ_FLAG …
#define GOODIX_SPI_TRANS_PREFIX_LEN …
#define GOODIX_REGISTER_WIDTH …
#define GOODIX_SPI_READ_DUMMY_LEN …
#define GOODIX_SPI_READ_PREFIX_LEN …
#define GOODIX_SPI_WRITE_PREFIX_LEN …
#define GOODIX_CHECKSUM_SIZE …
#define GOODIX_NORMAL_RESET_DELAY_MS …
struct goodix_hid_report_header { … } __packed;
#define GOODIX_HID_ACK_HEADER_SIZE …
struct goodix_hid_report_package { … };
#define GOODIX_HID_PKG_LEN_SIZE …
#define GOODIX_HID_COOR_DATA_LEN …
#define GOODIX_HID_COOR_PKG_LEN …
#define GOODIX_SPI_POWER_ON …
#define GOODIX_SPI_POWER_SLEEP …
#define GOODIX_HID_STARTED …
struct goodix_hid_report_event { … } __packed;
struct goodix_hid_desc { … } __packed;
struct goodix_ts_data { … };
static void *goodix_get_event_report(struct goodix_ts_data *ts, u32 addr,
u8 *data, size_t len)
{ … }
static int goodix_spi_read(struct goodix_ts_data *ts, u32 addr,
void *data, size_t len)
{ … }
static int goodix_spi_write(struct goodix_ts_data *ts, u32 addr,
const void *data, size_t len)
{ … }
static int goodix_dev_confirm(struct goodix_ts_data *ts)
{ … }
static int goodix_hid_parse(struct hid_device *hid)
{ … }
static int goodix_hid_get_report_length(struct hid_report *report)
{ … }
static void goodix_hid_find_max_report(struct hid_device *hid, unsigned int type,
unsigned int *max)
{ … }
static int goodix_hid_start(struct hid_device *hid)
{ … }
static void goodix_hid_stop(struct hid_device *hid)
{ … }
static int goodix_hid_open(struct hid_device *hid)
{ … }
static void goodix_hid_close(struct hid_device *hid)
{ … }
static int goodix_hid_check_ack_status(struct goodix_ts_data *ts, u32 *resp_len)
{ … }
static int goodix_hid_get_raw_report(struct hid_device *hid,
unsigned char reportnum,
u8 *buf, size_t len,
unsigned char report_type)
{ … }
static int goodix_hid_set_raw_report(struct hid_device *hid,
unsigned char reportnum,
__u8 *buf, size_t len,
unsigned char report_type)
{ … }
static int goodix_hid_raw_request(struct hid_device *hid,
unsigned char reportnum,
__u8 *buf, size_t len,
unsigned char rtype, int reqtype)
{ … }
static struct hid_ll_driver goodix_hid_ll_driver = …;
static irqreturn_t goodix_hid_irq(int irq, void *data)
{ … }
static int goodix_hid_init(struct goodix_ts_data *ts)
{ … }
static int goodix_spi_probe(struct spi_device *spi)
{ … }
static void goodix_spi_remove(struct spi_device *spi)
{ … }
static int goodix_spi_set_power(struct goodix_ts_data *ts, int power_state)
{ … }
static int goodix_spi_suspend(struct device *dev)
{ … }
static int goodix_spi_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(goodix_spi_pm_ops,
goodix_spi_suspend, goodix_spi_resume);
#ifdef CONFIG_ACPI
static const struct acpi_device_id goodix_spi_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, goodix_spi_acpi_match);
#endif
static const struct spi_device_id goodix_spi_ids[] = …;
MODULE_DEVICE_TABLE(spi, goodix_spi_ids);
static struct spi_driver goodix_spi_driver = …;
module_spi_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;