From: Jiri Valek - 2N <jiriv@axis.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>
Cc: "Jiri Valek - 2N" <jiriv@axis.com>,
"Rob Herring" <robh+dt@kernel.org>,
"Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>,
"open list:INPUT (KEYBOARD, MOUSE, JOYSTICK,
TOUCHSCREEN)..." <linux-input@vger.kernel.org>,
"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
<devicetree@vger.kernel.org>,
"open list" <linux-kernel@vger.kernel.org>
Subject: [PATCH 2/2] Input: cap11xx - add support for cap1203, cap1293 and cap1298
Date: Tue, 3 Jan 2023 14:41:05 +0100 [thread overview]
Message-ID: <20230103134105.736346-3-jiriv@axis.com> (raw)
In-Reply-To: <20230103134105.736346-1-jiriv@axis.com>
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.
Signed-off-by: Jiri Valek - 2N <jiriv@axis.com>
---
drivers/input/keyboard/cap11xx.c | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 79afd0386e3f..ae226fb4fabd 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -99,6 +99,9 @@ enum {
CAP1126,
CAP1188,
CAP1206,
+ CAP1203,
+ CAP1293,
+ CAP1298
};
static const struct cap11xx_hw_model cap11xx_devices[] = {
@@ -106,6 +109,9 @@ static const struct cap11xx_hw_model cap11xx_devices[] = {
[CAP1126] = { .product_id = 0x53, .num_channels = 6, .num_leds = 2, .no_gain = false },
[CAP1188] = { .product_id = 0x50, .num_channels = 8, .num_leds = 8, .no_gain = false },
[CAP1206] = { .product_id = 0x67, .num_channels = 6, .num_leds = 0, .no_gain = true },
+ [CAP1203] = { .product_id = 0x6d, .num_channels = 3, .num_leds = 0, .no_gain = true },
+ [CAP1293] = { .product_id = 0x6f, .num_channels = 3, .num_leds = 0, .no_gain = false },
+ [CAP1298] = { .product_id = 0x71, .num_channels = 8, .num_leds = 0, .no_gain = false },
};
static const struct reg_default cap11xx_reg_defaults[] = {
@@ -377,7 +383,8 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
if (error < 0)
return error;
- dev_info(dev, "CAP11XX detected, revision 0x%02x\n", rev);
+ dev_info(dev, "CAP11XX detected, model %s, revision 0x%02x\n",
+ id->name, rev);
node = dev->of_node;
if (!of_property_read_u32(node, "microchip,sensor-gain", &gain32)) {
@@ -390,7 +397,10 @@ static int cap11xx_i2c_probe(struct i2c_client *i2c_client)
dev_err(dev, "Invalid sensor-gain value %d\n", gain32);
}
- if (id->driver_data != CAP1206) {
+ if ((id->driver_data != CAP1206) ||
+ (id->driver_data != CAP1203) ||
+ (id->driver_data != CAP1293) ||
+ (id->driver_data != CAP1298)) {
if (of_property_read_bool(node, "microchip,irq-active-high")) {
error = regmap_update_bits(priv->regmap,
CAP11XX_REG_CONFIG2,
@@ -484,6 +494,9 @@ static const struct of_device_id cap11xx_dt_ids[] = {
{ .compatible = "microchip,cap1126", },
{ .compatible = "microchip,cap1188", },
{ .compatible = "microchip,cap1206", },
+ { .compatible = "microchip,cap1203", },
+ { .compatible = "microchip,cap1293", },
+ { .compatible = "microchip,cap1298", },
{}
};
MODULE_DEVICE_TABLE(of, cap11xx_dt_ids);
@@ -493,6 +506,9 @@ static const struct i2c_device_id cap11xx_i2c_ids[] = {
{ "cap1126", CAP1126 },
{ "cap1188", CAP1188 },
{ "cap1206", CAP1206 },
+ { "cap1203", CAP1203 },
+ { "cap1293", CAP1293 },
+ { "cap1298", CAP1298 },
{}
};
MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);
--
2.25.1
next prev parent reply other threads:[~2023-01-03 13:42 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-01-03 13:41 [PATCH 0/2] Input: cap11xx add support for cap1203, cap1293 and cap1298 Jiri Valek - 2N
2023-01-03 13:41 ` [PATCH 1/2] dt-bindings: input: microchip,cap11xx: add " Jiri Valek - 2N
2023-01-03 13:41 ` Jiri Valek - 2N [this message]
2023-01-04 4:37 ` [PATCH 2/2] Input: cap11xx - add support for " kernel test robot
2023-01-04 13:59 ` [PATCH v2 0/2] Input: cap11xx " Jiri Valek - 2N
2023-01-04 13:59 ` [PATCH v2 1/2] dt-bindings: input: microchip,cap11xx: add " Jiri Valek - 2N
2023-01-08 21:43 ` Rob Herring
2023-01-04 13:59 ` [PATCH v2 2/2] Input: cap11xx - add support for " Jiri Valek - 2N
2023-01-10 10:22 ` [PATCH v2 0/2] Input: cap11xx " Krzysztof Kozlowski
2023-01-06 7:11 ` [PATCH 2/2] Input: cap11xx - " Dan Carpenter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230103134105.736346-3-jiriv@axis.com \
--to=jiriv@axis.com \
--cc=devicetree@vger.kernel.org \
--cc=dmitry.torokhov@gmail.com \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=u.kleine-koenig@pengutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).