mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-08-30 14:33:24 -04:00
Input: cap11xx - remove unused register macros
Remove unused register address macros and their corresponding definitions in the cap11xx_reg_defaults array. This cleanup reduces code clutter and makes the driver easier to maintain without affecting functionality. Signed-off-by: Jun Yan <jerrysteve1101@gmail.com> Link: https://patch.msgid.link/20260617150318.753148-3-jerrysteve1101@gmail.com Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
This commit is contained in:
@@ -20,53 +20,24 @@
|
||||
#define CAP11XX_REG_MAIN_CONTROL_GAIN_SHIFT (6)
|
||||
#define CAP11XX_REG_MAIN_CONTROL_GAIN_MASK (0xc0)
|
||||
#define CAP11XX_REG_MAIN_CONTROL_DLSEEP BIT(4)
|
||||
#define CAP11XX_REG_GENERAL_STATUS 0x02
|
||||
#define CAP11XX_REG_SENSOR_INPUT 0x03
|
||||
#define CAP11XX_REG_NOISE_FLAG_STATUS 0x0a
|
||||
#define CAP11XX_REG_SENOR_DELTA(X) (0x10 + (X))
|
||||
#define CAP11XX_REG_SENSITIVITY_CONTROL 0x1f
|
||||
#define CAP11XX_REG_SENSITIVITY_CONTROL_DELTA_SENSE_MASK 0x70
|
||||
#define CAP11XX_REG_CONFIG 0x20
|
||||
#define CAP11XX_REG_SENSOR_ENABLE 0x21
|
||||
#define CAP11XX_REG_SENSOR_CONFIG 0x22
|
||||
#define CAP11XX_REG_SENSOR_CONFIG2 0x23
|
||||
#define CAP11XX_REG_SAMPLING_CONFIG 0x24
|
||||
#define CAP11XX_REG_CALIBRATION 0x26
|
||||
#define CAP11XX_REG_INT_ENABLE 0x27
|
||||
#define CAP11XX_REG_REPEAT_RATE 0x28
|
||||
#define CAP11XX_REG_SIGNAL_GUARD_ENABLE 0x29
|
||||
#define CAP11XX_REG_MT_CONFIG 0x2a
|
||||
#define CAP11XX_REG_MT_PATTERN_CONFIG 0x2b
|
||||
#define CAP11XX_REG_MT_PATTERN 0x2d
|
||||
#define CAP11XX_REG_RECALIB_CONFIG 0x2f
|
||||
#define CAP11XX_REG_SENSOR_THRESH(X) (0x30 + (X))
|
||||
#define CAP11XX_REG_SENSOR_NOISE_THRESH 0x38
|
||||
#define CAP11XX_REG_STANDBY_CHANNEL 0x40
|
||||
#define CAP11XX_REG_STANDBY_CONFIG 0x41
|
||||
#define CAP11XX_REG_STANDBY_SENSITIVITY 0x42
|
||||
#define CAP11XX_REG_STANDBY_THRESH 0x43
|
||||
#define CAP11XX_REG_CONFIG2 0x44
|
||||
#define CAP11XX_REG_CONFIG2_ALT_POL BIT(6)
|
||||
#define CAP11XX_REG_SENSOR_BASE_CNT(X) (0x50 + (X))
|
||||
#define CAP11XX_REG_LED_POLARITY 0x73
|
||||
#define CAP11XX_REG_LED_OUTPUT_CONTROL 0x74
|
||||
#define CAP11XX_REG_CALIB_SENSITIVITY_CONFIG 0x80
|
||||
#define CAP11XX_REG_CALIB_SENSITIVITY_CONFIG2 0x81
|
||||
|
||||
#define CAP11XX_REG_LED_DUTY_CYCLE_1 0x90
|
||||
#define CAP11XX_REG_LED_DUTY_CYCLE_2 0x91
|
||||
#define CAP11XX_REG_LED_DUTY_CYCLE_3 0x92
|
||||
#define CAP11XX_REG_LED_DUTY_CYCLE_4 0x93
|
||||
|
||||
#define CAP11XX_REG_LED_DUTY_MIN_MASK (0x0f)
|
||||
#define CAP11XX_REG_LED_DUTY_MIN_MASK_SHIFT (0)
|
||||
#define CAP11XX_REG_LED_DUTY_MAX_MASK (0xf0)
|
||||
#define CAP11XX_REG_LED_DUTY_MAX_MASK_SHIFT (4)
|
||||
#define CAP11XX_REG_LED_DUTY_MAX_VALUE (15)
|
||||
|
||||
#define CAP11XX_REG_SENSOR_CALIB (0xb1 + (X))
|
||||
#define CAP11XX_REG_SENSOR_CALIB_LSB1 0xb9
|
||||
#define CAP11XX_REG_SENSOR_CALIB_LSB2 0xba
|
||||
#define CAP11XX_REG_PRODUCT_ID 0xfd
|
||||
#define CAP11XX_REG_MANUFACTURER_ID 0xfe
|
||||
#define CAP11XX_REG_REVISION 0xff
|
||||
@@ -111,37 +82,15 @@ struct cap11xx_hw_model {
|
||||
|
||||
static const struct reg_default cap11xx_reg_defaults[] = {
|
||||
{ CAP11XX_REG_MAIN_CONTROL, 0x00 },
|
||||
{ CAP11XX_REG_GENERAL_STATUS, 0x00 },
|
||||
{ CAP11XX_REG_SENSOR_INPUT, 0x00 },
|
||||
{ CAP11XX_REG_NOISE_FLAG_STATUS, 0x00 },
|
||||
{ CAP11XX_REG_SENSITIVITY_CONTROL, 0x2f },
|
||||
{ CAP11XX_REG_CONFIG, 0x20 },
|
||||
{ CAP11XX_REG_SENSOR_ENABLE, 0x3f },
|
||||
{ CAP11XX_REG_SENSOR_CONFIG, 0xa4 },
|
||||
{ CAP11XX_REG_SENSOR_CONFIG2, 0x07 },
|
||||
{ CAP11XX_REG_SAMPLING_CONFIG, 0x39 },
|
||||
{ CAP11XX_REG_CALIBRATION, 0x00 },
|
||||
{ CAP11XX_REG_INT_ENABLE, 0x3f },
|
||||
{ CAP11XX_REG_REPEAT_RATE, 0x3f },
|
||||
{ CAP11XX_REG_MT_CONFIG, 0x80 },
|
||||
{ CAP11XX_REG_MT_PATTERN_CONFIG, 0x00 },
|
||||
{ CAP11XX_REG_MT_PATTERN, 0x3f },
|
||||
{ CAP11XX_REG_RECALIB_CONFIG, 0x8a },
|
||||
{ CAP11XX_REG_SENSOR_THRESH(0), 0x40 },
|
||||
{ CAP11XX_REG_SENSOR_THRESH(1), 0x40 },
|
||||
{ CAP11XX_REG_SENSOR_THRESH(2), 0x40 },
|
||||
{ CAP11XX_REG_SENSOR_THRESH(3), 0x40 },
|
||||
{ CAP11XX_REG_SENSOR_THRESH(4), 0x40 },
|
||||
{ CAP11XX_REG_SENSOR_THRESH(5), 0x40 },
|
||||
{ CAP11XX_REG_SENSOR_NOISE_THRESH, 0x01 },
|
||||
{ CAP11XX_REG_STANDBY_CHANNEL, 0x00 },
|
||||
{ CAP11XX_REG_STANDBY_CONFIG, 0x39 },
|
||||
{ CAP11XX_REG_STANDBY_SENSITIVITY, 0x02 },
|
||||
{ CAP11XX_REG_STANDBY_THRESH, 0x40 },
|
||||
{ CAP11XX_REG_CONFIG2, 0x40 },
|
||||
{ CAP11XX_REG_LED_POLARITY, 0x00 },
|
||||
{ CAP11XX_REG_SENSOR_CALIB_LSB1, 0x00 },
|
||||
{ CAP11XX_REG_SENSOR_CALIB_LSB2, 0x00 },
|
||||
};
|
||||
|
||||
static bool cap11xx_volatile_reg(struct device *dev, unsigned int reg)
|
||||
|
||||
Reference in New Issue
Block a user