From patchwork Fri Nov 18 18:21:29 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: 22424 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp343811wrr; Fri, 18 Nov 2022 10:22:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FM7sd6aTkjVcVHp3Tmg+DBDmVlZmMd9lxn6nCzSN1JTtWQF5q5zTxMdifz8PPmBjrFbOt X-Received: by 2002:a17:90a:194b:b0:20c:c0f:7c69 with SMTP id 11-20020a17090a194b00b0020c0c0f7c69mr8764314pjh.196.1668795769959; Fri, 18 Nov 2022 10:22:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668795769; cv=none; d=google.com; s=arc-20160816; b=ytbFLZ8HrI4RLLIFWkQWsq319p9+ULDJ/4fRbJJWewQ3LTXXtEsaDgrTk2yXhKgeQN 0yclvqWJsXZzPyKAo3EOW4d/eiZ1khxkFQKFmZi0AfgOoXjZla8r3Yj9au/QeA4tujjX 30nJFxxhpsXJk0cGvGsj92UB+dpW7HRS1Fdjgv9t0D7r6wVfG6weT/1hC4mED5D6qDMk j9c/oOF22IbutEVjHaYot2UxS0W6CoRFeVOBT2x4Dilssuhc4y0a3Ve4hc4PKN9TnE2B SNFA5jgW34XIa26lCI6LCoWrhaJxCptDIHg4HpTz1hg4chOkg6wgJKZbVYLTE36m1dJW t5pA== 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=nKZq4tmaBqgKx9awfbe4f1Daih6aVe8UbZ5zGA/hMz4=; b=UWKVL4J5DeUhrhAj07u5gygHGVHPgFi+6IBIrKoKO0S8PVcjeUJ4aP9XWy0pC47MqQ ++MMhtcMTRDSTAWnq7QFtWvMuPoTsyMiYSQF+RHyB+d6Azsif/3oKYhtBe3IQvkQSPd5 Bq7U4S/Eg36MZNL8VwcLmz3V57T2CtsUFJyCNERSa5WlVdvhm8I0EcBnkZ0t96kn8Q+4 HuE0rRUm7SwMwlouSs0F3c9fLVR4ePXuowmU+GjRVmX5TOz7lGhPRRnplB8BkfNE9kuq Bba66O2ryHNDC3CvKfm4ZkgJ0oMq4rgnF4e2b/SoMjwL4M9Fb6GDAHUnvp1mERLM9Ope EIAw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=Pce44jgm; 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 n15-20020a170903110f00b00186abd0c784si5148666plh.217.2022.11.18.10.22.35; Fri, 18 Nov 2022 10:22:49 -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=Pce44jgm; 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 S242635AbiKRSVv (ORCPT + 99 others); Fri, 18 Nov 2022 13:21:51 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242606AbiKRSVk (ORCPT ); Fri, 18 Nov 2022 13:21:40 -0500 Received: from mail-40141.protonmail.ch (mail-40141.protonmail.ch [185.70.40.141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BFED92083 for ; Fri, 18 Nov 2022 10:21:35 -0800 (PST) Date: Fri, 18 Nov 2022 18:21:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668795693; x=1669054893; bh=nKZq4tmaBqgKx9awfbe4f1Daih6aVe8UbZ5zGA/hMz4=; 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=Pce44jgmteToADvrAXVbI07aA92l9gdqKYlzFvdEj9sSN9SPpMwSWqXEIl1DbR1Mj joc5vwOkadInRqwWSep31MasbvcVEETJMpEIUam/qcaBh5JBDdabekDAJERXUDDbXB 8fctyIQ+uSjdUdXmIXAG1P9o8bMaZvwrXlklQ7rDBd9afiZuTRtBW1C5NX01KoGLlr Q5QIKWl9dbtYmPJltKpsjGHt5zY6ytevGYR1w6bQB8AvH1DHUl0TfO7wSKOVBcmmOr CVuMveIwjg7KkCxm+NpefO+B+IVMmwRELMq/FdaHqG0pBBlExChAUCsf+E07g13DOE 8G6PlIbwiqHDg== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Markuss Broks , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Henrik Rydberg , Stephan Gerhold , Nikita Travkin , linux-input@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH v2 1/3] dt-bindings: input/touchscreen: Add compatible for IST3038 Message-ID: <20221118182103.3405-2-linmengbo0689@protonmail.com> In-Reply-To: <20221118182103.3405-1-linmengbo0689@protonmail.com> References: <20221118182103.3405-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=unavailable 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?1749859193546266524?= X-GMAIL-MSGID: =?utf-8?q?1749859193546266524?= From: Markuss Broks Imagis IST3038 is a variant (firmware?) of Imagis IST3038 IC, add the compatible for it to the IST3038C bindings. Signed-off-by: Markuss Broks [Change from IST3038B to IST3038] Signed-off-by: Lin, Meng-Bo Acked-by: Krzysztof Kozlowski Reviewed-by: Mattijs Korpershoek --- .../devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml b/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml index e3a2b871e50c..a58c045d2ba1 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/imagis,ist3038c.yaml @@ -18,6 +18,7 @@ properties: compatible: enum: + - imagis,ist3038 - imagis,ist3038c reg: From patchwork Fri Nov 18 18:21:39 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: 22425 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp343972wrr; Fri, 18 Nov 2022 10:23:10 -0800 (PST) X-Google-Smtp-Source: AA0mqf53Jlagd4atNkgWQicmOOCjQEFRH/ve1a4ICHHbdWwoHBnxY4DPLmn+S7NjRhrgundoYAlh X-Received: by 2002:aa7:8d01:0:b0:562:83c1:59e0 with SMTP id j1-20020aa78d01000000b0056283c159e0mr9054847pfe.34.1668795790357; Fri, 18 Nov 2022 10:23:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668795790; cv=none; d=google.com; s=arc-20160816; b=ZXmgZNrTUTZVDOQrLWdV4UnZ0OSN4YOM6x3FceXDE00QwmjJq55E/RBEp3OF8Zm5sv EYVFaU42NQbdXJvB5EIZok5TMOaR1GuZZeff5ifjuWEa9I8X13g4FpdEVJOJk0dNH1TD dC0B+h1IpPP4q7R20Rl3SE4akXVqor2ZS3lMG7vetQFuIf1tEnjNy1s6s4Kxk6iSVZgN oxeAM3fVjQj7PvJER5o4R+hi5onVXrLLI7f+xrNim06CoiPNPr3rFhU0BLWQYNXLLAJV KcnUxBbjAJEvPCSv6f6U40Z3CRz5NgUL3pWzQfTzhhWq/zGtSh+4WlYFy1w+diM3Gw5q smTg== 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=4aGhH9EhVaylkFLr9Cl301UNeKoyJLsI4X3gUZFSH9M=; b=zgXYEpNWUWzxwzHCJ2zSZdxlUaeUqrolWK3WpVr5Cum8mVZWAZRLl2d+Jvb2n6vdVs IkXnplPMyCOzqSgDXdbYs3dAw12H8J69RT8IbT6861IT1yffHnIttW1FMSrTD5pX+ogS dLelH+lH5GcfWjRnDohmg9G8Cc/eLFmaOJEGZvn14gqF+zQLBp8GpTw8Mgo1Kb9TtRoO zj8UMXEKu1zjLdVPGy8OzCn90Wm4TEJXmVZCFa6KVwfL9x9mQ9NpFQfUuWfSzzp3Gx+W khkWU4BQsAHb5WcVZYukwJsnSKk4jYF+hjlAMUZCcQMY5Boo9kXg2ruyDCtLJELIyQkV 5UzA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=Z5HVHKGD; 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 u14-20020a63790e000000b00477341c0e62si1556822pgc.721.2022.11.18.10.22.55; Fri, 18 Nov 2022 10:23:10 -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=Z5HVHKGD; 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 S242640AbiKRSVy (ORCPT + 99 others); Fri, 18 Nov 2022 13:21:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60850 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242584AbiKRSVu (ORCPT ); Fri, 18 Nov 2022 13:21:50 -0500 Received: from mail-4325.protonmail.ch (mail-4325.protonmail.ch [185.70.43.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C5FAB7DECB; Fri, 18 Nov 2022 10:21:49 -0800 (PST) Date: Fri, 18 Nov 2022 18:21:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668795708; x=1669054908; bh=4aGhH9EhVaylkFLr9Cl301UNeKoyJLsI4X3gUZFSH9M=; 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=Z5HVHKGDen/kzJHlqMSklLwNX41bXVqxyGPXLYKWygFVqURHUnbdLDs1VBD+MX1/3 nchNN+godIa5cgNoazTOpsyZGdiGyfhS5fzP5xj9pJFlkx89hiLyF2OtI7hFDrybeZ +fCNGDuCPhgbHxPpol81P8tcn+DYMSS/vai5TxpQhaD7AqwjyCDZbYT0FZE6Xa1jcP 6BsZrLKqR06JkZ9lPYhB168Q5wWlT1kXIVHJTSmau7yUom7Uo+MywpGRLbQNgW8t4a tNYK9zIP/radRqL6skV4JFdi3Yy5PLcSq+H5LQf6j99cLs7LCy6DR4j2TX+/nqeJMy 47FFiqmcI7czg== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Markuss Broks , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Henrik Rydberg , Stephan Gerhold , Nikita Travkin , linux-input@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH v2 2/3] input/touchscreen: imagis: Correct the maximum touch area value Message-ID: <20221118182103.3405-3-linmengbo0689@protonmail.com> In-Reply-To: <20221118182103.3405-1-linmengbo0689@protonmail.com> References: <20221118182103.3405-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=unavailable 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?1749859215089122371?= X-GMAIL-MSGID: =?utf-8?q?1749859215089122371?= From: Markuss Broks As specified in downstream IST3038 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] Signed-off-by: Lin, Meng-Bo Reviewed-by: Mattijs Korpershoek --- 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 Fri Nov 18 18:21:49 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: 22426 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp344089wrr; Fri, 18 Nov 2022 10:23:24 -0800 (PST) X-Google-Smtp-Source: AA0mqf4ByFLHP/cxdWIh1B9XIZ9IMGiobRsp30nkiGQIeSVAHJdyu+BPHSsakoBzKonQpnGPhloU X-Received: by 2002:a17:90a:4207:b0:209:46fe:871b with SMTP id o7-20020a17090a420700b0020946fe871bmr15046123pjg.163.1668795803014; Fri, 18 Nov 2022 10:23:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668795802; cv=none; d=google.com; s=arc-20160816; b=VgCgw9Jz+6ouZ/I/bN9th9PrmNzSXIYPQar1LraqKnM9RiDo+mxPn7rdtYE3ttj6ks ymIGLvRFLJ25c/wEr6WgNAwHdi9FlqwPtA/7HZczXxw8e7/Lb9WdE1qmC8VQxrnN3sP/ rlSEHkonq/+2mxMVasZdfcnZiYhW+1hfA4HXcYLfEkO0Ut4G/TJ6bbyRQ1d7tfQISQcX Grf3tQHLjLR2UMm65wqRrubuwPrnL6JXm8SO2B8BiRq9IWrnkFTNNietvbErddfmFbu5 PBzQxixTBJ4VAa9ytbAyLVf5kwRDXCYh+u87n0tUZTL3Pmf6RU3hOGNYL4b3BEhJ4nuf Zf3A== 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=pbKTa64ww9zf2YjQDVJFvTEv+LvOGCj/fGrZioGjwnM=; b=MrCLOBNCE2t85OI/bKONkqbiOysBsOpHfdVE1qzK1Gm6AjqLBWk6vFpB4pX0A46W77 cA5e/v+rx5kmXdkVtrP2J2VedLjcgilJwesK+2plVs0vCzHv8Q23H3cbVo5ooFoeHwaa K5b8lVqkTFCh4lbrUKEYfrHXHNs+Z08xt3Rl9m4GqWYgj/ve3GFHchklSrRpI3NQ/vMJ q9j8G8/LD2bN6HLblzM8UfePAkAvihochvCh4ae03ljd2rEEC5gW0tD4Fo2UKdn9Y5Lk 2MN1my04lQaMuifYflfqk2MDLqygKnSdG/4jh9OtQDdFEBFOiyi9mG3ByBRTqmwkli2t Y8WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b="TwT/sYEO"; 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 gp20-20020a17090adf1400b0020b0b8df3d2si3583315pjb.57.2022.11.18.10.23.09; Fri, 18 Nov 2022 10:23:22 -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="TwT/sYEO"; 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 S242653AbiKRSWW (ORCPT + 99 others); Fri, 18 Nov 2022 13:22:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242658AbiKRSV7 (ORCPT ); Fri, 18 Nov 2022 13:21:59 -0500 Received: from mail-4319.protonmail.ch (mail-4319.protonmail.ch [185.70.43.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7638E922D7; Fri, 18 Nov 2022 10:21:55 -0800 (PST) Date: Fri, 18 Nov 2022 18:21:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668795713; x=1669054913; bh=pbKTa64ww9zf2YjQDVJFvTEv+LvOGCj/fGrZioGjwnM=; 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=TwT/sYEOpDbDsX8Nr6x6hyvqKYFrnxnVlSH13Oynr7KYbR6Fg29S2qwhKEUjG5jqV QXhyCLx7R2Xg2YF4HaA6HdlND3j9TVGOoAAIj6zSzbd3nG3qPbNwGHxTbuL7y21AXK zki3z7GVHiH2kQLsCA2iKqzM5tyw3fhhy1/NBm9thn8nA39J9+pPpcOXB6RyG1Hnj1 TtA3dNnXQ+xbkw8aE36SRqrWcEUGI1uwBsKtIF3ZYYiqPQHrurqloRvYU/w3Fj3mJU mxQV8r3W4QyPTkL3+Sb2hl44CLQb/TVXd5vMVjHzz6gRe8MmRkq56kNSfarUHpPwuv p/0pr1DM63NMg== To: linux-kernel@vger.kernel.org From: "Lin, Meng-Bo" Cc: Markuss Broks , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Henrik Rydberg , Stephan Gerhold , Nikita Travkin , linux-input@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH v2 3/3] input/touchscreen: imagis: Add supports for Imagis IST3038 Message-ID: <20221118182103.3405-4-linmengbo0689@protonmail.com> In-Reply-To: <20221118182103.3405-1-linmengbo0689@protonmail.com> References: <20221118182103.3405-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=unavailable 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?1749859228021035209?= X-GMAIL-MSGID: =?utf-8?q?1749859228021035209?= From: Markuss Broks Imagis IST3038 is another variant of Imagis IST3038 IC, which has 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 Reviewed-by: Mattijs Korpershoek --- drivers/input/touchscreen/imagis.c | 62 ++++++++++++++++++++++++------ 1 file changed, 51 insertions(+), 11 deletions(-) diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen/imagis.c index b667914a44f1..eb3b0684817f 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,25 @@ 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, +}; + #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 }, { }, }; MODULE_DEVICE_TABLE(of, imagis_of_match);