#include <linux/delay.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/input/touchscreen.h>
#include <linux/irq.h>
#include <linux/regulator/consumer.h>
#include <linux/regmap.h>
#include <linux/unaligned.h>
#define HY46XX_CHKSUM_CODE …
#define HY46XX_FINGER_NUM …
#define HY46XX_CHKSUM_LEN …
#define HY46XX_THRESHOLD …
#define HY46XX_GLOVE_EN …
#define HY46XX_REPORT_SPEED …
#define HY46XX_PWR_NOISE_EN …
#define HY46XX_FILTER_DATA …
#define HY46XX_GAIN …
#define HY46XX_EDGE_OFFSET …
#define HY46XX_RX_NR_USED …
#define HY46XX_TX_NR_USED …
#define HY46XX_PWR_MODE …
#define HY46XX_FW_VERSION …
#define HY46XX_LIB_VERSION …
#define HY46XX_TP_INFO …
#define HY46XX_TP_CHIP_ID …
#define HY46XX_BOOT_VER …
#define HY46XX_TPLEN …
#define HY46XX_REPORT_PKT_LEN …
#define HY46XX_MAX_SUPPORTED_POINTS …
#define TOUCH_EVENT_DOWN …
#define TOUCH_EVENT_UP …
#define TOUCH_EVENT_CONTACT …
#define TOUCH_EVENT_RESERVED …
struct hycon_hy46xx_data { … };
static const struct regmap_config hycon_hy46xx_i2c_regmap_config = …;
static bool hycon_hy46xx_check_checksum(struct hycon_hy46xx_data *tsdata, u8 *buf)
{ … }
static irqreturn_t hycon_hy46xx_isr(int irq, void *dev_id)
{ … }
struct hycon_hy46xx_attribute { … };
#define HYCON_ATTR_U8(_field, _mode, _address, _limit_low, _limit_high) …
#define HYCON_ATTR_BOOL(_field, _mode, _address) …
static ssize_t hycon_hy46xx_setting_show(struct device *dev,
struct device_attribute *dattr, char *buf)
{ … }
static ssize_t hycon_hy46xx_setting_store(struct device *dev,
struct device_attribute *dattr,
const char *buf, size_t count)
{ … }
static HYCON_ATTR_U8(threshold, 0644, HY46XX_THRESHOLD, 0, 255);
static HYCON_ATTR_BOOL(glove_enable, 0644, HY46XX_GLOVE_EN);
static HYCON_ATTR_U8(report_speed, 0644, HY46XX_REPORT_SPEED, 0, 255);
static HYCON_ATTR_BOOL(noise_filter_enable, 0644, HY46XX_PWR_NOISE_EN);
static HYCON_ATTR_U8(filter_data, 0644, HY46XX_FILTER_DATA, 0, 5);
static HYCON_ATTR_U8(gain, 0644, HY46XX_GAIN, 0, 5);
static HYCON_ATTR_U8(edge_offset, 0644, HY46XX_EDGE_OFFSET, 0, 5);
static HYCON_ATTR_U8(fw_version, 0444, HY46XX_FW_VERSION, 0, 255);
static HYCON_ATTR_U8(lib_version, 0444, HY46XX_LIB_VERSION, 0, 255);
static HYCON_ATTR_U8(tp_information, 0444, HY46XX_TP_INFO, 0, 255);
static HYCON_ATTR_U8(tp_chip_id, 0444, HY46XX_TP_CHIP_ID, 0, 255);
static HYCON_ATTR_U8(bootloader_version, 0444, HY46XX_BOOT_VER, 0, 255);
static struct attribute *hycon_hy46xx_attrs[] = …;
ATTRIBUTE_GROUPS(…);
static void hycon_hy46xx_get_defaults(struct device *dev, struct hycon_hy46xx_data *tsdata)
{ … }
static void hycon_hy46xx_get_parameters(struct hycon_hy46xx_data *tsdata)
{ … }
static void hycon_hy46xx_disable_regulator(void *arg)
{ … }
static int hycon_hy46xx_probe(struct i2c_client *client)
{ … }
static const struct i2c_device_id hycon_hy46xx_id[] = …;
MODULE_DEVICE_TABLE(i2c, hycon_hy46xx_id);
static const struct of_device_id hycon_hy46xx_of_match[] = …;
MODULE_DEVICE_TABLE(of, hycon_hy46xx_of_match);
static struct i2c_driver hycon_hy46xx_driver = …;
module_i2c_driver(…) …;
MODULE_AUTHOR(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_LICENSE(…) …;