From patchwork Thu Nov 17 16:34:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Meng-Bo" X-Patchwork-Id: 21801 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp499936wrr; Thu, 17 Nov 2022 08:37:58 -0800 (PST) X-Google-Smtp-Source: AA0mqf6F/xONgRl8kYrkQycmkf9YlHG3XYrUrMMAQJbXRjLS+MkdQyjEP3lfv5Q3TwF3W07e4m/V X-Received: by 2002:a05:6402:1107:b0:463:9b53:cbf6 with SMTP id u7-20020a056402110700b004639b53cbf6mr2945632edv.173.1668703078436; Thu, 17 Nov 2022 08:37:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668703078; cv=none; d=google.com; s=arc-20160816; b=GfEUR0oTrnK5Y1Jrv0Y6Img3p6jnvnGIh5vUyjrV00vk1Rp2/APF8AwdIvxlpGQ+7+ vXJRnIoQuvoXMi9Pf1QKigXuxp4bZVsc5oe1hsw/7dQKq8jwL1/ovUsdX+adf36k7C++ 8/TQebPNp+7mjU7FyjPxPFA1yVP61mL/Q6FNujSVf6aGCn5XPauU/NPUaT3GSLk3w0a9 IdHBq1cOwsrGyLCRQh/jxOdOw54WS2Fw4kWiFElNF0szXCDab+eb6WgIJfnwXc5ortEA xbmS7uI9bz3OjhfVnenvosJ4OLGxhuXF0Xe/GWfd7l0SHOU/FnjXJNe554lZx+THVItF 2kYA== 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 :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=j/4kwDCI6yUOY0rbKjZzBAtwpPVlmEC4din4OfwGdS4=; b=H6nUmvVisH+mGSbubnboAcR3cJnWaj/K67oEhUrO22uU8brjGDN7tAflovFjpFAZaC QN/PxsMCDVpVZqv3/TFzXPnGLTIjDrlgORt8JlVY/DCyiFy6A+R7HmP+LvcJoHhkZwyl 64N1qlYm7gALU9p8ArihPH8STHEz8etaD0PLrbnmf01oS1wW2sTkcO94KLgDYrymxXe6 jhmOxwFfO+V9+VpIVBvefyNsHGA7KSo8MLl2gLKdZWWQxwODFzJ0GKb4dxnRKBN3ltIi F8evgwiEKMl/2GPiaTKtHUS2MzKKK45h15SinUgxKlU41xzLsHwHwPzxbkhF7qvZwOBU 5jgg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=v5piwaPl; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wz5-20020a170906fe4500b0078d3babe59bsi995029ejb.401.2022.11.17.08.37.34; Thu, 17 Nov 2022 08:37:58 -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 header.i=@protonmail.com header.s=protonmail3 header.b=v5piwaPl; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240746AbiKQQgT (ORCPT + 99 others); Thu, 17 Nov 2022 11:36:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240730AbiKQQfw (ORCPT ); Thu, 17 Nov 2022 11:35:52 -0500 Received: from mail-40138.protonmail.ch (mail-40138.protonmail.ch [185.70.40.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AEF605BD42; Thu, 17 Nov 2022 08:35:06 -0800 (PST) Date: Thu, 17 Nov 2022 16:34:58 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668702904; x=1668962104; bh=j/4kwDCI6yUOY0rbKjZzBAtwpPVlmEC4din4OfwGdS4=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=v5piwaPlqFYkj5womeFjfYDC5qiVpMjM7aWis7iwCbg7PT+E2KU9pAFaJ2GkDOW2z uergSTIvPHwyAOKlFp+3VgLV3THaOWMD4v641ZVYlsIRR0Sy3COF40lIg53UJOJ6eP Qc/qJOupnh/TnnVXTXFXFfGRqVI+FY5hEh6QwkT5KpOjRwpHTgz+3/jJOY10LBIgiF AM2ZfJWB3mAHbDJlvekjS7+m6eHTu+Ky46UdJzQqURGvaZL9O8JzHQDff1/HmuGeQI hCB30WO60muixsNzi4m3By9rGjhBwHBrI0uNpxrx0RMGCo3YryVC1F95XfeUkOv+Hj I19FSfScQM02A== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Markuss Broks , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , "open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Subject: [PATCH 1/3] dt-bindings: input/touchscreen: Add compatible for IST3038 and IST30XXB Message-ID: <20221117163440.23394-2-linmengbo0689@protonmail.com> In-Reply-To: <20221117163440.23394-1-linmengbo0689@protonmail.com> References: <20221117163440.23394-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_MSPIKE_H2,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?1749761999666418367?= X-GMAIL-MSGID: =?utf-8?q?1749761999666418367?= From: Markuss Broks Imagis IST3038 and IST30XXB are variants (firmware?) of Imagis IST3038 IC, add the compatible for them to the IST3038C bindings. Signed-off-by: Markuss Broks [Change from IST3038B to IST3038 and IST30XXB] Signed-off-by: Lin, Meng-Bo --- .../devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml b/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml index e3a2b871e50c..85390f6ffe36 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml @@ -18,7 +18,9 @@ properties: compatible: enum: + - imagis,ist3038 - imagis,ist3038c + - imagis,ist30xxb reg: maxItems: 1 From patchwork Thu Nov 17 16:35:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Meng-Bo" X-Patchwork-Id: 21818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp505300wrr; Thu, 17 Nov 2022 08:49:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf4Trx1iO5tIfklf+bgBN4aM7HVIAa+k/XZp0gXX0FTRVP6TfP/y8arGby6VN4MPEqIv0EPo X-Received: by 2002:aa7:db18:0:b0:467:e2dd:b593 with SMTP id t24-20020aa7db18000000b00467e2ddb593mr2888820eds.378.1668703768280; Thu, 17 Nov 2022 08:49:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668703768; cv=none; d=google.com; s=arc-20160816; b=wRrwnGDgfYOejTbk4OL18jC/NIKcTXzQ+5rdHePRlBaiPTlghbQ8j0xtQE9u3TkLhu CiOPg/uaN9AzjMKt1ToePmbuZ6wMhn5cgZz1trcGLqkLKReL9XXwOWCyMsG/pu5mTSCr KZF/OlaujjMwvmnYjJSaFQ313awC0FZYtgpJrAOT321RdD8+q8ZzBUymdft7YC9AQC9k VF3rc5N6aygBe6/hETTux+MrqkIwJzdyPCpMakgWyGXmkCfL2NwGzccU42QUMeUftwXg EDm4e8uwEZnRkHI3uUSdLpIgK1jXGzjoyPeay4jFZErVaifxocWJY6yKt7py1wi7/qv3 x2+w== 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 :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=T794GTPNQYc9tJalhy0LCsNElYleSnXWekOIp9tkVi0=; b=VHucwfViduh3+RFUC8eG0ryp6Pf2HWFeDne7E5swuJNaqA/HN1/cABJwY6GXSEK4ks Hmsmwrmug1mS8PD9eXIgTkl0dTgS/ws0aorEsCarMgpf2euIYHZUKZBHdO/L0EGVVulR 0o7Oj+xlDTw42gWbyGQHa+qIHKBU2kb9805R2MrgxHfmjb7MFcv94PFZIb3wmUavjjsA GrQ6suyrsagejGvUbUUHvZBMdI2QvrQDRDwwLW7I/MZ5/NswCdmrDvBN+eRHJQsENJsS kN1OR0gFX4/9vIjRw8ctArFWY57mg9NedteZC8TGCfW3gUWIzY9mjeZvXtbJgTtoMaxP IM8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=gwkXwMZw; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020aa7cd05000000b0046443638c9esi1113766edw.262.2022.11.17.08.49.01; Thu, 17 Nov 2022 08:49:28 -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 header.i=@protonmail.com header.s=protonmail3 header.b=gwkXwMZw; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240753AbiKQQgh (ORCPT + 99 others); Thu, 17 Nov 2022 11:36:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240609AbiKQQgN (ORCPT ); Thu, 17 Nov 2022 11:36:13 -0500 Received: from mail-0301.mail-europe.com (mail-0301.mail-europe.com [188.165.51.139]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EF8B73426 for ; Thu, 17 Nov 2022 08:35:20 -0800 (PST) Date: Thu, 17 Nov 2022 16:35:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668702916; x=1668962116; bh=T794GTPNQYc9tJalhy0LCsNElYleSnXWekOIp9tkVi0=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=gwkXwMZwxr4Avx4oXTOoKywGukieqd7ts3LOAGkWKLd6fsJJzdyBPn099Y4jm/2KU v5hbnHhlv5LIumBS7L5F9JGJzfsvGI6iCTGRnv2Wzlsn4U2jySV6RYjCtuSGfkTgvi o0KxlyrxWicBL50lDvJQdOLK2uvq8magN75kPT0BXvR7N/7vfxnAydfpYgJGfQyowh Fb9GMxLZx7kBSOZCSzY0jsGiBSDm9WnuUVh6pTaG4pi7iYHzVXgNUVHwi+DxDptDHm /ZYwSNDKRcBFlCPIKKC82cK5QR1tH+AcZExLRGdWXhMJz5Xax+3gvUDfVpaVfUwd+9 TllrvZV4mDkoA== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Markuss Broks , Dmitry Torokhov , Henrik Rydberg , "open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." Subject: [PATCH 2/3] input/touchscreen: imagis: Correct the maximum touch area value Message-ID: <20221117163440.23394-3-linmengbo0689@protonmail.com> In-Reply-To: <20221117163440.23394-1-linmengbo0689@protonmail.com> References: <20221117163440.23394-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,SPF_HELO_NONE,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?1749762722381301615?= X-GMAIL-MSGID: =?utf-8?q?1749762722381301615?= From: Markuss Broks As specified in downstream IST3038/IST30XXB driver and proved by testing, the correct maximum reported value of touch area is 16. Signed-off-by: Markuss Broks [Change from IST3038B to IST3038 and IST30XXB] Signed-off-by: Lin, Meng-Bo --- drivers/input/touchscreen/imagis.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen/imagis.c index e2697e6c6d2a..b667914a44f1 100644 --- a/drivers/input/touchscreen/imagis.c +++ b/drivers/input/touchscreen/imagis.c @@ -210,7 +210,7 @@ static int imagis_init_input_dev(struct imagis_ts *ts) input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_X); input_set_capability(input_dev, EV_ABS, ABS_MT_POSITION_Y); - input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); + input_set_abs_params(input_dev, ABS_MT_TOUCH_MAJOR, 0, 16, 0, 0); touchscreen_parse_properties(input_dev, true, &ts->prop); if (!ts->prop.max_x || !ts->prop.max_y) { From patchwork Thu Nov 17 16:35:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lin, Meng-Bo" X-Patchwork-Id: 21815 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp504900wrr; Thu, 17 Nov 2022 08:48:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf47nx67exwQMkR9HCZ5QDAcL5ExRHJFHz4JsxSQplQMyXuE1g5A+1cOQaKH9SJOz/6jHN1C X-Received: by 2002:a05:6402:1045:b0:461:68e1:ced5 with SMTP id e5-20020a056402104500b0046168e1ced5mr3015071edu.142.1668703720402; Thu, 17 Nov 2022 08:48:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668703720; cv=none; d=google.com; s=arc-20160816; b=f81TuyW0l530LIfF6Pm/YXgyuZC2+ZE1PMrHqasuVm3x+PxkFWB+hIrXKfCQn5kPFa Qz2BM1JD1i+qpwJaK3D8VVeBp+t2f/fMkEBHxqB2bVpI2SIAlVXwP7+ScVJ+j7BZSJtU v3RQSrQlYaeJ4KdVnzPRs2koBNzzV1kvzZK/XCUaxgX7qoWRHPHkTytVWJC92hE0hcec ungWsd1UPvMfiU4aznxMTi532/8lg/8E/dr05F7k7ok32aSPCWKQ2XC4Kde9ls2kybFr J1rOmTQTWC+RNc91bH67HWYLd0GSsZ30ds31AT1EBnyWRcR89zguy5f/bG/qhzNpWtO8 GpmQ== 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 :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=ZA1st/D2bOJO8psxoWwnXrvaoM+06eI7cmwLGnc8W7k=; b=mTGJ0FwWiY5e/GzZmo+/pMWFror/Y0MKZuWxqQz9dtPPFJ5sTbZYvtRzCsOUvKFqGD vPbyTbiTMoe8ZhbBeQVdyLmDjtXPZ3wcEoGyXilTm5GhvpEt/adiZDkEP3eP/wzZFV4a /hguYsCwZZvH8/S6s9/Wzq/VtHS+52u6Ewqm+Hm1Si4ho9IX5XWctbiw0yHabIuczNOH Z7AiurLlNvMvVUqkqv7/etlqtjIBAU0BVsDlD9pDShZjgIRlDEpMCIzXPBn9iQzcAtIx pCkOwmLkVeFsGJ5iABxmZ9b9MHeyIu4D/kP6EGJ06empqWGqFgjkxr4SGV3OlAiz+SS7 Hahw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b="Cg/Rlu/2"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h19-20020aa7c613000000b004520b01a355si1178515edq.52.2022.11.17.08.48.15; Thu, 17 Nov 2022 08:48:40 -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 header.i=@protonmail.com header.s=protonmail3 header.b="Cg/Rlu/2"; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240188AbiKQQgt (ORCPT + 99 others); Thu, 17 Nov 2022 11:36:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240130AbiKQQg3 (ORCPT ); Thu, 17 Nov 2022 11:36:29 -0500 Received: from mail-4318.protonmail.ch (mail-4318.protonmail.ch [185.70.43.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E4205DB99 for ; Thu, 17 Nov 2022 08:35:31 -0800 (PST) Date: Thu, 17 Nov 2022 16:35:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668702929; x=1668962129; bh=ZA1st/D2bOJO8psxoWwnXrvaoM+06eI7cmwLGnc8W7k=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=Cg/Rlu/2jqHXfQSr7sNItLVNNQ8xw1yzzKzYf8K5EMSh151LtJXqRwMonFpaWvGT+ m3VRhU2bAOT/WAu5KJYxYAQCooAAzfWXaISejENCgIP3HHawXBNfehg2onZfMB5avX VD7T8+Ld08rrX9oOYs8Q5viqVR0/fVBUy/oE1tJVkBC7FFv2WAgmn7ZKLJWthjPcqP L1H7wuODL+BlaLInXICffS8CRknC4tXCUouXmJ5vWGYc2NmGLLuWwiwJQ3Fji1zCfq cEMI1UzELsmhHgAQhuZlkWy/P7jSj0d3fDhrJE/Z9q0rJeREuKORvYXuVoD+c954wX tuIsz4dOurcPw== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Markuss Broks , Dmitry Torokhov , "open list:INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN)..." Subject: [PATCH 3/3] input/touchscreen: imagis: Add supports for Imagis IST3038 and IST30XXB Message-ID: <20221117163440.23394-4-linmengbo0689@protonmail.com> In-Reply-To: <20221117163440.23394-1-linmengbo0689@protonmail.com> References: <20221117163440.23394-1-linmengbo0689@protonmail.com> Feedback-ID: 40467236:user:proton MIME-Version: 1.0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,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?1749762671842105426?= X-GMAIL-MSGID: =?utf-8?q?1749762671842105426?= From: Markuss Broks Imagis IST3038 and IST30XXB are other variants of Imagis IST3038 IC, which have a different register interface from IST3038C (possibly firmware defined). This should also work for IST3044B (though untested), however other variants using this interface/protocol(IST3026, IST3032, IST3026B, IST3032B) have a different format for coordinates, and they'd need additional effort to be supported by this driver. Signed-off-by: Markuss Broks [Use IST3038C_REG_CHIPID_BASE] Signed-off-by: Lin, Meng-Bo --- drivers/input/touchscreen/imagis.c | 71 +++++++++++++++++++++++++----- 1 file changed, 60 insertions(+), 11 deletions(-) diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen/imagis.c index b667914a44f1..ac07b24496eb 100644 --- a/drivers/input/touchscreen/imagis.c +++ b/drivers/input/touchscreen/imagis.c @@ -13,7 +13,8 @@ #define IST3038C_HIB_ACCESS (0x800B << 16) #define IST3038C_DIRECT_ACCESS BIT(31) -#define IST3038C_REG_CHIPID 0x40001000 +#define IST3038C_REG_CHIPID_BASE 0x40001000 +#define IST3038C_REG_CHIPID(base) (base | IST3038C_DIRECT_ACCESS) #define IST3038C_REG_HIB_BASE 0x30000100 #define IST3038C_REG_TOUCH_STATUS (IST3038C_REG_HIB_BASE | IST3038C_HIB_ACCESS) #define IST3038C_REG_TOUCH_COORD (IST3038C_REG_HIB_BASE | IST3038C_HIB_ACCESS | 0x8) @@ -31,8 +32,24 @@ #define IST3038C_FINGER_COUNT_SHIFT 12 #define IST3038C_FINGER_STATUS_MASK GENMASK(9, 0) +#define IST30XX_REG_STATUS 0x20 +#define IST30XXB_REG_CHIPID_BASE 0x40000000 +#define IST30XX_WHOAMI 0x30003000 +#define IST30XXA_WHOAMI 0x300a300a +#define IST30XXB_WHOAMI 0x300b300b +#define IST3038_WHOAMI 0x30383038 + +struct imagis_properties { + unsigned int interrupt_msg_cmd; + unsigned int touch_coord_cmd; + unsigned int chipid_base; + unsigned int whoami_val; + bool protocol_b; +}; + struct imagis_ts { struct i2c_client *client; + const struct imagis_properties *tdata; struct input_dev *input_dev; struct touchscreen_properties prop; struct regulator_bulk_data supplies[2]; @@ -84,8 +101,7 @@ static irqreturn_t imagis_interrupt(int irq, void *dev_id) int i; int error; - error = imagis_i2c_read_reg(ts, IST3038C_REG_INTR_MESSAGE, - &intr_message); + error = imagis_i2c_read_reg(ts, ts->tdata->interrupt_msg_cmd, &intr_message); if (error) { dev_err(&ts->client->dev, "failed to read the interrupt message: %d\n", error); @@ -104,9 +120,13 @@ static irqreturn_t imagis_interrupt(int irq, void *dev_id) finger_pressed = intr_message & IST3038C_FINGER_STATUS_MASK; for (i = 0; i < finger_count; i++) { - error = imagis_i2c_read_reg(ts, - IST3038C_REG_TOUCH_COORD + (i * 4), - &finger_status); + if (ts->tdata->protocol_b) + error = imagis_i2c_read_reg(ts, + ts->tdata->touch_coord_cmd, &finger_status); + else + error = imagis_i2c_read_reg(ts, + ts->tdata->touch_coord_cmd + (i * 4), + &finger_status); if (error) { dev_err(&ts->client->dev, "failed to read coordinates for finger %d: %d\n", @@ -261,6 +281,12 @@ static int imagis_probe(struct i2c_client *i2c) ts->client = i2c; + ts->tdata = device_get_match_data(dev); + if (!ts->tdata) { + dev_err(dev, "missing chip data\n"); + return -EINVAL; + } + error = imagis_init_regulators(ts); if (error) { dev_err(dev, "regulator init error: %d\n", error); @@ -279,15 +305,13 @@ static int imagis_probe(struct i2c_client *i2c) return error; } - error = imagis_i2c_read_reg(ts, - IST3038C_REG_CHIPID | IST3038C_DIRECT_ACCESS, - &chip_id); + error = imagis_i2c_read_reg(ts, IST3038C_REG_CHIPID(ts->tdata->chipid_base), &chip_id); if (error) { dev_err(dev, "chip ID read failure: %d\n", error); return error; } - if (chip_id != IST3038C_WHOAMI) { + if (chip_id != ts->tdata->whoami_val) { dev_err(dev, "unknown chip ID: 0x%x\n", chip_id); return -EINVAL; } @@ -343,9 +367,34 @@ static int __maybe_unused imagis_resume(struct device *dev) static SIMPLE_DEV_PM_OPS(imagis_pm_ops, imagis_suspend, imagis_resume); +static const struct imagis_properties imagis_3038_data = { + .interrupt_msg_cmd = IST30XX_REG_STATUS, + .touch_coord_cmd = IST30XX_REG_STATUS, + .chipid_base = IST30XXB_REG_CHIPID_BASE, + .whoami_val = IST3038_WHOAMI, + .protocol_b = true, +}; + +static const struct imagis_properties imagis_3038c_data = { + .interrupt_msg_cmd = IST3038C_REG_INTR_MESSAGE, + .touch_coord_cmd = IST3038C_REG_TOUCH_COORD, + .chipid_base = IST3038C_REG_CHIPID_BASE, + .whoami_val = IST3038C_WHOAMI, +}; + +static const struct imagis_properties imagis_30xxb_data = { + .interrupt_msg_cmd = IST30XX_REG_STATUS, + .touch_coord_cmd = IST30XX_REG_STATUS, + .chipid_base = IST30XXB_REG_CHIPID_BASE, + .whoami_val = IST30XXB_WHOAMI, + .protocol_b = true, +}; + #ifdef CONFIG_OF static const struct of_device_id imagis_of_match[] = { - { .compatible = "imagis,ist3038c", }, + { .compatible = "imagis,ist3038", .data = &imagis_3038_data }, + { .compatible = "imagis,ist3038c", .data = &imagis_3038c_data }, + { .compatible = "imagis,ist30xxb", .data = &imagis_30xxb_data }, { }, }; MODULE_DEVICE_TABLE(of, imagis_of_match);