linux/drivers/input/touchscreen/iqs7211.c

// SPDX-License-Identifier: GPL-2.0-or-later
/*
 * Azoteq IQS7210A/7211A/E Trackpad/Touchscreen Controller
 *
 * Copyright (C) 2023 Jeff LaBundy <[email protected]>
 */

#include <linux/bits.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/gpio/consumer.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/iopoll.h>
#include <linux/kernel.h>
#include <linux/list.h>
#include <linux/module.h>
#include <linux/of_device.h>
#include <linux/property.h>
#include <linux/slab.h>
#include <linux/unaligned.h>

#define IQS7211_PROD_NUM

#define IQS7211_EVENT_MASK_ALL
#define IQS7211_EVENT_MASK_ALP
#define IQS7211_EVENT_MASK_BTN
#define IQS7211_EVENT_MASK_ATI
#define IQS7211_EVENT_MASK_MOVE
#define IQS7211_EVENT_MASK_GSTR
#define IQS7211_EVENT_MODE

#define IQS7211_COMMS_ERROR
#define IQS7211_COMMS_RETRY_MS
#define IQS7211_COMMS_SLEEP_US
#define IQS7211_COMMS_TIMEOUT_US
#define IQS7211_RESET_TIMEOUT_MS
#define IQS7211_START_TIMEOUT_US

#define IQS7211_NUM_RETRIES
#define IQS7211_NUM_CRX
#define IQS7211_MAX_CTX

#define IQS7211_MAX_CONTACTS
#define IQS7211_MAX_CYCLES

/*
 * The following delay is used during instances that must wait for the open-
 * drain RDY pin to settle. Its value is calculated as 5*R*C, where R and C
 * represent typical datasheet values of 4.7k and 100 nF, respectively.
 */
#define iqs7211_irq_wait()

enum iqs7211_dev_id {};

enum iqs7211_comms_mode {};

struct iqs7211_reg_field_desc {};

enum iqs7211_reg_key_id {};

enum iqs7211_reg_grp_id {};

static const char * const iqs7211_reg_grp_names[IQS7211_NUM_REG_GRPS] =;

static const u16 iqs7211_reg_grp_masks[IQS7211_NUM_REG_GRPS] =;

struct iqs7211_event_desc {};

static const struct iqs7211_event_desc iqs7210a_kp_events[] =;

static const struct iqs7211_event_desc iqs7211a_kp_events[] =;

static const struct iqs7211_event_desc iqs7211e_kp_events[] =;

struct iqs7211_dev_desc {};

static const struct iqs7211_dev_desc iqs7211_devs[] =;

struct iqs7211_prop_desc {};

static const struct iqs7211_prop_desc iqs7211_props[] =;

static const u8 iqs7211_gesture_angle[] =;

struct iqs7211_ver_info {} __packed;

struct iqs7211_touch_data {} __packed;

struct iqs7211_tp_config {} __packed;

struct iqs7211_private {};

static int iqs7211_irq_poll(struct iqs7211_private *iqs7211, u64 timeout_us)
{}

static int iqs7211_hard_reset(struct iqs7211_private *iqs7211)
{}

static int iqs7211_force_comms(struct iqs7211_private *iqs7211)
{}

static int iqs7211_read_burst(struct iqs7211_private *iqs7211,
			      u8 reg, void *val, u16 val_len)
{}

static int iqs7211_read_word(struct iqs7211_private *iqs7211, u8 reg, u16 *val)
{}

static int iqs7211_write_burst(struct iqs7211_private *iqs7211,
			       u8 reg, const void *val, u16 val_len)
{}

static int iqs7211_write_word(struct iqs7211_private *iqs7211, u8 reg, u16 val)
{}

static int iqs7211_start_comms(struct iqs7211_private *iqs7211)
{}

static int iqs7211_init_device(struct iqs7211_private *iqs7211)
{}

static int iqs7211_add_field(struct iqs7211_private *iqs7211,
			     struct iqs7211_reg_field_desc new_field)
{}

static int iqs7211_parse_props(struct iqs7211_private *iqs7211,
			       struct fwnode_handle *reg_grp_node,
			       enum iqs7211_reg_grp_id reg_grp,
			       enum iqs7211_reg_key_id reg_key)
{}

static int iqs7211_parse_event(struct iqs7211_private *iqs7211,
			       struct fwnode_handle *event_node,
			       enum iqs7211_reg_grp_id reg_grp,
			       enum iqs7211_reg_key_id reg_key,
			       unsigned int *event_code)
{}

static int iqs7211_parse_cycles(struct iqs7211_private *iqs7211,
				struct fwnode_handle *tp_node)
{}

static int iqs7211_parse_tp(struct iqs7211_private *iqs7211,
			    struct fwnode_handle *tp_node)
{}

static int iqs7211_parse_alp(struct iqs7211_private *iqs7211,
			     struct fwnode_handle *alp_node)
{}

static int (*iqs7211_parse_extra[IQS7211_NUM_REG_GRPS])
				(struct iqs7211_private *iqs7211,
				 struct fwnode_handle *reg_grp_node) =;

static int iqs7211_parse_reg_grp(struct iqs7211_private *iqs7211,
				 struct fwnode_handle *reg_grp_node,
				 enum iqs7211_reg_grp_id reg_grp)
{}

static int iqs7211_register_kp(struct iqs7211_private *iqs7211)
{}

static int iqs7211_register_tp(struct iqs7211_private *iqs7211)
{}

static int iqs7211_report(struct iqs7211_private *iqs7211)
{}

static irqreturn_t iqs7211_irq(int irq, void *context)
{}

static int iqs7211_suspend(struct device *dev)
{}

static int iqs7211_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(iqs7211_pm, iqs7211_suspend, iqs7211_resume);

static ssize_t fw_info_show(struct device *dev,
			    struct device_attribute *attr, char *buf)
{}

static DEVICE_ATTR_RO(fw_info);

static struct attribute *iqs7211_attrs[] =;
ATTRIBUTE_GROUPS();

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

static int iqs7211_probe(struct i2c_client *client)
{}

static struct i2c_driver iqs7211_i2c_driver =;
module_i2c_driver();

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