From patchwork Mon Feb 6 15:13:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Valek - 2N X-Patchwork-Id: 651556 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D9C8C636D6 for ; Mon, 6 Feb 2023 15:14:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229924AbjBFPOb (ORCPT ); Mon, 6 Feb 2023 10:14:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229806AbjBFPO3 (ORCPT ); Mon, 6 Feb 2023 10:14:29 -0500 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C393E12F25; Mon, 6 Feb 2023 07:14:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1675696469; x=1707232469; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PvpKb7yLkqMFdKtztiv7P/jYOiCMzuBhzTwslaeYKCw=; b=UevUwyZpnrLQNugSIx8J2CVjScU45K81W3C1mf5+B0ZolyZ7+SWQVmDM K9x3KUleagtm65jlM6L5YTVLOACNNGtrIcJiwq1kPIOh8CK7cZEnm/KyX PX7CH3gO04DACHdk7R9w7I9cmkl5WTlb3i2rOL+mTIsEaRYG8+0tILJXF 0PAwJqSZJYf0HaqcI/u48z0YaS/jZjFXdmkPa8g9i9y0pTFcQC5tiP8xa dnpHElohnsI0qQGbHcGMXra0tDcZkL//3zth3qnQ1TXlKncOQdC8T0lLE Xw9q2JGSFcqsXEDisK6bRgDtt2IPnPvW+nb4eFpp696FIALkbhqXVIY56 Q==; From: Jiri Valek - 2N To: CC: , , , , , , , , Krzysztof Kozlowski Subject: [PATCH v5 1/2] dt-bindings: input: microchip,cap11xx: add cap1203, cap1293 and cap1298 Date: Mon, 6 Feb 2023 16:13:30 +0100 Message-ID: <20230206151331.184634-2-jiriv@axis.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230206151331.184634-1-jiriv@axis.com> References: <20230206151331.184634-1-jiriv@axis.com> MIME-Version: 1.0 X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail04w.axis.com (10.20.40.10) To se-mail01w.axis.com (10.20.40.7) Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org Add support for cap1203, cap1293 and cap1298. Acked-by: Krzysztof Kozlowski Signed-off-by: Jiri Valek - 2N --- Changes in v2: - No changes. Changes in v3: - No changes. Changes in v4 - Model names sorted alphabetically. Changes in v5: - No changes. Documentation/devicetree/bindings/input/microchip,cap11xx.yaml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml index 67d4d8f86a2d..5fa625b5c5fb 100644 --- a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml +++ b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml @@ -19,7 +19,10 @@ properties: - microchip,cap1106 - microchip,cap1126 - microchip,cap1188 + - microchip,cap1203 - microchip,cap1206 + - microchip,cap1293 + - microchip,cap1298 reg: maxItems: 1 From patchwork Mon Feb 6 15:13:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiri Valek - 2N X-Patchwork-Id: 651159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7C140C05027 for ; Mon, 6 Feb 2023 15:15:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229582AbjBFPPM (ORCPT ); Mon, 6 Feb 2023 10:15:12 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52496 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229640AbjBFPPL (ORCPT ); Mon, 6 Feb 2023 10:15:11 -0500 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2455C1EBCE; Mon, 6 Feb 2023 07:15:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1675696510; x=1707232510; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JS7h8g3ctjeRZPbI69EcSH0Wy8aIzGJjjvYaYMytls0=; b=mZ0YByfYI5jQxwprZoFbnevdmRmdXo96fTnwoVpuFYufMoKKQJacgGCt LhxfFmQcQWcHOnbjL20qqobGpEErVh6yDWtanmj3Q6HueD6d/NKutSPf7 Q3RSMKHMLN0RwGbFheDjjNnkj58MBslI3izbpFgtl3g+/QZa12ZMzlmOB OVcCNHlzV0ew0/ngq7CAANjGeueA1bjT8R34PA8s/njc1G1fyAWNkZp59 dZWqgBLPFKFd1Lu3tGG4nLQi+J49fZBY4gAhbw5FuOCausnBvsFsHUXo3 sdiZ66SglQwBonIePtac1wNVodpo24JU5oQmimvk2li4Yiuuij53fz6tm A==; From: Jiri Valek - 2N To: CC: , , , , , , , Subject: [PATCH v5 2/2] Input: cap11xx - add support for cap1203, cap1293 and cap1298 Date: Mon, 6 Feb 2023 16:13:31 +0100 Message-ID: <20230206151331.184634-3-jiriv@axis.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230206151331.184634-1-jiriv@axis.com> References: <20230206151331.184634-1-jiriv@axis.com> MIME-Version: 1.0 X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail04w.axis.com (10.20.40.10) To se-mail01w.axis.com (10.20.40.7) Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org 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. Reviewed-by: Mattijs Korpershoek Reported-by: kernel test robot Signed-off-by: Jiri Valek - 2N --- Changes in v2: - Fixed if statement. Changes in v3: - Model names sorted alphabetically. Changes in v4 - No changes. Changes in v5: - Fix indentation. drivers/input/keyboard/cap11xx.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c index 79afd0386e3f..040696d0e49c 100644 --- a/drivers/input/keyboard/cap11xx.c +++ b/drivers/input/keyboard/cap11xx.c @@ -98,14 +98,20 @@ enum { CAP1106, CAP1126, CAP1188, + CAP1203, CAP1206, + CAP1293, + CAP1298 }; static const struct cap11xx_hw_model cap11xx_devices[] = { [CAP1106] = { .product_id = 0x55, .num_channels = 6, .num_leds = 0, .no_gain = false }, [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 }, + [CAP1203] = { .product_id = 0x6d, .num_channels = 3, .num_leds = 0, .no_gain = true }, [CAP1206] = { .product_id = 0x67, .num_channels = 6, .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,9 @@ 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 == CAP1106 || + id->driver_data == CAP1126 || + id->driver_data == CAP1188) { if (of_property_read_bool(node, "microchip,irq-active-high")) { error = regmap_update_bits(priv->regmap, CAP11XX_REG_CONFIG2, @@ -483,7 +492,10 @@ static const struct of_device_id cap11xx_dt_ids[] = { { .compatible = "microchip,cap1106", }, { .compatible = "microchip,cap1126", }, { .compatible = "microchip,cap1188", }, + { .compatible = "microchip,cap1203", }, { .compatible = "microchip,cap1206", }, + { .compatible = "microchip,cap1293", }, + { .compatible = "microchip,cap1298", }, {} }; MODULE_DEVICE_TABLE(of, cap11xx_dt_ids); @@ -492,7 +504,10 @@ static const struct i2c_device_id cap11xx_i2c_ids[] = { { "cap1106", CAP1106 }, { "cap1126", CAP1126 }, { "cap1188", CAP1188 }, + { "cap1203", CAP1203 }, { "cap1206", CAP1206 }, + { "cap1293", CAP1293 }, + { "cap1298", CAP1298 }, {} }; MODULE_DEVICE_TABLE(i2c, cap11xx_i2c_ids);