From patchwork Tue Jan 3 13:41:05 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: 38429 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4626379wrt; Tue, 3 Jan 2023 05:44:51 -0800 (PST) X-Google-Smtp-Source: AMrXdXt4pDAvtKAW4/1kGNbq7/CRe1PHX5pLowlgnsWrJyYfDvKuG0uulJzATejZJfYUOm7BegXX X-Received: by 2002:a05:6402:1cce:b0:472:1b3b:35f1 with SMTP id ds14-20020a0564021cce00b004721b3b35f1mr49552677edb.21.1672753491340; Tue, 03 Jan 2023 05:44:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672753491; cv=none; d=google.com; s=arc-20160816; b=W84N2VbSKMSTWa3uVEv8On5BpoCDhxqyShMkZrpPbiURjLJCnSfD2lJ/tMbLBkiYG1 y53NKKT+8zNaKWF8YWBt7MkYaWMZutyBCV4qebLj+PR6bY4M5I8aTgE63szzMZTEBEjY 3CVi4Jvgw1wjo0yoXdBtHsK4rnWT0QcyICKykVznMBEyrAWKOsfZ0jt3LcgVYzSdX63/ fVKkl//9yrNtSa/Is78tvZ6G+HT390IuW1VTg1Jk/jdK7MnIj1gwT7gj6bKlmexpHVB/ fzIGHR1jgH6rLjD81hpWePcrUAJ0kxvr9Dyz4nIDvHkmsnNQtz+8Ci1mCbDQRIQDhsjh RTRQ== 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=SRMK9ZFIllFl+4lflyBvei6idrkhW9/rumwBK8/9S3g=; b=uDVLS3DIzL0dQ4AoHJ6yPe0VaVqg403iiy+gwDoGdQNVmlcKFYfq9EuxNlfirrWw6H DMiPR4OI4E8F9tLT81w1OO8ysR9SApBnGgwvusRv5k9VpCwJyZqb8cEyLIBWjVF/pHML CEffZZe1YngTXdO++tii+2u6V4zzBQHYhsJefOym7blb0fVG6/KezdgAbwU1MI1JyABG WbgIrNOwp42wIXruOdk7EFaY42sTl7NVTwaZ1uVldI/qANiHKDhhp6OP/5KTlaERPCIr Dr2Z9mswVf4cArYqL1Alao9IAsgCI3tPsvcAYbFaYg05shGyUjEe27lrEE5+4RN4vOLm EO+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@axis.com header.s=axis-central1 header.b=SCi+DDpt; 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 b20-20020a056402279400b00484d2a31c84si22926437ede.473.2023.01.03.05.44.27; Tue, 03 Jan 2023 05:44:51 -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=SCi+DDpt; 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 S229637AbjACNm4 (ORCPT + 99 others); Tue, 3 Jan 2023 08:42:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41018 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230337AbjACNmv (ORCPT ); Tue, 3 Jan 2023 08:42:51 -0500 Received: from smtp2.axis.com (smtp2.axis.com [195.60.68.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B1AD610FF3; Tue, 3 Jan 2023 05:42:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axis.com; q=dns/txt; s=axis-central1; t=1672753370; x=1704289370; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=SRMK9ZFIllFl+4lflyBvei6idrkhW9/rumwBK8/9S3g=; b=SCi+DDptFfzcA4cNYTK6sWeLOHUJ91fi5AaCBafUv9BCIU+qXNZ6lyj6 fAegqXgZnrNup0YYgSckbvYpCCdNJmm4mqi7MZCe0iLZeWhJcGgBmy959 bG0BelxJFbf+MHUf6uUKKKcLk1iSkA0A5CWjGA1vpMl1kXntP0FwAZHDS e+FF1UF8rGDhsLkK5z6u9hCMo+03byLNUOMQavdF/aBTgoqigh4x/KYGZ oLlC9ltmbqBhAlMXTJnDVDSmWzjJ+bheoi+DEJsR1qPknRcAwOid9Iux8 CMcckam+aT1qchH28DPHCCd0sBHnd+soGAppJqhZcxM/4Lv/DXYrptTM7 A==; From: Jiri Valek - 2N To: Dmitry Torokhov , Krzysztof Kozlowski CC: Jiri Valek - 2N , Rob Herring , =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= , "open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list Subject: [PATCH 2/2] Input: cap11xx - add support for cap1203, cap1293 and cap1298 Date: Tue, 3 Jan 2023 14:41:05 +0100 Message-ID: <20230103134105.736346-3-jiriv@axis.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230103134105.736346-1-jiriv@axis.com> References: <20230103134105.736346-1-jiriv@axis.com> MIME-Version: 1.0 X-Originating-IP: [10.0.5.60] X-ClientProxiedBy: se-mail01w.axis.com (10.20.40.7) To se-mail03w.axis.com (10.20.40.9) 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?1754009164726009829?= X-GMAIL-MSGID: =?utf-8?q?1754009164726009829?= 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 --- 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);