From patchwork Thu Nov 17 19:15:03 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: 21882 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp578232wrr; Thu, 17 Nov 2022 11:16:16 -0800 (PST) X-Google-Smtp-Source: AA0mqf6TYQLU7jS9nzQSoJxKnkEXsdIhnhVJRun3WHMObNylsdbrkxkl7C5dEkO1lEXfVsdGgGnd X-Received: by 2002:a17:906:34d5:b0:7ae:b9fc:8668 with SMTP id h21-20020a17090634d500b007aeb9fc8668mr3072160ejb.257.1668712576333; Thu, 17 Nov 2022 11:16:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668712576; cv=none; d=google.com; s=arc-20160816; b=fv0N5LPkYvgX+/RtUealF/U3FgEAH0Zfh84AW3JByA48s7F10RMVc5vObv743AeCUy jjx7LV5judT7vf/sOsgeoypXGSuVT64IIUXD+5VeQpK7Lm/i8PfdygHtu8Rhs+sA7HUH ZBTisSz+cFVSLvLRPuUYvp/yxN0lU1+vSNTeM2T/eKQuNaZS4w4ypAvcEITysFL+naOL oECd/fn8J/Ke/4wmTgOfTu6O3PU+90j53qtEQny/Y7mxJ0n2OjMtAM1cyCjFe2RtTMBu ddyzg/i60vcWIeEOiBq/p3nb6PrsysLPxsyH4oJEv+GxpCr/ODCJzG+vLoZa0sudwMHm B1Aw== 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=pPhr3lztAP9D8+Fn/qpXVjQWdrPUoW5KXt2NNprTE5KAQPxro+gj2aNUqxOp8ZQi6p 2qjWu51YjysCD2YWzgD/yNQoCTISGh9NiqhafeWoMR1q7Hw0nj1Qnkm3vyJSkTccX8Tb Rlj171PMxZAjfAn+GVmFuszCKUf1RuTCkiFJvXJ3AB63NV/A47s1yeDcNk0ehgtMIjxG kqflRB4t85tz4VppiJNWoDWPuL1fzNADWzzL0hf/u4FOqIGYQEojPBJx6ry6nYBnWdnT 5qmQR1oa0tGVYq/cbY8gWH5apjXP+Yb2ug+SUTdb9tk997bD2lBM6JHgrGM9ixY2g7U2 ZSww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=CJDc7oyg; 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 hq28-20020a1709073f1c00b0078d23ac6981si1384722ejc.790.2022.11.17.11.15.49; Thu, 17 Nov 2022 11:16:16 -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=CJDc7oyg; 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 S240685AbiKQTPT (ORCPT + 99 others); Thu, 17 Nov 2022 14:15:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240490AbiKQTPL (ORCPT ); Thu, 17 Nov 2022 14:15:11 -0500 Received: from mail-4318.protonmail.ch (mail-4318.protonmail.ch [185.70.43.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 19EFD85176; Thu, 17 Nov 2022 11:15:11 -0800 (PST) Date: Thu, 17 Nov 2022 19:15:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668712509; x=1668971709; 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=CJDc7oygEkDlrA6vQ80GDRkx64s9ExmX1IZv8s+RnCEmjjShUFqdmdTdDa7+jbIDu /s/i3QGL1W6J2Xn4nhiFfoaUtc9wxQeDK4n8AaNq81VdwXOWpMS+LodnwK44B3AxYh JrqpQFvBSJUkeaH15guRUYomvuCJN6eJK2b+xyiCWN/2MWxhCG87QAbw4Udi8pBXP8 YZE3QzyEOxCdGTsVWu9aSgQBLDwKoTwkFvM4qNenfj2A7MV2dZU9P8lf1iBfCf2SUK Nu70d1yIx1W44SLQ3rZ1LQB0BEmNbAKt9giilwBQC+buWnTtNz1o1J1sIkYEUNDBSm rUmU7IHwGxp3Q== 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: [RESNED PATCH 1/3] dt-bindings: input/touchscreen: Add compatible for IST3038 and IST30XXB Message-ID: <20221117191436.87938-2-linmengbo0689@protonmail.com> In-Reply-To: <20221117191436.87938-1-linmengbo0689@protonmail.com> References: <20221117191436.87938-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?1749771958330896381?= X-GMAIL-MSGID: =?utf-8?q?1749771958330896381?= 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 19:15:15 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: 21883 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp578779wrr; Thu, 17 Nov 2022 11:17:28 -0800 (PST) X-Google-Smtp-Source: AA0mqf6nwT+ulbPQuSgLja/pum4kZCuYiKx5PNKD9Vxdnd/a3OEg66P+HyKcNdr1ZC6yiX7ToEIg X-Received: by 2002:a17:906:28d1:b0:78d:bc56:8f22 with SMTP id p17-20020a17090628d100b0078dbc568f22mr3144072ejd.256.1668712648369; Thu, 17 Nov 2022 11:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668712648; cv=none; d=google.com; s=arc-20160816; b=owNNUNqfzAj5VB21dPllVdoBzPUK5Hz3WcpLDOlZvTh8y9T8pwe+eSzNKBARljCK90 Atvlp9baERis4OmrPCfJJQdMmnGGcdZK9NCCH+zH0zEBAexdX23F5U/Q0h9kDnbFkcif S1hrzu13DizigsyR/tEQOxBLLrlhTokYIM+36Z1NWxQdsu819xXoASjVC6tJQ4lLN7Df yBVIU7Vv0XZaKhM6mO1RaAZCqZZXdO1DznR7Fo3eSXHL4NKM/pSEk29tXqPX2s6Ks5hu /9RiweL9B+afF2zy6zWh3mLAzTpMpXY7zp4TpY8Iz3olBEPuyoExaTNzlp28wSMLsj+i 8H/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 :feedback-id:references:in-reply-to:message-id:subject:cc:from:to :dkim-signature:date; bh=T794GTPNQYc9tJalhy0LCsNElYleSnXWekOIp9tkVi0=; b=sFKkBFogkDSYrWCjESGFSt9NBUYv9ZLx3EbjWuGXzzYTTm93RXm+eAkawl+WtJloF7 QZ/6IHQ0Ln1YMnjUkY/YMeS8oPJ9zvjBCKbSTcc9tALb5p0X5aW8+YlKoWmBIHPTZ7VF pxY8kvsuVpF2db+8CUQgCDlCt+qtNtw6faugMnsEKScsZp3cbNxOgZBpHjKYvO6PmtxR 7zUVS4KaQxGBRrH3h3sMeDBQXYja9Ird0tf/4Q9gutfsD3DBTrrDNT3JHUGJFPHXOh/t o5qQ9KxRGuWbSDODZuyJAEZC21AghHhSS0x3yjZKStqpNg4wO4WW1hqxLrdj5qqrOhLW myeg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=IxQ1YJ5w; 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 cs12-20020a170906dc8c00b0078d805901b1si1295325ejc.489.2022.11.17.11.17.01; Thu, 17 Nov 2022 11:17: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=IxQ1YJ5w; 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 S240763AbiKQTPs (ORCPT + 99 others); Thu, 17 Nov 2022 14:15:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60426 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240771AbiKQTPh (ORCPT ); Thu, 17 Nov 2022 14:15:37 -0500 Received: from mail-4324.protonmail.ch (mail-4324.protonmail.ch [185.70.43.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8F2128A145; Thu, 17 Nov 2022 11:15:29 -0800 (PST) Date: Thu, 17 Nov 2022 19:15:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668712527; x=1668971727; 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=IxQ1YJ5wAd8KJ78vIc00OjS2Xh+FtGl1k4Q9GwmnOJxz0WfgISGUPwUWAdSGyzGnt NUcrvqSyd35VvL+y4Wnz7ayE5k4QlG/3e+76AqoxGn0B0Y5PbqzMGX2gXewS5JYgfj 0aa8aQxxt5Uppe55fGBCCbtu0u3BcfKFgNujnFt6RiGycUC8mQrsEeRZmzEzj9K4+Z GcRNl2mN1x42ANtAW3+ELkT07Q2EVv3GsSdUfZKoaNwiAwxbnJRhqPiYb/DvdktISe kIE6FZUyxf2ted3bcb9NKNF+aZhyGbZOCHzT79kulsoc0emFvNa8uaXIWruwK+9HY9 XGVg0+NRV+UFA== 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: [RESNED PATCH 2/3] input/touchscreen: imagis: Correct the maximum touch area value Message-ID: <20221117191436.87938-3-linmengbo0689@protonmail.com> In-Reply-To: <20221117191436.87938-1-linmengbo0689@protonmail.com> References: <20221117191436.87938-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?1749772034101208519?= X-GMAIL-MSGID: =?utf-8?q?1749772034101208519?= 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 19:15:26 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: 21884 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp578872wrr; Thu, 17 Nov 2022 11:17:44 -0800 (PST) X-Google-Smtp-Source: AA0mqf4MjYtrSQ5zdGB/mR+QNyLpd7zyz9hbEMF14ZG9sblZQ24JxED0bWFpiqjEIc4dZTaWsS3u X-Received: by 2002:aa7:ccc9:0:b0:462:30e4:fcf5 with SMTP id y9-20020aa7ccc9000000b0046230e4fcf5mr3402275edt.115.1668712663949; Thu, 17 Nov 2022 11:17:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668712663; cv=none; d=google.com; s=arc-20160816; b=lSJq67Rq4Jd9bKGCbhCv2Rz/cG3FMIBMDygMvk+5MzfquMrXBka5cz+n9OwslvBlIs en3HFdKyXIYj6ihkFgt1YH7fACGqcH/CXlTKX1ILXDo9H+Jc2fpnCFMSJtTdI2aCXMul ijD14YnKBftxuo2d9E82rrB3W9U/XL1OHkm5KVO2Mv9asbdayK02CiRnBltJQBgdkDZn /Vy+SHWNap5N2n2SMcwYwZG4iueqog7HJiv8FBQv9K8fAxb0FrsmnK8ZdRmJAEd2SbA2 cD68CdSllLzhceqEHv5+8VKT9n6ERtRlutZvQpXhAEEveV/fsWzSOe8Ydd3LezdRNwvC Q88g== 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=PSvyEcfzSxMMhJqJ38FJewxHAPDsRa9lPw3CRDxi4GrD8Wpm1hoM3lhfX+kQ9kpk8Z 47Td3sLUs1TcWRPTthWOoPDWpsFtPLHTKiW/aLmDbISZPE0qh+koycZO7nxRvFaNsB7l QO3dWUzAJRZWQw5D/oOSOuVtjBl+SikbB6uyMG4hjw04Sl5UobNfu+vO430G3zPXnJTF t6LGcPZVG13XKviUQ2E9ZrylKrvXn7/v97AAh2QuxfV5f+fHTKIr2s8zO1dMbLwzZ475 CsL8+Z9GUoD4btb2K1sVFEmWqIpuaotESbqJ3IGcZHm10AM8XDn6F/uO6eLiypMwQ3UY C8oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=x6V6dO5Z; 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 h6-20020a05640250c600b0045c3592301dsi1700472edb.191.2022.11.17.11.17.17; Thu, 17 Nov 2022 11:17:43 -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=x6V6dO5Z; 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 S240806AbiKQTQK (ORCPT + 99 others); Thu, 17 Nov 2022 14:16:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240804AbiKQTPy (ORCPT ); Thu, 17 Nov 2022 14:15:54 -0500 Received: from mail-4325.protonmail.ch (mail-4325.protonmail.ch [185.70.43.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCAAA8515B; Thu, 17 Nov 2022 11:15:38 -0800 (PST) Date: Thu, 17 Nov 2022 19:15:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1668712537; x=1668971737; 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=x6V6dO5ZKyQP3wPvlBJkZ0hWa/7mXzg+fgUSsArbKZxQZ8FW+kYj8Bi2aLoJpBCDA zvyEqRAzldCdCRHP23nDQ5r4UdQjSNELYk3YnL90lviCMKWkNThCjJmbgsTzQa4wVE +EAUdgKwUhca3Z0lGcAF0SAi1mvbBer8Xk09u9IJ/j/Ah+AXe0117mzvARvehVHWPh BAfvxZNxKqoafwCgdYw5wzHT8tLHIZAmYnnV85mJzFbuRXRYiQ7Drv6GONPNS4tzLj 9DBwb/jIPZN+Z1JYVkV0yyI64jBekVN+UJOwkiShsodql+gy3bvhM3wFC/FDqNsoJE 0z8IyGk1EYSlg== 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: [RESNED PATCH 3/3] input/touchscreen: imagis: Add supports for Imagis IST3038 and IST30XXB Message-ID: <20221117191436.87938-4-linmengbo0689@protonmail.com> In-Reply-To: <20221117191436.87938-1-linmengbo0689@protonmail.com> References: <20221117191436.87938-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?1749772050318980675?= X-GMAIL-MSGID: =?utf-8?q?1749772050318980675?= 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);