Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp187394lqp; Tue, 11 Jun 2024 20:24:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkICx4q25VyuonFequtoObpgnJx5dAWi9Sw2Bh8sEexf08Ygqxj0B9o3+761x6f7aD5cf1ni8h4TjhRVbCUFxwgk8dzTCMaMbg9ka+vQ== X-Google-Smtp-Source: AGHT+IEyHIyo+glIBIinp5GzV+ExI8KZ4pvRDEKkar5iMNkJzd7ypqPePu1EB6sQ5GXXGqEw3EF1 X-Received: by 2002:a05:6808:2211:b0:3d2:1ddf:862c with SMTP id 5614622812f47-3d23e01b455mr626816b6e.2.1718162679641; Tue, 11 Jun 2024 20:24:39 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718162679; cv=pass; d=google.com; s=arc-20160816; b=IwSk8hOMy2FtZuMS0V5v4WEQdzAZfW/u/KviKc96sdm8R/ud9h7AZQ13Gukuxts4zN jF9bcW0mwA1GvWVzGcY+F0h5O+bcRiWB+QwWf7KLA3DKcBXndd3JlxvtbiQK2jB74sNb l/CT/uaFPT6l9cI1Gbj0Pr/LFp0mrWd1bJwTGm4z5NyGCDRj2UvD2BjrjZtI0tgUELwa a2F6L89HWP+Y/k4nJV1FYlQhVjA4c5HniIs6pOyVK+CU8QyigTbAZzZiOlfNP20A8jYD 7Cp2R4WAMm30oAe2TZgQSGHUdoU8xVnFF+m+z/8frbteW7T6Twwe4wjjOe8b0pcHj3Lw KX4w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=AL1kabKZ9aiMqgGz1LRsyrTMRHsm/iVj6Z4f0MCoRMM=; fh=vbaZ37OneDKmGgFkyZcXNDAABBQjl6F5iHgrhTgZ25U=; b=L3qlSUJc0yM+8XNbPhYe69Ics1hnBUmTtPUjLmynsU201CxmwtjGqleMeyU+pWUpZT KbhaLYacvlsRDSMjdVjkiuSclmxU65cM9t+lvZww6pTtCx5qu4OoGa++CWk1Ahr4YMx5 rd79jy+xvcrKLwvmroZkeK2XRZao7zx7dSJraUlVoyeky5N6TkqHVOawnOhBi244Xcmu kXYlTfCcNp1+ag/32Ddz0GrHwDyFe/GgZFmoooYwG+y9g3LyuKABh+hIkr/LIuaj56Ri m2ojBUAQNFsXHX+rt5UWhjGApL7g1DctntmAa6avm4Lnbw88EsaKCZJNbcMlFS07mLRZ E4Jg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=t9ES+U2C; arc=pass (i=1 spf=pass spfdomain=protonmail.com dkim=pass dkdomain=protonmail.com dmarc=pass fromdomain=protonmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d2e1a72fcca58-70423c8ea87si7038277b3a.176.2024.06.11.20.24.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 20:24:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@protonmail.com header.s=protonmail3 header.b=t9ES+U2C; arc=pass (i=1 spf=pass spfdomain=protonmail.com dkim=pass dkdomain=protonmail.com dmarc=pass fromdomain=protonmail.com); spf=pass (google.com: domain of linux-kernel+bounces-210856-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210856-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=protonmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 061BFB22C0A for ; Wed, 12 Jun 2024 03:21:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 70ECD1F92F; Wed, 12 Jun 2024 03:21:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b="t9ES+U2C" Received: from mail-0301.mail-europe.com (mail-0301.mail-europe.com [188.165.51.139]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 260EC182AF for ; Wed, 12 Jun 2024 03:21:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=188.165.51.139 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718162488; cv=none; b=WeUKWo9LW7sACvapJbhT7TSbjLNESjiOJHqkIYCbI4XDdFG5Q24hYK1IV23P6Up2xMfwqYBsR3YU6irAQXuG84XhII+0WvCmRgMEM5CFkmZCZGNMON5aTIMEnLhdrodiekJs2+0EO5bdixTSTICq0aM5cpml3QtGGv0pwYvnyk8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718162488; c=relaxed/simple; bh=AL1kabKZ9aiMqgGz1LRsyrTMRHsm/iVj6Z4f0MCoRMM=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=cF+b8bRvU/4BMx6pxI7sqRtxkQpZjTha6eiMJiZTMvRUab0VEeHzzulQoC7KLcgk5nCRHSpkXpktdlKsNLVbL+3xMO4Gu+i6kG4mO8Sd/nm4HvaVZoBGaTgwi3k0WQW+AT8X6YaV1sx3QMS6pCBGW7HoGmLsBycZPEPJGcred0A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com; spf=pass smtp.mailfrom=protonmail.com; dkim=pass (2048-bit key) header.d=protonmail.com header.i=@protonmail.com header.b=t9ES+U2C; arc=none smtp.client-ip=188.165.51.139 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=protonmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=protonmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1718162477; x=1718421677; bh=AL1kabKZ9aiMqgGz1LRsyrTMRHsm/iVj6Z4f0MCoRMM=; 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=t9ES+U2CFM2N7R68Kk+DbbPfL20hFS7hPGgN1I0qit3FUOOgxtbrgRFRspefpNRZl bk7xhcp+OHFsnx/XSi5N9VwT6jX8ug0uOZa6Ec0+IPkfoUljmk0akE8bFvMdVIOF52 Q5n8F4JUux/jj4jncJYLzFRaE4AJ5B8ckEoBo5E8lVxq/VJhf3z/fNRDuMCsjSvx7B 6Yr3dXPbabVCfAvBqC3rnnTCAtx12eBEidWzDifythG/hHGcIMSaJMY6xNMKviS4yq lrOgiP1I3JcuxX5UVz+C8ubq2Nr+jY3WYSRdvhjp4Iy5hj0YVEitSA5Nsowu02gJUV SKODAQztrwUJg== Date: Wed, 12 Jun 2024 03:21:14 +0000 To: linux-kernel@vger.kernel.org From: Raymond Hackley Cc: Markuss Broks , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stephan Gerhold , Nikita Travkin , linux-input@vger.kernel.org, devicetree@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht Subject: [PATCH 2/3] input/touchscreen: imagis: Add supports for Imagis IST3038 Message-ID: <20240612032036.33103-3-raymondhackley@protonmail.com> In-Reply-To: <20240612032036.33103-1-raymondhackley@protonmail.com> References: <20240612032036.33103-1-raymondhackley@protonmail.com> Feedback-ID: 49437091:user:proton X-Pm-Message-ID: bf48fd04ac644e695a965ccf5ee76145560c19f7 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Imagis IST3038 is another variant of Imagis IST3038 IC, which has a different register interface from IST3038C (possibly firmware defined). Unlike IST3038C/IST3032C, IST3038 has different registers for commands, which means IST3038 doesn't use protocol B. Similar to IST3032C and maybe the other variants, IST3038 has touch keys support, which provides KEY_APPSELECT and KEY_BACK. Add support for IST3038 with touch keys. Signed-off-by: Raymond Hackley --- drivers/input/touchscreen/imagis.c | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen= /imagis.c index 886bcfc8497a..b2f4bc60721d 100644 --- a/drivers/input/touchscreen/imagis.c +++ b/drivers/input/touchscreen/imagis.c @@ -12,9 +12,16 @@ #include #include =20 +#define IST30XX_REG_STATUS=09=090x20 +#define IST30XX_REG_CHIPID=09=09(0x40000000 | IST3038C_DIRECT_ACCESS) +#define IST30XX_WHOAMI=09=09=090x30003000 +#define IST30XXA_WHOAMI=09=09=090x300a300a +#define IST30XXB_WHOAMI=09=09=090x300b300b +#define IST3038_WHOAMI=09=09=090x30383038 + #define IST3032C_WHOAMI=09=09=090x32c +#define IST3038C_WHOAMI=09=09=090x38c =20 -#define IST3038B_REG_STATUS=09=090x20 #define IST3038B_REG_CHIPID=09=090x30 #define IST3038B_WHOAMI=09=09=090x30380b =20 @@ -25,7 +32,6 @@ #define IST3038C_REG_TOUCH_STATUS=09(IST3038C_REG_HIB_BASE | IST3038C_HIB_= ACCESS) #define IST3038C_REG_TOUCH_COORD=09(IST3038C_REG_HIB_BASE | IST3038C_HIB_A= CCESS | 0x8) #define IST3038C_REG_INTR_MESSAGE=09(IST3038C_REG_HIB_BASE | IST3038C_HIB_= ACCESS | 0x4) -#define IST3038C_WHOAMI=09=09=090x38c #define IST3038C_CHIP_ON_DELAY_MS=0960 #define IST3038C_I2C_RETRY_COUNT=093 #define IST3038C_MAX_FINGER_NUM=09=0910 @@ -397,9 +403,17 @@ static const struct imagis_properties imagis_3032c_dat= a =3D { =09.protocol_b =3D true, }; =20 +static const struct imagis_properties imagis_3038_data =3D { +=09.interrupt_msg_cmd =3D IST30XX_REG_STATUS, +=09.touch_coord_cmd =3D IST30XX_REG_STATUS, +=09.whoami_cmd =3D IST30XX_REG_CHIPID, +=09.whoami_val =3D IST3038_WHOAMI, +=09.touch_keys_supported =3D true, +}; + static const struct imagis_properties imagis_3038b_data =3D { -=09.interrupt_msg_cmd =3D IST3038B_REG_STATUS, -=09.touch_coord_cmd =3D IST3038B_REG_STATUS, +=09.interrupt_msg_cmd =3D IST30XX_REG_STATUS, +=09.touch_coord_cmd =3D IST30XX_REG_STATUS, =09.whoami_cmd =3D IST3038B_REG_CHIPID, =09.whoami_val =3D IST3038B_WHOAMI, }; @@ -415,6 +429,7 @@ static const struct imagis_properties imagis_3038c_data= =3D { #ifdef CONFIG_OF static const struct of_device_id imagis_of_match[] =3D { =09{ .compatible =3D "imagis,ist3032c", .data =3D &imagis_3032c_data }, +=09{ .compatible =3D "imagis,ist3038", .data =3D &imagis_3038_data }, =09{ .compatible =3D "imagis,ist3038b", .data =3D &imagis_3038b_data }, =09{ .compatible =3D "imagis,ist3038c", .data =3D &imagis_3038c_data }, =09{ }, --=20 2.39.2