#include <linux/kernel.h>
#include <linux/dmi.h>
#include <linux/firmware.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/irq.h>
#include <linux/interrupt.h>
#include <linux/platform_data/x86/soc.h>
#include <linux/slab.h>
#include <linux/acpi.h>
#include <linux/of.h>
#include <linux/unaligned.h>
#include "goodix.h"
#define GOODIX_GPIO_INT_NAME …
#define GOODIX_GPIO_RST_NAME …
#define GOODIX_MAX_HEIGHT …
#define GOODIX_MAX_WIDTH …
#define GOODIX_INT_TRIGGER …
#define GOODIX_CONTACT_SIZE …
#define GOODIX_MAX_CONTACT_SIZE …
#define GOODIX_MAX_CONTACTS …
#define GOODIX_CONFIG_MIN_LENGTH …
#define GOODIX_CONFIG_911_LENGTH …
#define GOODIX_CONFIG_967_LENGTH …
#define GOODIX_CONFIG_GT9X_LENGTH …
#define GOODIX_BUFFER_STATUS_READY …
#define GOODIX_HAVE_KEY …
#define GOODIX_BUFFER_STATUS_TIMEOUT …
#define RESOLUTION_LOC …
#define MAX_CONTACTS_LOC …
#define TRIGGER_LOC …
#if defined CONFIG_X86 && defined CONFIG_ACPI
#define ACPI_GPIO_SUPPORT
#endif
struct goodix_chip_id { … };
static int goodix_check_cfg_8(struct goodix_ts_data *ts,
const u8 *cfg, int len);
static int goodix_check_cfg_16(struct goodix_ts_data *ts,
const u8 *cfg, int len);
static void goodix_calc_cfg_checksum_8(struct goodix_ts_data *ts);
static void goodix_calc_cfg_checksum_16(struct goodix_ts_data *ts);
static const struct goodix_chip_data gt1x_chip_data = …;
static const struct goodix_chip_data gt911_chip_data = …;
static const struct goodix_chip_data gt967_chip_data = …;
static const struct goodix_chip_data gt9x_chip_data = …;
static const struct goodix_chip_id goodix_chip_ids[] = …;
static const unsigned long goodix_irq_flags[] = …;
static const struct dmi_system_id nine_bytes_report[] = …;
static const struct dmi_system_id inverted_x_screen[] = …;
int goodix_i2c_read(struct i2c_client *client, u16 reg, u8 *buf, int len)
{ … }
int goodix_i2c_write(struct i2c_client *client, u16 reg, const u8 *buf, int len)
{ … }
int goodix_i2c_write_u8(struct i2c_client *client, u16 reg, u8 value)
{ … }
static const struct goodix_chip_data *goodix_get_chip_data(const char *id)
{ … }
static int goodix_ts_read_input_report(struct goodix_ts_data *ts, u8 *data)
{ … }
static int goodix_create_pen_input(struct goodix_ts_data *ts)
{ … }
static void goodix_ts_report_pen_down(struct goodix_ts_data *ts, u8 *data)
{ … }
static void goodix_ts_report_pen_up(struct goodix_ts_data *ts)
{ … }
static void goodix_ts_report_touch_8b(struct goodix_ts_data *ts, u8 *coor_data)
{ … }
static void goodix_ts_report_touch_9b(struct goodix_ts_data *ts, u8 *coor_data)
{ … }
static void goodix_ts_release_keys(struct goodix_ts_data *ts)
{ … }
static void goodix_ts_report_key(struct goodix_ts_data *ts, u8 *data)
{ … }
static void goodix_process_events(struct goodix_ts_data *ts)
{ … }
static irqreturn_t goodix_ts_irq_handler(int irq, void *dev_id)
{ … }
static void goodix_free_irq(struct goodix_ts_data *ts)
{ … }
static int goodix_request_irq(struct goodix_ts_data *ts)
{ … }
static int goodix_check_cfg_8(struct goodix_ts_data *ts, const u8 *cfg, int len)
{ … }
static void goodix_calc_cfg_checksum_8(struct goodix_ts_data *ts)
{ … }
static int goodix_check_cfg_16(struct goodix_ts_data *ts, const u8 *cfg,
int len)
{ … }
static void goodix_calc_cfg_checksum_16(struct goodix_ts_data *ts)
{ … }
static int goodix_check_cfg(struct goodix_ts_data *ts, const u8 *cfg, int len)
{ … }
int goodix_send_cfg(struct goodix_ts_data *ts, const u8 *cfg, int len)
{ … }
#ifdef ACPI_GPIO_SUPPORT
static int goodix_pin_acpi_direction_input(struct goodix_ts_data *ts)
{ … }
static int goodix_pin_acpi_output_method(struct goodix_ts_data *ts, int value)
{ … }
#else
static int goodix_pin_acpi_direction_input(struct goodix_ts_data *ts)
{
dev_err(&ts->client->dev,
"%s called on device without ACPI support\n", __func__);
return -EINVAL;
}
static int goodix_pin_acpi_output_method(struct goodix_ts_data *ts, int value)
{
dev_err(&ts->client->dev,
"%s called on device without ACPI support\n", __func__);
return -EINVAL;
}
#endif
static int goodix_irq_direction_output(struct goodix_ts_data *ts, int value)
{ … }
static int goodix_irq_direction_input(struct goodix_ts_data *ts)
{ … }
int goodix_int_sync(struct goodix_ts_data *ts)
{ … }
int goodix_reset_no_int_sync(struct goodix_ts_data *ts)
{ … }
static int goodix_reset(struct goodix_ts_data *ts)
{ … }
#ifdef ACPI_GPIO_SUPPORT
static const struct acpi_gpio_params first_gpio = …;
static const struct acpi_gpio_params second_gpio = …;
static const struct acpi_gpio_mapping acpi_goodix_int_first_gpios[] = …;
static const struct acpi_gpio_mapping acpi_goodix_int_last_gpios[] = …;
static const struct acpi_gpio_mapping acpi_goodix_reset_only_gpios[] = …;
static int goodix_resource(struct acpi_resource *ares, void *data)
{ … }
static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
{ … }
#else
static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
{
return -EINVAL;
}
#endif
static int goodix_get_gpio_config(struct goodix_ts_data *ts)
{ … }
static void goodix_read_config(struct goodix_ts_data *ts)
{ … }
static int goodix_read_version(struct goodix_ts_data *ts)
{ … }
static int goodix_i2c_test(struct i2c_client *client)
{ … }
static int goodix_configure_dev(struct goodix_ts_data *ts)
{ … }
static void goodix_config_cb(const struct firmware *cfg, void *ctx)
{ … }
static void goodix_disable_regulators(void *arg)
{ … }
static int goodix_ts_probe(struct i2c_client *client)
{ … }
static void goodix_ts_remove(struct i2c_client *client)
{ … }
static int goodix_suspend(struct device *dev)
{ … }
static int goodix_resume(struct device *dev)
{ … }
static DEFINE_SIMPLE_DEV_PM_OPS(goodix_pm_ops, goodix_suspend, goodix_resume);
static const struct i2c_device_id goodix_ts_id[] = …;
MODULE_DEVICE_TABLE(i2c, goodix_ts_id);
#ifdef CONFIG_ACPI
static const struct acpi_device_id goodix_acpi_match[] = …;
MODULE_DEVICE_TABLE(acpi, goodix_acpi_match);
#endif
#ifdef CONFIG_OF
static const struct of_device_id goodix_of_match[] = …;
MODULE_DEVICE_TABLE(of, goodix_of_match);
#endif
static struct i2c_driver goodix_ts_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;