linux/drivers/input/misc/iqs269a.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * Azoteq IQS269A Capacitive Touch Controller
 *
 * Copyright (C) 2020 Jeff LaBundy <[email protected]>
 *
 * This driver registers up to 3 input devices: one representing capacitive or
 * inductive keys as well as Hall-effect switches, and one for each of the two
 * axial sliders presented by the device.
 */

#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/interrupt.h>
#include <linux/kernel.h>
#include <linux/mod_devicetable.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/property.h>
#include <linux/regmap.h>
#include <linux/slab.h>

#define IQS269_VER_INFO
#define IQS269_VER_INFO_PROD_NUM
#define IQS269_VER_INFO_FW_NUM_2
#define IQS269_VER_INFO_FW_NUM_3

#define IQS269_SYS_FLAGS
#define IQS269_SYS_FLAGS_SHOW_RESET
#define IQS269_SYS_FLAGS_PWR_MODE_MASK
#define IQS269_SYS_FLAGS_PWR_MODE_SHIFT
#define IQS269_SYS_FLAGS_IN_ATI

#define IQS269_CHx_COUNTS

#define IQS269_SLIDER_X

#define IQS269_CAL_DATA_A
#define IQS269_CAL_DATA_A_HALL_BIN_L_MASK
#define IQS269_CAL_DATA_A_HALL_BIN_L_SHIFT
#define IQS269_CAL_DATA_A_HALL_BIN_R_MASK
#define IQS269_CAL_DATA_A_HALL_BIN_R_SHIFT

#define IQS269_SYS_SETTINGS
#define IQS269_SYS_SETTINGS_CLK_DIV
#define IQS269_SYS_SETTINGS_ULP_AUTO
#define IQS269_SYS_SETTINGS_DIS_AUTO
#define IQS269_SYS_SETTINGS_PWR_MODE_MASK
#define IQS269_SYS_SETTINGS_PWR_MODE_SHIFT
#define IQS269_SYS_SETTINGS_PWR_MODE_MAX
#define IQS269_SYS_SETTINGS_ULP_UPDATE_MASK
#define IQS269_SYS_SETTINGS_ULP_UPDATE_SHIFT
#define IQS269_SYS_SETTINGS_ULP_UPDATE_MAX
#define IQS269_SYS_SETTINGS_SLIDER_SWIPE
#define IQS269_SYS_SETTINGS_RESEED_OFFSET
#define IQS269_SYS_SETTINGS_EVENT_MODE
#define IQS269_SYS_SETTINGS_EVENT_MODE_LP
#define IQS269_SYS_SETTINGS_REDO_ATI
#define IQS269_SYS_SETTINGS_ACK_RESET

#define IQS269_FILT_STR_LP_LTA_MASK
#define IQS269_FILT_STR_LP_LTA_SHIFT
#define IQS269_FILT_STR_LP_CNT_MASK
#define IQS269_FILT_STR_LP_CNT_SHIFT
#define IQS269_FILT_STR_NP_LTA_MASK
#define IQS269_FILT_STR_NP_LTA_SHIFT
#define IQS269_FILT_STR_NP_CNT_MASK
#define IQS269_FILT_STR_MAX

#define IQS269_EVENT_MASK_SYS
#define IQS269_EVENT_MASK_GESTURE
#define IQS269_EVENT_MASK_DEEP
#define IQS269_EVENT_MASK_TOUCH
#define IQS269_EVENT_MASK_PROX

#define IQS269_RATE_NP_MS_MAX
#define IQS269_RATE_LP_MS_MAX
#define IQS269_RATE_ULP_MS_MAX
#define IQS269_TIMEOUT_PWR_MS_MAX
#define IQS269_TIMEOUT_LTA_MS_MAX

#define IQS269_MISC_A_ATI_BAND_DISABLE
#define IQS269_MISC_A_ATI_LP_ONLY
#define IQS269_MISC_A_ATI_BAND_TIGHTEN
#define IQS269_MISC_A_FILT_DISABLE
#define IQS269_MISC_A_GPIO3_SELECT_MASK
#define IQS269_MISC_A_GPIO3_SELECT_SHIFT
#define IQS269_MISC_A_DUAL_DIR
#define IQS269_MISC_A_TX_FREQ_MASK
#define IQS269_MISC_A_TX_FREQ_SHIFT
#define IQS269_MISC_A_TX_FREQ_MAX
#define IQS269_MISC_A_GLOBAL_CAP_SIZE

#define IQS269_MISC_B_RESEED_UI_SEL_MASK
#define IQS269_MISC_B_RESEED_UI_SEL_SHIFT
#define IQS269_MISC_B_RESEED_UI_SEL_MAX
#define IQS269_MISC_B_TRACKING_UI_ENABLE
#define IQS269_MISC_B_FILT_STR_SLIDER

#define IQS269_TOUCH_HOLD_SLIDER_SEL
#define IQS269_TOUCH_HOLD_DEFAULT
#define IQS269_TOUCH_HOLD_MS_MIN
#define IQS269_TOUCH_HOLD_MS_MAX

#define IQS269_TIMEOUT_TAP_MS_MAX
#define IQS269_TIMEOUT_SWIPE_MS_MAX
#define IQS269_THRESH_SWIPE_MAX

#define IQS269_CHx_ENG_A_MEAS_CAP_SIZE
#define IQS269_CHx_ENG_A_RX_GND_INACTIVE
#define IQS269_CHx_ENG_A_LOCAL_CAP_SIZE
#define IQS269_CHx_ENG_A_ATI_MODE_MASK
#define IQS269_CHx_ENG_A_ATI_MODE_SHIFT
#define IQS269_CHx_ENG_A_ATI_MODE_MAX
#define IQS269_CHx_ENG_A_INV_LOGIC
#define IQS269_CHx_ENG_A_PROJ_BIAS_MASK
#define IQS269_CHx_ENG_A_PROJ_BIAS_SHIFT
#define IQS269_CHx_ENG_A_PROJ_BIAS_MAX
#define IQS269_CHx_ENG_A_SENSE_MODE_MASK
#define IQS269_CHx_ENG_A_SENSE_MODE_MAX

#define IQS269_CHx_ENG_B_LOCAL_CAP_ENABLE
#define IQS269_CHx_ENG_B_SENSE_FREQ_MASK
#define IQS269_CHx_ENG_B_SENSE_FREQ_SHIFT
#define IQS269_CHx_ENG_B_SENSE_FREQ_MAX
#define IQS269_CHx_ENG_B_STATIC_ENABLE
#define IQS269_CHx_ENG_B_ATI_BASE_MASK
#define IQS269_CHx_ENG_B_ATI_BASE_75
#define IQS269_CHx_ENG_B_ATI_BASE_100
#define IQS269_CHx_ENG_B_ATI_BASE_150
#define IQS269_CHx_ENG_B_ATI_BASE_200
#define IQS269_CHx_ENG_B_ATI_TARGET_MASK
#define IQS269_CHx_ENG_B_ATI_TARGET_MAX

#define IQS269_CHx_WEIGHT_MAX
#define IQS269_CHx_THRESH_MAX
#define IQS269_CHx_HYST_DEEP_MASK
#define IQS269_CHx_HYST_DEEP_SHIFT
#define IQS269_CHx_HYST_TOUCH_MASK
#define IQS269_CHx_HYST_MAX

#define IQS269_CHx_HALL_INACTIVE
#define IQS269_CHx_HALL_ACTIVE

#define IQS269_HALL_PAD_R
#define IQS269_HALL_PAD_L
#define IQS269_HALL_PAD_INV

#define IQS269_HALL_UI
#define IQS269_HALL_UI_ENABLE

#define IQS269_MAX_REG

#define IQS269_OTP_OPTION_DEFAULT
#define IQS269_OTP_OPTION_TWS
#define IQS269_OTP_OPTION_HOLD

#define IQS269_NUM_CH
#define IQS269_NUM_SL

#define iqs269_irq_wait()

enum iqs269_local_cap_size {};

enum iqs269_st_offs {};

enum iqs269_th_offs {};

enum iqs269_event_id {};

enum iqs269_slider_id {};

enum iqs269_gesture_id {};

struct iqs269_switch_desc {};

struct iqs269_event_desc {};

static const struct iqs269_event_desc iqs269_events[] =;

struct iqs269_ver_info {} __packed;

struct iqs269_ch_reg {} __packed;

struct iqs269_sys_reg {} __packed;

struct iqs269_flags {} __packed;

struct iqs269_private {};

static enum iqs269_slider_id iqs269_slider_type(struct iqs269_private *iqs269,
						int slider_num)
{}

static int iqs269_ati_mode_set(struct iqs269_private *iqs269,
			       unsigned int ch_num, unsigned int mode)
{}

static int iqs269_ati_mode_get(struct iqs269_private *iqs269,
			       unsigned int ch_num, unsigned int *mode)
{}

static int iqs269_ati_base_set(struct iqs269_private *iqs269,
			       unsigned int ch_num, unsigned int base)
{}

static int iqs269_ati_base_get(struct iqs269_private *iqs269,
			       unsigned int ch_num, unsigned int *base)
{}

static int iqs269_ati_target_set(struct iqs269_private *iqs269,
				 unsigned int ch_num, unsigned int target)
{}

static int iqs269_ati_target_get(struct iqs269_private *iqs269,
				 unsigned int ch_num, unsigned int *target)
{}

static int iqs269_parse_mask(const struct fwnode_handle *fwnode,
			     const char *propname, u8 *mask)
{}

static int iqs269_parse_chan(struct iqs269_private *iqs269,
			     const struct fwnode_handle *ch_node)
{}

static int iqs269_parse_prop(struct iqs269_private *iqs269)
{}

static const struct reg_sequence iqs269_tws_init[] =;

static int iqs269_dev_init(struct iqs269_private *iqs269)
{}

static int iqs269_input_init(struct iqs269_private *iqs269)
{}

static int iqs269_report(struct iqs269_private *iqs269)
{}

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

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

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

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

static ssize_t hall_enable_store(struct device *dev,
				 struct device_attribute *attr, const char *buf,
				 size_t count)
{}

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

static ssize_t ch_number_store(struct device *dev,
			       struct device_attribute *attr, const char *buf,
			       size_t count)
{}

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

static ssize_t rx_enable_store(struct device *dev,
			       struct device_attribute *attr, const char *buf,
			       size_t count)
{}

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

static ssize_t ati_mode_store(struct device *dev,
			      struct device_attribute *attr, const char *buf,
			      size_t count)
{}

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

static ssize_t ati_base_store(struct device *dev,
			      struct device_attribute *attr, const char *buf,
			      size_t count)
{}

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

static ssize_t ati_target_store(struct device *dev,
				struct device_attribute *attr, const char *buf,
				size_t count)
{}

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

static ssize_t ati_trigger_store(struct device *dev,
				 struct device_attribute *attr, const char *buf,
				 size_t count)
{}

static DEVICE_ATTR_RO(counts);
static DEVICE_ATTR_RO(hall_bin);
static DEVICE_ATTR_RW(hall_enable);
static DEVICE_ATTR_RW(ch_number);
static DEVICE_ATTR_RW(rx_enable);
static DEVICE_ATTR_RW(ati_mode);
static DEVICE_ATTR_RW(ati_base);
static DEVICE_ATTR_RW(ati_target);
static DEVICE_ATTR_RW(ati_trigger);

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

static const struct regmap_config iqs269_regmap_config =;

static int iqs269_probe(struct i2c_client *client)
{}

static u16 iqs269_general_get(struct iqs269_private *iqs269)
{}

static int iqs269_suspend(struct device *dev)
{}

static int iqs269_resume(struct device *dev)
{}

static DEFINE_SIMPLE_DEV_PM_OPS(iqs269_pm, iqs269_suspend, iqs269_resume);

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

static struct i2c_driver iqs269_i2c_driver =;
module_i2c_driver();

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