Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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 <jiriv@axis.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20230111131111.475270-3-jiriv@axis.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Jiri Valek - 2N and committed by
Dmitry Torokhov
b4bb3310 bedd9c67

+17 -2
+17 -2
drivers/input/keyboard/cap11xx.c
··· 98 98 CAP1106, 99 99 CAP1126, 100 100 CAP1188, 101 + CAP1203, 101 102 CAP1206, 103 + CAP1293, 104 + CAP1298 102 105 }; 103 106 104 107 static const struct cap11xx_hw_model cap11xx_devices[] = { 105 108 [CAP1106] = { .product_id = 0x55, .num_channels = 6, .num_leds = 0, .no_gain = false }, 106 109 [CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2, .no_gain = false }, 107 110 [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 }, 108 112 [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 }, 109 115 }; 110 116 111 117 static const struct reg_default cap11xx_reg_defaults[] = { ··· 383 377 if (error < 0) 384 378 return error; 385 379 386 - dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev); 380 + dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n", 381 + id->name, rev); 387 382 node = dev->of_node; 388 383 389 384 if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) { ··· 397 390 dev_err(dev, "Invalid sensor-gain value %d\n", gain32); 398 391 } 399 392 400 - if (id->driver_data != CAP1206) { 393 + if (id->driver_data == CAP1106 || 394 + id->driver_data == CAP1126 || 395 + id->driver_data == CAP1188) { 401 396 if (of_property_read_bool(node, "microchip,irq-active-high")) { 402 397 error = regmap_update_bits(priv->regmap, 403 398 CAP11XX_REG_CONFIG2, ··· 492 483 { .compatible = "microchip,cap1106", }, 493 484 { .compatible = "microchip,cap1126", }, 494 485 { .compatible = "microchip,cap1188", }, 486 + { .compatible = "microchip,cap1203", }, 495 487 { .compatible = "microchip,cap1206", }, 488 + { .compatible = "microchip,cap1293", }, 489 + { .compatible = "microchip,cap1298", }, 496 490 {} 497 491 }; 498 492 MODULE_DEVICE_TABLE(of, cap11xx_dt_ids); ··· 504 492 { "cap1106", CAP1106 }, 505 493 { "cap1126", CAP1126 }, 506 494 { "cap1188", CAP1188 }, 495 + { "cap1203", CAP1203 }, 507 496 { "cap1206", CAP1206 }, 497 + { "cap1293", CAP1293 }, 498 + { "cap1298", CAP1298 }, 508 499 {} 509 500 }; 510 501 MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);