linux/drivers/input/misc/iqs626a.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Azoteq IQS626A Capacitive Touch Controller
 *
 * Copyright (C) 2020 Jeff LaBundy <[email protected]>
 *
 * This driver registers up to 2 input devices: one representing capacitive or
 * inductive keys as well as Hall-effect switches, and one for a trackpad that
 * can express various gestures.
 */

#include <linux/bits.h>
#include <linux/completion.h>
#include <linux/delay.h>
#include <linux/device.h>
#include <linux/err.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/touchscreen.h>
#include <linux/interrupt.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>

#define IQS626_VER_INFO
#define IQS626_VER_INFO_PROD_NUM

#define IQS626_SYS_FLAGS
#define IQS626_SYS_FLAGS_SHOW_RESET
#define IQS626_SYS_FLAGS_IN_ATI
#define IQS626_SYS_FLAGS_PWR_MODE_MASK
#define IQS626_SYS_FLAGS_PWR_MODE_SHIFT

#define IQS626_HALL_OUTPUT

#define IQS626_SYS_SETTINGS
#define IQS626_SYS_SETTINGS_CLK_DIV
#define IQS626_SYS_SETTINGS_ULP_AUTO
#define IQS626_SYS_SETTINGS_DIS_AUTO
#define IQS626_SYS_SETTINGS_PWR_MODE_MASK
#define IQS626_SYS_SETTINGS_PWR_MODE_SHIFT
#define IQS626_SYS_SETTINGS_PWR_MODE_MAX
#define IQS626_SYS_SETTINGS_ULP_UPDATE_MASK
#define IQS626_SYS_SETTINGS_ULP_UPDATE_SHIFT
#define IQS626_SYS_SETTINGS_ULP_UPDATE_MAX
#define IQS626_SYS_SETTINGS_EVENT_MODE
#define IQS626_SYS_SETTINGS_EVENT_MODE_LP
#define IQS626_SYS_SETTINGS_REDO_ATI
#define IQS626_SYS_SETTINGS_ACK_RESET

#define IQS626_MISC_A_ATI_BAND_DISABLE
#define IQS626_MISC_A_TPx_LTA_UPDATE_MASK
#define IQS626_MISC_A_TPx_LTA_UPDATE_SHIFT
#define IQS626_MISC_A_TPx_LTA_UPDATE_MAX
#define IQS626_MISC_A_ATI_LP_ONLY
#define IQS626_MISC_A_GPIO3_SELECT_MASK
#define IQS626_MISC_A_GPIO3_SELECT_MAX

#define IQS626_EVENT_MASK_SYS
#define IQS626_EVENT_MASK_GESTURE
#define IQS626_EVENT_MASK_DEEP
#define IQS626_EVENT_MASK_TOUCH
#define IQS626_EVENT_MASK_PROX

#define IQS626_RATE_NP_MS_MAX
#define IQS626_RATE_LP_MS_MAX
#define IQS626_RATE_ULP_MS_MAX
#define IQS626_TIMEOUT_PWR_MS_MAX
#define IQS626_TIMEOUT_LTA_MS_MAX

#define IQS626_MISC_B_RESEED_UI_SEL_MASK
#define IQS626_MISC_B_RESEED_UI_SEL_SHIFT
#define IQS626_MISC_B_RESEED_UI_SEL_MAX
#define IQS626_MISC_B_THRESH_EXTEND
#define IQS626_MISC_B_TRACKING_UI_ENABLE
#define IQS626_MISC_B_TPx_SWIPE
#define IQS626_MISC_B_RESEED_OFFSET
#define IQS626_MISC_B_FILT_STR_TPx

#define IQS626_THRESH_SWIPE_MAX
#define IQS626_TIMEOUT_TAP_MS_MAX
#define IQS626_TIMEOUT_SWIPE_MS_MAX

#define IQS626_CHx_ENG_0_MEAS_CAP_SIZE
#define IQS626_CHx_ENG_0_RX_TERM_VSS
#define IQS626_CHx_ENG_0_LINEARIZE
#define IQS626_CHx_ENG_0_DUAL_DIR
#define IQS626_CHx_ENG_0_FILT_DISABLE
#define IQS626_CHx_ENG_0_ATI_MODE_MASK
#define IQS626_CHx_ENG_0_ATI_MODE_MAX

#define IQS626_CHx_ENG_1_CCT_HIGH_1
#define IQS626_CHx_ENG_1_CCT_HIGH_0
#define IQS626_CHx_ENG_1_PROJ_BIAS_MASK
#define IQS626_CHx_ENG_1_PROJ_BIAS_SHIFT
#define IQS626_CHx_ENG_1_PROJ_BIAS_MAX
#define IQS626_CHx_ENG_1_CCT_ENABLE
#define IQS626_CHx_ENG_1_SENSE_FREQ_MASK
#define IQS626_CHx_ENG_1_SENSE_FREQ_SHIFT
#define IQS626_CHx_ENG_1_SENSE_FREQ_MAX
#define IQS626_CHx_ENG_1_ATI_BAND_TIGHTEN

#define IQS626_CHx_ENG_2_LOCAL_CAP_MASK
#define IQS626_CHx_ENG_2_LOCAL_CAP_SHIFT
#define IQS626_CHx_ENG_2_LOCAL_CAP_MAX
#define IQS626_CHx_ENG_2_LOCAL_CAP_ENABLE
#define IQS626_CHx_ENG_2_SENSE_MODE_MASK
#define IQS626_CHx_ENG_2_SENSE_MODE_MAX

#define IQS626_CHx_ENG_3_TX_FREQ_MASK
#define IQS626_CHx_ENG_3_TX_FREQ_SHIFT
#define IQS626_CHx_ENG_3_TX_FREQ_MAX
#define IQS626_CHx_ENG_3_INV_LOGIC

#define IQS626_CHx_ENG_4_RX_TERM_VREG
#define IQS626_CHx_ENG_4_CCT_LOW_1
#define IQS626_CHx_ENG_4_CCT_LOW_0
#define IQS626_CHx_ENG_4_COMP_DISABLE
#define IQS626_CHx_ENG_4_STATIC_ENABLE

#define IQS626_TPx_ATI_BASE_MIN
#define IQS626_TPx_ATI_BASE_MAX
#define IQS626_CHx_ATI_BASE_MASK
#define IQS626_CHx_ATI_BASE_75
#define IQS626_CHx_ATI_BASE_100
#define IQS626_CHx_ATI_BASE_150
#define IQS626_CHx_ATI_BASE_200
#define IQS626_CHx_ATI_TARGET_MASK
#define IQS626_CHx_ATI_TARGET_MAX

#define IQS626_CHx_THRESH_MAX
#define IQS626_CHx_HYST_DEEP_MASK
#define IQS626_CHx_HYST_DEEP_SHIFT
#define IQS626_CHx_HYST_TOUCH_MASK
#define IQS626_CHx_HYST_MAX

#define IQS626_FILT_STR_NP_TPx_MASK
#define IQS626_FILT_STR_NP_TPx_SHIFT
#define IQS626_FILT_STR_LP_TPx_MASK
#define IQS626_FILT_STR_LP_TPx_SHIFT

#define IQS626_FILT_STR_NP_CNT_MASK
#define IQS626_FILT_STR_NP_CNT_SHIFT
#define IQS626_FILT_STR_LP_CNT_MASK
#define IQS626_FILT_STR_LP_CNT_SHIFT
#define IQS626_FILT_STR_NP_LTA_MASK
#define IQS626_FILT_STR_NP_LTA_SHIFT
#define IQS626_FILT_STR_LP_LTA_MASK
#define IQS626_FILT_STR_MAX

#define IQS626_ULP_PROJ_ENABLE
#define IQS626_GEN_WEIGHT_MAX

#define IQS626_MAX_REG

#define IQS626_NUM_CH_TP_3
#define IQS626_NUM_CH_TP_2
#define IQS626_NUM_CH_GEN
#define IQS626_NUM_CRx_TX

#define IQS626_PWR_MODE_POLL_SLEEP_US
#define IQS626_PWR_MODE_POLL_TIMEOUT_US

#define iqs626_irq_wait()

enum iqs626_ch_id {};

enum iqs626_rx_inactive {};

enum iqs626_st_offs {};

enum iqs626_th_offs {};

enum iqs626_event_id {};

enum iqs626_gesture_id {};

struct iqs626_event_desc {};

static const struct iqs626_event_desc iqs626_events[] =;

struct iqs626_ver_info {} __packed;

struct iqs626_flags {} __packed;

struct iqs626_ch_reg_ulp {} __packed;

struct iqs626_ch_reg_tp {} __packed;

struct iqs626_tp_grp_reg {} __packed;

struct iqs626_ch_reg_gen {} __packed;

struct iqs626_ch_reg_hall {} __packed;

struct iqs626_sys_reg {} __packed;

struct iqs626_channel_desc {};

static const struct iqs626_channel_desc iqs626_channels[] =;

struct iqs626_private {};

static noinline_for_stack int
iqs626_parse_events(struct iqs626_private *iqs626,
		    struct fwnode_handle *ch_node, enum iqs626_ch_id ch_id)
{}

static noinline_for_stack int
iqs626_parse_ati_target(struct iqs626_private *iqs626,
			struct fwnode_handle *ch_node, enum iqs626_ch_id ch_id)
{}

static int iqs626_parse_pins(struct iqs626_private *iqs626,
			     struct fwnode_handle *ch_node,
			     const char *propname, u8 *enable)
{}

static int iqs626_parse_trackpad(struct iqs626_private *iqs626,
				 struct fwnode_handle *ch_node,
				 enum iqs626_ch_id ch_id)
{}

static noinline_for_stack int
iqs626_parse_channel(struct iqs626_private *iqs626,
		     struct fwnode_handle *ch_node, enum iqs626_ch_id ch_id)
{}

static int iqs626_parse_prop(struct iqs626_private *iqs626)
{}

static int iqs626_input_init(struct iqs626_private *iqs626)
{}

static int iqs626_report(struct iqs626_private *iqs626)
{}

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

static const struct regmap_config iqs626_regmap_config =;

static int iqs626_probe(struct i2c_client *client)
{}

static int iqs626_suspend(struct device *dev)
{}

static int iqs626_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(iqs626_pm, iqs626_suspend, iqs626_resume);

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

static struct i2c_driver iqs626_i2c_driver =;
module_i2c_driver();

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