From patchwork Wed Jan 11 13:11:10 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: 41976 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3313545wrt; Wed, 11 Jan 2023 05:17:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXsLaVf/fbHbPyFFqESW6/FUHgD4YlV2kl4ouRAKxaUC24+ywiu7+EhfTSzwgpSd8Hltl/4u X-Received: by 2002:aa7:8158:0:b0:580:eeae:e4ba with SMTP id d24-20020aa78158000000b00580eeaee4bamr55664934pfn.4.1673443053216; Wed, 11 Jan 2023 05:17:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673443053; cv=none; d=google.com; s=arc-20160816; b=JyJxZWOCn1ET04sLQuhRD3nYptpa4P2sTiVYiZFLUoMH2V81P0GPvBUuefioIgMQyb Ll6iJ0d2jc9fACxkzOrXE06L2HGKtQKKn8aq4XdfynfAIAeDEBfZ4wnqwn7zee3KBwa/ yOtA1o2CBVUcPRuZSafwYsb2d4zNWxOc44xVoTjtqmOCL3Z4z6l7Pi+zo18J1a5NfFUU j72eMSFJ1Jf/LC4ZTBs7/ux8uAKpIDxdmxuZghbzaGRRruoVFELi1x0q9BVZNW7QsZ0Y zmmAHvRN4ftkhX2OXIJigIon5n1iYzccMvBIa3KnLsvOlThP50Eu7KdQUj+hBcnso8w+ SvgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SWS9cwOFl8/W5+mGAybOlPrBLB2NvX4Cz+JU+4vBEu4=; b=um/Vn0Q01oNuaIKkzIa1HH0LU0baiXsFEuRZNmwmNlZLe+PrVUaKvwsUXPowI92tLp wvd9R4JiTinMNuQ2eSPCStVc2fdJEoVJv6FJ0wavIVxoE01rgJS3ezv5gUXr+gL4cOJo DYDNHWhSPlfQoqpjbYoIgCU9siA6zVUcYyqTeTlIvg1nvpBwF8WV5y9ZG5BLDWdrHNGO DgpjV9qV3SLPzV6rrHeDB30pbPwY3WBZ24IcRz+k56G2/Yor0n92tREGEoojDMnbv/kn HqqznNeSUcQ6GS5OKzIwKMhRMON9eVaDK80qhqgxIJ9IZKg7SVLz7ERFXjMCayCrn88k sg3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=cBdmE5Nx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 207-20020a6216d8000000b0058802fab480si8789178pfw.324.2023.01.11.05.17.20; Wed, 11 Jan 2023 05:17:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=cBdmE5Nx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233489AbjAKNNx (ORCPT + 99 others); Wed, 11 Jan 2023 08:13:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233184AbjAKNNp (ORCPT ); Wed, 11 Jan 2023 08:13:45 -0500 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB77C5FC7; Wed, 11 Jan 2023 05:13:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1673442824; x=1704978824; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SWS9cwOFl8/W5+mGAybOlPrBLB2NvX4Cz+JU+4vBEu4=; b=cBdmE5NxUQqgfJaZO7bpCw0/edYt2SsoNLzDf61eIg9lHuVk7EkJM3kw 9y8zYfZXnmpka1MwshXGuY1PaZYGX/v6AwqCvCdfGNCvHkVk8sBeaQIzH 90PT8eV55j7cB/r7hl2GLQqf18zKd5+/cJcpk1NRsdNqX6gRUXUrQs0Xx DPWUUAok992fiJn/9y6+1KFXSPLmKS+MdFX/18gDUTDRhDiT23lwLDFkp JSS4/wmlopfbWv2MtZG/Yuk3FVJv0Z2YfiUX/b+dB8gQIPEfPyOHPwtSA VVsoGI0xr9Z5m26e1dhBsLvWNI19vEN4f1vY2SzYC9CefSkuNQQhXVBcd Q==; From: Jiri Valek - 2N To: CC: , , , , , , Subject: [PATCH v4 1/2] dt-bindings: input: microchip,cap11xx: add cap1203, cap1293 and cap1298 Date: Wed, 11 Jan 2023 14:11:10 +0100 Message-ID: <20230111131111.475270-2-jiriv@axis.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230111131111.475270-1-jiriv@axis.com> References: <20230111131111.475270-1-jiriv@axis.com> MIME-Version: 1.0 X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail08w.axis.com (10.20.40.14) To se-mail01w.axis.com (10.20.40.7) X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754732222874772316?= X-GMAIL-MSGID: =?utf-8?q?1754732222874772316?= Add support for cap1203, cap1293 and cap1298. Signed-off-by: Jiri Valek - 2N Acked-by: Krzysztof Kozlowski --- Changes in v2: - No changes. Changes in v3: - No changes. Changes in v4 - Model names sorted alphabetically. 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 Wed Jan 11 13:11:11 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: 41977 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp3313567wrt; Wed, 11 Jan 2023 05:17:35 -0800 (PST) X-Google-Smtp-Source: AMrXdXvmgWjr/R9NpU0/kMfwk2jlGeMbQyeWAmayw7fmnZ4+NPraTd9Ro/TpM20WkYYvQJHkdpJW X-Received: by 2002:a05:6a20:d488:b0:b5:ee8a:9a with SMTP id im8-20020a056a20d48800b000b5ee8a009amr9762882pzb.44.1673443055273; Wed, 11 Jan 2023 05:17:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673443055; cv=none; d=google.com; s=arc-20160816; b=MCXAFS758MVWt3vbfpv2/yx6YJczNEMY34eQJzQJ27QUvhWI08kfbzwqM5McUDHDpr gOCzm9dhZdDkpc6m0XZLX3g5uA6d9CIxGHcIZVRK9DOV8MzGoeZJGUAagpecvzthMcrM oKoBw83JmVugqvRM4ipwxVNyMEAXE0nRuh2Zef4hN8uXctoKR/LgEUKWyEPdn6nLM/C+ Klz40fDnkOz4dCXsgxHLR3V60lemil6/6FYJNHPMTMzpXefLzQpguuuIXmXv8kaqHahJ 2LjSTkjyBo1nshW1mnNgijUzDEbZUNPIh+9mtRQ9baYOKtWJO14VzOIUPBdpvsiBhadQ VM/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=kmZPIHtfVLJlLaQkOTkpVfbGcvtq6MT78y5oUkVXbig=; b=qOAZGjwkedJ60J7IJwgfVhEP1lvW+2mpbYy7NKbE66zZQRnqm+HLu0mtWEXJ3b6S9p eNY8EDKcFL/yTbuLXSsSsJ8Ijble3Soc0TasD0kCA+YJdf8Eo9Coe1KfiMT9LcMXf8K0 ZPOWaRjczq7m+yYKCcXITT42TQ4r0/bZh+WOCKLgNVTthpnCPq4AMEQYoVuBTS0C02PP CpHNwe7OQwfdKhnlyOexnXctaPJghGVQHxCdfytpk48fRTq6S2m7jop8GzymRwMMXhwE hlDePrYsm0SsGlcOEa/fseQc2A302QH6Cr4nXeWegCURMMXsLSomGNkv7XhLzdxJ5aMY qWZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=BXd57kFh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s6-20020a63dc06000000b0049e315c331fsi14588188pgg.136.2023.01.11.05.17.22; Wed, 11 Jan 2023 05:17:35 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=BXd57kFh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=axis.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232735AbjAKNOD (ORCPT + 99 others); Wed, 11 Jan 2023 08:14:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233438AbjAKNNw (ORCPT ); Wed, 11 Jan 2023 08:13:52 -0500 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0ABCF16491; Wed, 11 Jan 2023 05:13:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1673442832; x=1704978832; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kmZPIHtfVLJlLaQkOTkpVfbGcvtq6MT78y5oUkVXbig=; b=BXd57kFhaWqTAncnNiWIBIubhuQPgn8AwZyNiKz9Hn3ZS1/A/1CyEJOJ E2jWK2aUfShKoND6bkCerEpx5QaekUbTNAcD6mQcPpalpjLKVhmusDxYo na1UAlbrTfNJREWy9xHpGChWUiHLXNLEIWDBhR5rL8yTn5nUknO04ch94 zvr2yFal6aTb7Hg6NLbPVMUL5GS6ji7LC9Y2VBRClrkrx2XeFFksRaLLE lHY3sfgLPKOyAdtI6pN7FDNv33LipWP5HnZklegSQemRaZmX/DIjA9LNS 9igYuGudUcf0xTzq+7A9Zbxvr4DTE0QSewhBWdqtcMwDyDZtTtFkVGbl9 A==; From: Jiri Valek - 2N To: CC: , , , , , , Subject: [PATCH v4 2/2] Input: cap11xx - add support for cap1203, cap1293 and cap1298 Date: Wed, 11 Jan 2023 14:11:11 +0100 Message-ID: <20230111131111.475270-3-jiriv@axis.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230111131111.475270-1-jiriv@axis.com> References: <20230111131111.475270-1-jiriv@axis.com> MIME-Version: 1.0 X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail08w.axis.com (10.20.40.14) To se-mail01w.axis.com (10.20.40.7) X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754732224996295044?= X-GMAIL-MSGID: =?utf-8?q?1754732224996295044?= 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 Signed-off-by: Jiri Valek - 2N Reviewed-by: Mattijs Korpershoek --- Changes in v2: - Fixed if statement. Changes in v3: - Model names sorted alphabetically. Changes in v4 - No changes. 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..ce27168302a8 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);