From patchwork Tue Jan 10 15:28:59 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: 41524 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2812222wrt; Tue, 10 Jan 2023 07:30:57 -0800 (PST) X-Google-Smtp-Source: AMrXdXu057KVS115g+KcPfaPhWSexAs3QbOGtGP/acuhC7BKNWEhKQIJTcO2gvnGTRmGpOQfoDUw X-Received: by 2002:a17:907:d48a:b0:7c1:766e:e09 with SMTP id vj10-20020a170907d48a00b007c1766e0e09mr62827492ejc.29.1673364657169; Tue, 10 Jan 2023 07:30:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673364657; cv=none; d=google.com; s=arc-20160816; b=Acx1PwUHVRogmMMLucDfCzoE10ic7zC8Gppm5J29i6SBk7qGh5bfi2ihzLHYRAD3tO 4pSo64fMPQ8jazsUqvxQefaR5ose3yRDIZDOMdsC/NT9GuQITvr7DTHde6mlz35XCbU5 ys01BkgfYkqDSpVo+15zrN0J1/g6RkuMfegTkR2oyxNqSwUoM3yhNeModlhOOFuLfuwx cymz5PHhowJeF06UDy9igCsk+e1P/Uijw6Zx0+IgsWndqZX46Zf4tGJ555lI0gWLS51s nLgge2gE/dh/oiwH3IkbuyK53nXICeQUC8GRqhJsrKVPVWD6QdbXSYEpImO0w7h/WH8w grxQ== 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=Y9TFaBNCB2DZlBpUhclkx95oVenxfjVvcEEeJ14NYjM=; b=XsDaXEwr7SZT6Ufd7nOX+jKGXSHrJsxQ7HRsZNPd7PvMR/exbol7wWkYcXB3eKAdyM HkfYtk0sGH3buLA2Qi6OfT5xSK9JM+WbI1yN92UyXSHXYdcfFDY8A1x6JWF51S+++IrW yX9rchOreq5Xika8WmpPaB64Yy+lExRMmMFgvMC1YbQG+y6KDPEHcSXUjGMtvu0v7DN8 4TLphgqVhgHkMAvyAMjkU3mTfQIO2f2Xb2/AgVufLm690tioY5K9S67FItsYP1ULzscs rNJWw/yoWQ2NNs6WqLUM+KRQwFMiAeFDECtq+gAvMvhqT/CxeTZOdIWtuJEbEZkAVGSt 5CEQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=eevBbJR3; 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 hb6-20020a170907160600b008366ae33eb6si13710918ejc.580.2023.01.10.07.30.31; Tue, 10 Jan 2023 07:30:57 -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=eevBbJR3; 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 S234432AbjAJPaW (ORCPT + 99 others); Tue, 10 Jan 2023 10:30:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238989AbjAJP34 (ORCPT ); Tue, 10 Jan 2023 10:29:56 -0500 Received: from smtp1.axis.com (smtp1.axis.com [195.60.68.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 157EA2726; Tue, 10 Jan 2023 07:29:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1673364568; x=1704900568; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Y9TFaBNCB2DZlBpUhclkx95oVenxfjVvcEEeJ14NYjM=; b=eevBbJR34FKLdiGa3nhhjG4He3cHT8IHcOwNE8GCLSrZauViP/ynvhCQ Wk7dEULvk3B7bY8ZYx4i+sAwtLV61bJ/yUXd27BFwx3ZXg+sNgzBSsX8B MqidddrfbAPL6rkwRrTlVTK3MpjlQTLR6bhCZU8y9g0DYsaSLxLXfVZ1W rN3x6Y++IN7QPr5+igQ0m1oNDOpdX1H363DbUDA+uJVD/apOfW5P3lA67 DPU7SMiWFlxtdU510KKH9qJIwDpLWvuV1ny/a1kL/sqtb3lC+PC0EGIRT +8jK5UJp4KNJArIzxi4icVV3I5ormvfIN3LwnIwOMa+320NSJHZp1CBCm w==; From: Jiri Valek - 2N To: CC: , , , , , , Subject: [PATCH v3 2/2] Input: cap11xx - add support for cap1203, cap1293 and cap1298 Date: Tue, 10 Jan 2023 16:28:59 +0100 Message-ID: <20230110152859.295881-3-jiriv@axis.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230110152859.295881-1-jiriv@axis.com> References: <20230110152859.295881-1-jiriv@axis.com> MIME-Version: 1.0 X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail07w.axis.com (10.20.40.13) 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?1754650019135037868?= X-GMAIL-MSGID: =?utf-8?q?1754650019135037868?= 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 --- Changes in v2: - Fixed if statement. Changes in v3: - Model names sorted alphabetically. 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);