#include <linux/kernel.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/slab.h>
#include <linux/spi/spi.h>
#include <linux/acpi.h>
#include <linux/unaligned.h>
#define SURFACE3_PACKET_SIZE …
#define SURFACE3_REPORT_TOUCH …
#define SURFACE3_REPORT_PEN …
struct surface3_ts_data { … };
struct surface3_ts_data_finger { … } __packed;
struct surface3_ts_data_pen { … } __packed;
static int surface3_spi_read(struct surface3_ts_data *ts_data)
{ … }
static void surface3_spi_report_touch(struct surface3_ts_data *ts_data,
struct surface3_ts_data_finger *finger)
{ … }
static void surface3_spi_process_touch(struct surface3_ts_data *ts_data, u8 *data)
{ … }
static void surface3_spi_report_pen(struct surface3_ts_data *ts_data,
struct surface3_ts_data_pen *pen)
{ … }
static void surface3_spi_process_pen(struct surface3_ts_data *ts_data, u8 *data)
{ … }
static void surface3_spi_process(struct surface3_ts_data *ts_data)
{ … }
static irqreturn_t surface3_spi_irq_handler(int irq, void *dev_id)
{ … }
static void surface3_spi_power(struct surface3_ts_data *data, bool on)
{ … }
static int surface3_spi_get_gpio_config(struct surface3_ts_data *data)
{ … }
static int surface3_spi_create_touch_input(struct surface3_ts_data *data)
{ … }
static int surface3_spi_create_pen_input(struct surface3_ts_data *data)
{ … }
static int surface3_spi_probe(struct spi_device *spi)
{ … }
static int surface3_spi_suspend(struct device *dev)
{ … }
static int surface3_spi_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops,
surface3_spi_suspend,
surface3_spi_resume);
#ifdef CONFIG_ACPI
static const struct acpi_device_id surface3_spi_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, surface3_spi_acpi_match);
#endif
static struct spi_driver surface3_spi_driver = …;
module_spi_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;