#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/input.h>
#include <linux/leds.h>
#include <linux/of.h>
#include <linux/regmap.h>
#include <linux/i2c.h>
#include <linux/gpio/consumer.h>
#include <linux/bitfield.h>
#define CAP11XX_REG_MAIN_CONTROL …
#define CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT …
#define CAP11XX_REG_MAIN_CONTROL_GAIN_MASK …
#define CAP11XX_REG_MAIN_CONTROL_DLSEEP …
#define CAP11XX_REG_GENERAL_STATUS …
#define CAP11XX_REG_SENSOR_INPUT …
#define CAP11XX_REG_NOISE_FLAG_STATUS …
#define CAP11XX_REG_SENOR_DELTA(X) …
#define CAP11XX_REG_SENSITIVITY_CONTROL …
#define CAP11XX_REG_SENSITIVITY_CONTROL_DELTA_SENSE_MASK …
#define CAP11XX_REG_CONFIG …
#define CAP11XX_REG_SENSOR_ENABLE …
#define CAP11XX_REG_SENSOR_CONFIG …
#define CAP11XX_REG_SENSOR_CONFIG2 …
#define CAP11XX_REG_SAMPLING_CONFIG …
#define CAP11XX_REG_CALIBRATION …
#define CAP11XX_REG_INT_ENABLE …
#define CAP11XX_REG_REPEAT_RATE …
#define CAP11XX_REG_SIGNAL_GUARD_ENABLE …
#define CAP11XX_REG_MT_CONFIG …
#define CAP11XX_REG_MT_PATTERN_CONFIG …
#define CAP11XX_REG_MT_PATTERN …
#define CAP11XX_REG_RECALIB_CONFIG …
#define CAP11XX_REG_SENSOR_THRESH(X) …
#define CAP11XX_REG_SENSOR_NOISE_THRESH …
#define CAP11XX_REG_STANDBY_CHANNEL …
#define CAP11XX_REG_STANDBY_CONFIG …
#define CAP11XX_REG_STANDBY_SENSITIVITY …
#define CAP11XX_REG_STANDBY_THRESH …
#define CAP11XX_REG_CONFIG2 …
#define CAP11XX_REG_CONFIG2_ALT_POL …
#define CAP11XX_REG_SENSOR_BASE_CNT(X) …
#define CAP11XX_REG_LED_POLARITY …
#define CAP11XX_REG_LED_OUTPUT_CONTROL …
#define CAP11XX_REG_CALIB_SENSITIVITY_CONFIG …
#define CAP11XX_REG_CALIB_SENSITIVITY_CONFIG2 …
#define CAP11XX_REG_LED_DUTY_CYCLE_1 …
#define CAP11XX_REG_LED_DUTY_CYCLE_2 …
#define CAP11XX_REG_LED_DUTY_CYCLE_3 …
#define CAP11XX_REG_LED_DUTY_CYCLE_4 …
#define CAP11XX_REG_LED_DUTY_MIN_MASK …
#define CAP11XX_REG_LED_DUTY_MIN_MASK_SHIFT …
#define CAP11XX_REG_LED_DUTY_MAX_MASK …
#define CAP11XX_REG_LED_DUTY_MAX_MASK_SHIFT …
#define CAP11XX_REG_LED_DUTY_MAX_VALUE …
#define CAP11XX_REG_SENSOR_CALIB …
#define CAP11XX_REG_SENSOR_CALIB_LSB1 …
#define CAP11XX_REG_SENSOR_CALIB_LSB2 …
#define CAP11XX_REG_PRODUCT_ID …
#define CAP11XX_REG_MANUFACTURER_ID …
#define CAP11XX_REG_REVISION …
#define CAP11XX_MANUFACTURER_ID …
#ifdef CONFIG_LEDS_CLASS
struct cap11xx_led { … };
#endif
struct cap11xx_priv { … };
struct cap11xx_hw_model { … };
static const struct reg_default cap11xx_reg_defaults[] = …;
static bool cap11xx_volatile_reg(struct device *dev, unsigned int reg)
{ … }
static const struct regmap_config cap11xx_regmap_config = …;
static int cap11xx_write_calib_sens_config_1(struct cap11xx_priv *priv)
{ … }
static int cap11xx_write_calib_sens_config_2(struct cap11xx_priv *priv)
{ … }
static int cap11xx_init_keys(struct cap11xx_priv *priv)
{ … }
static irqreturn_t cap11xx_thread_func(int irq_num, void *data)
{ … }
static int cap11xx_set_sleep(struct cap11xx_priv *priv, bool sleep)
{ … }
static int cap11xx_input_open(struct input_dev *idev)
{ … }
static void cap11xx_input_close(struct input_dev *idev)
{ … }
#ifdef CONFIG_LEDS_CLASS
static int cap11xx_led_set(struct led_classdev *cdev,
enum led_brightness value)
{ … }
static int cap11xx_init_leds(struct device *dev,
struct cap11xx_priv *priv, int num_leds)
{ … }
#else
static int cap11xx_init_leds(struct device *dev,
struct cap11xx_priv *priv, int num_leds)
{
return 0;
}
#endif
static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
{ … }
static const struct cap11xx_hw_model cap1106_model = …;
static const struct cap11xx_hw_model cap1126_model = …;
static const struct cap11xx_hw_model cap1188_model = …;
static const struct cap11xx_hw_model cap1203_model = …;
static const struct cap11xx_hw_model cap1206_model = …;
static const struct cap11xx_hw_model cap1293_model = …;
static const struct cap11xx_hw_model cap1298_model = …;
static const struct of_device_id cap11xx_dt_ids[] = …;
MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
static const struct i2c_device_id cap11xx_i2c_ids[] = …;
MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);
static struct i2c_driver cap11xx_i2c_driver = …;
module_i2c_driver(…) …;
MODULE_DESCRIPTION(…) …;
MODULE_AUTHOR(…) …;
MODULE_LICENSE(…) …;