Skip to content

Commit b4bb331

Browse files
Jiri Valek - 2Ndtor
authored andcommitted
Input: cap11xx - add support for cap1203, cap1293 and cap1298
Add basic support for more CAP1xxx sensors. All models from CAP1xxx family are register-compatible. Some advanced features are not used and disabled by default. Reported-by: kernel test robot <lkp@xxxxxxxxx> Signed-off-by: Jiri Valek - 2N <[email protected]> Reviewed-by: Mattijs Korpershoek <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Dmitry Torokhov <[email protected]>
1 parent bedd9c6 commit b4bb331

File tree

1 file changed

+17
-2
lines changed

1 file changed

+17
-2
lines changed

drivers/input/keyboard/cap11xx.c

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,14 +98,20 @@ enum {
9898
CAP1106,
9999
CAP1126,
100100
CAP1188,
101+
CAP1203,
101102
CAP1206,
103+
CAP1293,
104+
CAP1298
102105
};
103106

104107
static const struct cap11xx_hw_model cap11xx_devices[] = {
105108
[CAP1106] = { .product_id = 0x55, .num_channels = 6, .num_leds = 0, .no_gain = false },
106109
[CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2, .no_gain = false },
107110
[CAP1188] = { .product_id = 0x50, .num_channels = 8, .num_leds = 8, .no_gain = false },
111+
[CAP1203] = { .product_id = 0x6d, .num_channels = 3, .num_leds = 0, .no_gain = true },
108112
[CAP1206] = { .product_id = 0x67, .num_channels = 6, .num_leds = 0, .no_gain = true },
113+
[CAP1293] = { .product_id = 0x6f, .num_channels = 3, .num_leds = 0, .no_gain = false },
114+
[CAP1298] = { .product_id = 0x71, .num_channels = 8, .num_leds = 0, .no_gain = false },
109115
};
110116

111117
static const struct reg_default cap11xx_reg_defaults[] = {
@@ -377,7 +383,8 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
377383
if (error < 0)
378384
return error;
379385

380-
dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev);
386+
dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n",
387+
id->name, rev);
381388
node = dev->of_node;
382389

383390
if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
@@ -390,7 +397,9 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
390397
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
391398
}
392399

393-
if (id->driver_data != CAP1206) {
400+
if (id->driver_data == CAP1106 ||
401+
id->driver_data == CAP1126 ||
402+
id->driver_data == CAP1188) {
394403
if (of_property_read_bool(node, "microchip,irq-active-high")) {
395404
error = regmap_update_bits(priv->regmap,
396405
CAP11XX_REG_CONFIG2,
@@ -483,7 +492,10 @@ static const struct of_device_id cap11xx_dt_ids[] = {
483492
{ .compatible = "microchip,cap1106", },
484493
{ .compatible = "microchip,cap1126", },
485494
{ .compatible = "microchip,cap1188", },
495+
{ .compatible = "microchip,cap1203", },
486496
{ .compatible = "microchip,cap1206", },
497+
{ .compatible = "microchip,cap1293", },
498+
{ .compatible = "microchip,cap1298", },
487499
{}
488500
};
489501
MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
@@ -492,7 +504,10 @@ static const struct i2c_device_id cap11xx_i2c_ids[] = {
492504
{ "cap1106", CAP1106 },
493505
{ "cap1126", CAP1126 },
494506
{ "cap1188", CAP1188 },
507+
{ "cap1203", CAP1203 },
495508
{ "cap1206", CAP1206 },
509+
{ "cap1293", CAP1293 },
510+
{ "cap1298", CAP1298 },
496511
{}
497512
};
498513
MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);

0 commit comments

Comments
 (0)