linux/drivers/input/touchscreen/rohm_bu21023.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * ROHM BU21023/24 Dual touch support resistive touch screen driver
 * Copyright (C) 2012 ROHM CO.,LTD.
 */
#include <linux/delay.h>
#include <linux/firmware.h>
#include <linux/i2c.h>
#include <linux/input.h>
#include <linux/input/mt.h>
#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/slab.h>

#define BU21023_NAME
#define BU21023_FIRMWARE_NAME

#define MAX_CONTACTS

#define AXIS_ADJUST
#define AXIS_OFFSET

#define FIRMWARE_BLOCK_SIZE
#define FIRMWARE_RETRY_MAX

#define SAMPLING_DELAY

#define CALIBRATION_RETRY_MAX

#define ROHM_TS_ABS_X_MIN
#define ROHM_TS_ABS_X_MAX
#define ROHM_TS_ABS_Y_MIN
#define ROHM_TS_ABS_Y_MAX
#define ROHM_TS_DISPLACEMENT_MAX

/*
 * BU21023GUL/BU21023MUV/BU21024FV-M registers map
 */
#define VADOUT_YP_H
#define VADOUT_YP_L
#define VADOUT_XP_H
#define VADOUT_XP_L
#define VADOUT_YN_H
#define VADOUT_YN_L
#define VADOUT_XN_H
#define VADOUT_XN_L

#define PRM1_X_H
#define PRM1_X_L
#define PRM1_Y_H
#define PRM1_Y_L
#define PRM2_X_H
#define PRM2_X_L
#define PRM2_Y_H
#define PRM2_Y_L

#define MLT_PRM_MONI_X
#define MLT_PRM_MONI_Y

#define DEBUG_MONI_1
#define DEBUG_MONI_2

#define VADOUT_ZX_H
#define VADOUT_ZX_L
#define VADOUT_ZY_H
#define VADOUT_ZY_L

#define Z_PARAM_H
#define Z_PARAM_L

/*
 * Value for VADOUT_*_L
 */
#define VADOUT_L_MASK

/*
 * Value for PRM*_*_L
 */
#define PRM_L_MASK

#define POS_X1_H
#define POS_X1_L
#define POS_Y1_H
#define POS_Y1_L
#define POS_X2_H
#define POS_X2_L
#define POS_Y2_H
#define POS_Y2_L

/*
 * Value for POS_*_L
 */
#define POS_L_MASK

#define TOUCH
#define TOUCH_DETECT

#define TOUCH_GESTURE
#define SINGLE_TOUCH
#define DUAL_TOUCH
#define TOUCH_MASK
#define CALIBRATION_REQUEST
#define CALIBRATION_STATUS
#define CALIBRATION_MASK
#define GESTURE_SPREAD
#define GESTURE_PINCH
#define GESTURE_ROTATE_R
#define GESTURE_ROTATE_L

#define INT_STATUS
#define INT_MASK
#define INT_CLEAR

/*
 * Values for INT_*
 */
#define COORD_UPDATE
#define CALIBRATION_DONE
#define SLEEP_IN
#define SLEEP_OUT
#define PROGRAM_LOAD_DONE
#define ERROR
#define INT_ALL

#define ERR_STATUS
#define ERR_MASK

/*
 * Values for ERR_*
 */
#define ADC_TIMEOUT
#define CPU_TIMEOUT
#define CALIBRATION_ERR
#define PROGRAM_LOAD_ERR

#define COMMON_SETUP1
#define PROGRAM_LOAD_HOST
#define PROGRAM_LOAD_EEPROM
#define CENSOR_4PORT
#define CENSOR_8PORT
#define CALIBRATION_TYPE_DEFAULT
#define CALIBRATION_TYPE_SPECIAL
#define INT_ACTIVE_HIGH
#define INT_ACTIVE_LOW
#define AUTO_CALIBRATION
#define MANUAL_CALIBRATION
#define COMMON_SETUP1_DEFAULT

#define COMMON_SETUP2
#define MAF_NONE
#define MAF_1SAMPLE
#define MAF_3SAMPLES
#define MAF_5SAMPLES
#define INV_Y
#define INV_X
#define SWAP_XY

#define COMMON_SETUP3
#define EN_SLEEP
#define EN_MULTI
#define EN_GESTURE
#define EN_INTVL
#define SEL_STEP
#define SEL_MULTI
#define SEL_TBL_DEFAULT

#define INTERVAL_TIME
#define INTERVAL_TIME_DEFAULT

#define STEP_X
#define STEP_X_DEFAULT

#define STEP_Y
#define STEP_Y_DEFAULT

#define OFFSET_X
#define OFFSET_X_DEFAULT

#define OFFSET_Y
#define OFFSET_Y_DEFAULT

#define THRESHOLD_TOUCH
#define THRESHOLD_TOUCH_DEFAULT

#define THRESHOLD_GESTURE
#define THRESHOLD_GESTURE_DEFAULT

#define SYSTEM
#define ANALOG_POWER_ON
#define ANALOG_POWER_OFF
#define CPU_POWER_ON
#define CPU_POWER_OFF

#define FORCE_CALIBRATION
#define FORCE_CALIBRATION_ON
#define FORCE_CALIBRATION_OFF

#define CPU_FREQ
#define CPU_FREQ_10MHZ
#define CPU_FREQ_5MHZ
#define CPU_FREQ_1MHZ

#define EEPROM_ADDR

#define CALIBRATION_ADJUST
#define CALIBRATION_ADJUST_DEFAULT

#define THRESHOLD_SLEEP_IN

#define EVR_XY
#define EVR_XY_DEFAULT

#define PRM_SWOFF_TIME
#define PRM_SWOFF_TIME_DEFAULT

#define PROGRAM_VERSION

#define ADC_CTRL
#define ADC_DIV_MASK
#define ADC_DIV_DEFAULT

#define ADC_WAIT
#define ADC_WAIT_DEFAULT

#define SWCONT
#define SWCONT_DEFAULT

#define EVR_X
#define EVR_X_DEFAULT

#define EVR_Y
#define EVR_Y_DEFAULT

#define TEST1
#define DUALTOUCH_STABILIZE_ON
#define DUALTOUCH_STABILIZE_OFF
#define DUALTOUCH_REG_ON
#define DUALTOUCH_REG_OFF

#define CALIBRATION_REG1
#define CALIBRATION_REG1_DEFAULT

#define CALIBRATION_REG2
#define CALIBRATION_REG2_DEFAULT

#define CALIBRATION_REG3
#define CALIBRATION_REG3_DEFAULT

#define EX_ADDR_H
#define EX_ADDR_L
#define EX_WDAT
#define EX_RDAT
#define EX_CHK_SUM1
#define EX_CHK_SUM2
#define EX_CHK_SUM3

struct rohm_ts_data {};

/*
 * rohm_i2c_burst_read - execute combined I2C message for ROHM BU21023/24
 * @client: Handle to ROHM BU21023/24
 * @start: Where to start read address from ROHM BU21023/24
 * @buf: Where to store read data from ROHM BU21023/24
 * @len: How many bytes to read
 *
 * Returns negative errno, else zero on success.
 *
 * Note
 * In BU21023/24 burst read, stop condition is needed after "address write".
 * Therefore, transmission is performed in 2 steps.
 */
static int rohm_i2c_burst_read(struct i2c_client *client, u8 start, void *buf,
			       size_t len)
{}

static int rohm_ts_manual_calibration(struct rohm_ts_data *ts)
{}

static const unsigned int untouch_threshold[3] =;
static const unsigned int single_touch_threshold[3] =;
static const unsigned int dual_touch_threshold[3] =;

static irqreturn_t rohm_ts_soft_irq(int irq, void *dev_id)
{}

static int rohm_ts_load_firmware(struct i2c_client *client,
				 const char *firmware_name)
{}

static int rohm_ts_update_setting(struct rohm_ts_data *ts,
				  unsigned int setting_bit, bool on)
{}

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

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

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

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

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

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

static DEVICE_ATTR_RW(swap_xy);
static DEVICE_ATTR_RW(inv_x);
static DEVICE_ATTR_RW(inv_y);

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

static int rohm_ts_device_init(struct i2c_client *client, u8 setup2)
{}

static int rohm_ts_power_off(struct i2c_client *client)
{}

static int rohm_ts_open(struct input_dev *input_dev)
{}

static void rohm_ts_close(struct input_dev *input_dev)
{}

static int rohm_bu21023_i2c_probe(struct i2c_client *client)
{}

static const struct i2c_device_id rohm_bu21023_i2c_id[] =;
MODULE_DEVICE_TABLE(i2c, rohm_bu21023_i2c_id);

static struct i2c_driver rohm_bu21023_i2c_driver =;
module_i2c_driver();

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