From patchwork Mon Feb 19 10:12:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel Bouhara X-Patchwork-Id: 202994 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1188783dyc; Mon, 19 Feb 2024 02:13:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU1K4OoyF63ECkj1+dcw4sBDmot6/inbij4esXCTFW56UZbk/9TkSlwVbdcHF151vtFg89dts2SisFE3b/iK0YAmaXjGA== X-Google-Smtp-Source: AGHT+IEvH7txwKF51VO7c2HTcJjDTCNDVpORYraPaIxo8boXQ/nAdn7RwqgcTu+n12RHN5VPQ9wY X-Received: by 2002:a17:906:e89:b0:a3d:d290:8de with SMTP id p9-20020a1709060e8900b00a3dd29008demr8044238ejf.24.1708337589637; Mon, 19 Feb 2024 02:13:09 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708337589; cv=pass; d=google.com; s=arc-20160816; b=p41mOf5TCDJ0T6rEjP7kbJ5dC3g6DUB60Z6cm4OwVyDash6riAIcxtoik84vJ4+WOg qvgkE0SVB51aMgu74qMKSOxTlSHH38dOn+LVZN4/rY13VRF/5kCEpCDGztQ/1ze+KQLu HVDHYB1NN2boywPaU0iMBx5886ihEjLqrrGykVodrpEYniTn7f7eqUtMrgMRdaopV0tt Utl1imtSxJhk0h1hfw7qazECb/Bm1wRYlqPgeoBaVuEbBO7izVn4EqI+EDqo8pKX4ACq i+rG91+AcMfQGP6h4etajfZpe6sKw7dhwyf8eE9m3KcL+3fE7um4JvfVkcpGEbWjzKl4 qvbA== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=nHQnvcxka58vLFRQuoR+CefX5o1t0IMycj8fHga9rPc=; fh=XTYTgZQaHIRsh0IgP7zFrsdEf5IQvYSVIZasPoTxvCY=; b=gqju86ZpwmX2oZKUoE+igsB43w+ycHlPiOgrvM2UEmJMkP3YQCzNj4yArZBvz5RMCN qqJ3UUugFbCWcdruzleBmWnaakQvUc++e4wKQLI4Qx5XjGi/jwnKo+sP4huCvhJna/AN YvOjLkByCdkM7p0EuBYgO5etv1x6yMJjuAx8uzcOzTrOkmzp/JWD/FVS5whPvMPflDvC qHf58PA82B+9VyCKlLOHBOkJtBMFcHAiMkCi9Lj1BIYZhQ5DasAbBVaHMGZz6FOIBmV9 RC0JAl9FB3WyAkG0gdY+P67vvhLv2YEt2AezbTMijRogvJKdRa3/TqlKxN1jbGr0W+5x 3pUw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ifcdmTIU; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-71103-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71103-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id p24-20020a1709061b5800b00a3e7ad1cdb3si1054152ejg.576.2024.02.19.02.13.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 02:13:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71103-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=ifcdmTIU; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-71103-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71103-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 4090B1F21466 for ; Mon, 19 Feb 2024 10:13:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E5D9628E09; Mon, 19 Feb 2024 10:12:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="ifcdmTIU" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 675452869B; Mon, 19 Feb 2024 10:12:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337555; cv=none; b=VjqzW/nSrDPF1LRM7vLnPBQp+s2eNcTPXxAAQfxpjWCAIrlJzb4Z7IoiNo9ejbmB5RuNeBI+joLgHQLJaDnORFKCpyFH4DlgiqhX2KQiyC8htoIdvLF1b9USABQ1T8dba83ChWx5PV292UkckgA06YL4T70z/stwh42q0qkMLUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337555; c=relaxed/simple; bh=XJlaEvpRz0/GsusTqoSGEBO6ELpXHI3ywLHM6TDhnuo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JWK+no+B+Hjz3AA6m+I5cy3RSY8v/2kDtYNDivgF1Hi9E+1pJmEnvMo8I2yglNZLoBTPv2fb4kU2AWgVS0EFXKaIeO6e2jPLvSjcKXKrLZT7fKjPqSWbJ7aV+iaGYjp13nJ1z0hNhg9rL4yHEUgfGiFmoA68RopvleTcqPwheQw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=ifcdmTIU; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 568F61BF210; Mon, 19 Feb 2024 10:12:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708337545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nHQnvcxka58vLFRQuoR+CefX5o1t0IMycj8fHga9rPc=; b=ifcdmTIU0g5zi4T9VG65NAAMgDOBHcniLGxQVH5pkcBsLOiHuoMAzo0DA3hDI719azVFv5 NBksuEVqEkqy5vkzaWlsK5hL2Ziha070I2nr5th1TLsxbPB402jEs5++vHiXqIACBs22v/ z6qB6LbLCUSeRKXF+Tnetyrh51tES0IaMng6XZLGdJWrCkXW9ey47rXRkgIp3FVR7NXC5K oQkM4zm7ULe3wnz8xzGIUbNuE2qsjsU9kCnqi6/Zg/SGRNztWh9DtO9RGNkCq0n9ZMKl51 78wnQXRTb7Fwl9jI6FUvstriScdqnc1/DW32UwYD5bWPEj+5cjdPD/AuPXks4w== From: Kamel Bouhara To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Marco Felsch , Jeff LaBundy Cc: catalin.popescu@leica-geosystems.com, mark.satterthwaite@touchnetix.com, Thomas Petazzoni , Gregory Clement , bsp-development.geo@leica-geosystems.com, Kamel Bouhara , Krzysztof Kozlowski Subject: [PATCH v8 1/3] dt-bindings: vendor-prefixes: Add TouchNetix AS Date: Mon, 19 Feb 2024 11:12:18 +0100 Message-ID: <20240219101221.129750-2-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240219101221.129750-1-kamel.bouhara@bootlin.com> References: <20240219101221.129750-1-kamel.bouhara@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: kamel.bouhara@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791321796057614772 X-GMAIL-MSGID: 1791321796057614772 Add vendor prefix for TouchNetix AS (https://www.touchnetix.com/products/). Signed-off-by: Kamel Bouhara Acked-by: Krzysztof Kozlowski --- Documentation/devicetree/bindings/vendor-prefixes.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/vendor-prefixes.yaml b/Documentation/devicetree/bindings/vendor-prefixes.yaml index 1a0dc04f1db4..88954a286107 100644 --- a/Documentation/devicetree/bindings/vendor-prefixes.yaml +++ b/Documentation/devicetree/bindings/vendor-prefixes.yaml @@ -1444,6 +1444,8 @@ patternProperties: description: Toradex AG "^toshiba,.*": description: Toshiba Corporation + "^touchnetix,.*": + description: TouchNetix AS "^toumaz,.*": description: Toumaz "^tpk,.*": From patchwork Mon Feb 19 10:12:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel Bouhara X-Patchwork-Id: 202995 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1188873dyc; Mon, 19 Feb 2024 02:13:20 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV5IyqjiZqd35KD9HO8eBFH1PK4SoydjVMSsQqzWS14MrOGghhikss440r4rHt4RSjbl8o38ldJroyXYAbMxAhe7BgiLA== X-Google-Smtp-Source: AGHT+IE2dxg4zjobDGiMNWMtZaoQuQB6f1+4hVWRW+lLCp5mmk+TDofxLZ7Z5AQaLXvUteBWg5M3 X-Received: by 2002:a05:622a:1653:b0:42d:a920:e046 with SMTP id y19-20020a05622a165300b0042da920e046mr15480356qtj.52.1708337600379; Mon, 19 Feb 2024 02:13:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708337600; cv=pass; d=google.com; s=arc-20160816; b=aEf8eLNhDJIldADBV6HIEdLqtlGO230v7S85YA6VTLx1/t7aiEZNsCkASKE08HFFwC cFwljgc3s0/Ad6sVYcPIyiCr3cGbglAB/ZrJd37vQtTk39EiXZYIEnnM9oHPqTo2r7q3 C4GJWz1sFWsHSAgHgviaWr5q05uKMfdBMgKkFMW2k+ydVD0dxd64wXN2InCd3ydLs2jV TN091gPA+f4l9LnscvMjEvY2dJBi4pJHDDm7P+/I3vgse+NNXcXoLV5OO2WfQzBIEGMc oHk4bb/KAXqtg6+4KlfgSKJJnEkAKh8gNWo5qOsjIa2oFktS9Wo2KIJDgDBbCPNs9fHY 0zWQ== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=CDmnqReFpMYRHKn4zXOLlP/VQyZkOX4IKcdcgZtFJfo=; fh=XTYTgZQaHIRsh0IgP7zFrsdEf5IQvYSVIZasPoTxvCY=; b=QlOaXo6XME3hmoQh3Tqn+yYJAGlpjc+c1eA0RDJF4vzaKJyZAcAJrWnt7uWnEVsfKR nptOms/yrXEWB782hZqsYhA8K0qmqYj6ZjltQhRf5eI2iCvfGvYr7PO7e6vigfNfyE/c cpOU4YuttmiYjWiJQTDwR6JL2JSG/gxB3zhkwOZOsYxrMft5xc3CkNipiPChEtTeV6Bt JMuHy6q4fn+6oHsi7FXGxlqOOVEDXCbU9YxB1LHaxMiZ7P/DdnrGzdyM/g6P+if3Vc+z kg/K4wFZuP3KOzG0Avjf+YdBr9WefxHIJ1E9+gOb2+ubrif80xGHM1IEEy8NujDI9WIS sAUA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=erXZxW4j; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-71104-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71104-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id o21-20020a05622a009500b0042c07746d94si3040703qtw.676.2024.02.19.02.13.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 02:13:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71104-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=erXZxW4j; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-71104-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71104-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 1431C1C20F77 for ; Mon, 19 Feb 2024 10:13:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 458222C19D; Mon, 19 Feb 2024 10:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="erXZxW4j" Received: from relay2-d.mail.gandi.net (relay2-d.mail.gandi.net [217.70.183.194]) (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 ADC38286AC; Mon, 19 Feb 2024 10:12:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.194 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337556; cv=none; b=fVJ56Vo4oaLFrMKexEsb+0KD83lBTFmtL50cHnjSp3BsKtLP6punG7JVgYvbN7sSWjT5VMVCgoSNJGjtzmwlBaHAiViEyqrna7pNmcY1IVy0SArc0kU5a0cXJzGsxd2k5rVzG/Iw9JQ/zdrLizMvrTWiKFRx9ALaQCp5t0Zdh6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337556; c=relaxed/simple; bh=aV/ggkcDv9hp3EetTzkokGR0XIwelaf7CP2afkUlvhw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RR/znRL/MBTkbxrR0c2srTs0dQbosZZLtEd/pmdEyfBT35KKRekJZkA8wBKmSCiFxAHTU8x3M4IfVAEZVFtUzY2JRi3a4a3U8Ev52E6siru+r8j2QQd7wHBX59bij1/vahrUF8WEUZgBpvfatrQaLcMkFyDp1gechOjx7PAshXk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=erXZxW4j; arc=none smtp.client-ip=217.70.183.194 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 7D90840008; Mon, 19 Feb 2024 10:12:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708337546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=CDmnqReFpMYRHKn4zXOLlP/VQyZkOX4IKcdcgZtFJfo=; b=erXZxW4jpfuOAUDJ1B61ZTNvy4Auw1PleMf2ZJ3kM3xHTXY3ruFQXgLyP3opPp0UYpCN3A kVkT5C2+OpZAie82BzGt7MMPzmVq3MogocA1AycSytMDo8fFYykWtl2mzm4L5TM9BW4HSO E8BRYZsrkmH7JcIwvGQ7JsvXCMsxc0uEd+zRMrjCC2hzTLAQ0IOSBBm1jYAPqzUdhXqIeX 7JG8AqV8XyvAvZ0FEMQzG+/NPDvTSXZKlb62u1IXzFRwTVpLNEtu12+GreashD0iop/nz/ sQd43DRBUmv35kRMOJUudpIhNOc3VvrqdM1K9BraTyX3WHZje4DjA4/ScWAo/Q== From: Kamel Bouhara To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Marco Felsch , Jeff LaBundy Cc: catalin.popescu@leica-geosystems.com, mark.satterthwaite@touchnetix.com, Thomas Petazzoni , Gregory Clement , bsp-development.geo@leica-geosystems.com, Kamel Bouhara , Krzysztof Kozlowski Subject: [PATCH v8 2/3] dt-bindings: input: Add TouchNetix axiom touchscreen Date: Mon, 19 Feb 2024 11:12:19 +0100 Message-ID: <20240219101221.129750-3-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240219101221.129750-1-kamel.bouhara@bootlin.com> References: <20240219101221.129750-1-kamel.bouhara@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: kamel.bouhara@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791321807519926580 X-GMAIL-MSGID: 1791321807519926580 Add the TouchNetix axiom I2C touchscreen device tree bindings documentation. Signed-off-by: Kamel Bouhara Reviewed-by: Krzysztof Kozlowski --- .../input/touchscreen/touchnetix,ax54a.yaml | 62 +++++++++++++++++++ MAINTAINERS | 6 ++ 2 files changed, 68 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchnetix,ax54a.yaml -- 2.25.1 diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchnetix,ax54a.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchnetix,ax54a.yaml new file mode 100644 index 000000000000..66229a4d6f15 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/touchnetix,ax54a.yaml @@ -0,0 +1,62 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/touchnetix,ax54a.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: TouchNetix Axiom series touchscreen controller + +maintainers: + - Kamel Bouhara + +allOf: + - $ref: /schemas/input/touchscreen/touchscreen.yaml# + - $ref: /schemas/input/input.yaml# + +properties: + compatible: + const: touchnetix,ax54a + + reg: + const: 0x66 + + interrupts: + maxItems: 1 + + reset-gpios: + maxItems: 1 + + vdda-supply: + description: Analog power supply regulator on VDDA pin + + vddi-supply: + description: I/O power supply regulator on VDDI pin + +required: + - compatible + - reg + - vdda-supply + - vddi-supply + +unevaluatedProperties: false + +examples: + - | + #include + #include + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@66 { + compatible = "touchnetix,ax54a"; + reg = <0x66>; + interrupt-parent = <&gpio2>; + interrupts = <2 IRQ_TYPE_EDGE_FALLING>; + reset-gpios = <&gpio1 1 GPIO_ACTIVE_HIGH>; + vdda-supply = <&vdda_reg>; + vddi-supply = <&vddi_reg>; + poll-interval = <20>; + }; + }; +... diff --git a/MAINTAINERS b/MAINTAINERS index c4828ab15f1a..4b3ed2f22b89 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22257,6 +22257,12 @@ L: platform-driver-x86@vger.kernel.org S: Maintained F: drivers/platform/x86/toshiba-wmi.c +TOUCHNETIX AXIOM I2C TOUCHSCREEN DRIVER +M: Kamel Bouhara +L: linux-input@vger.kernel.org +S: Maintained +F: Documentation/devicetree/bindings/input/touchscreen/touchnetix,ax54a.yaml + TPM DEVICE DRIVER M: Peter Huewe M: Jarkko Sakkinen From patchwork Mon Feb 19 10:12:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kamel Bouhara X-Patchwork-Id: 202996 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp1189127dyc; Mon, 19 Feb 2024 02:13:57 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWLtiv27jjG5SDbP/v8TlGWEwlXeT9EYY3wTCcyVL6Q1SikrzGyjknYUObAyBFmX2TRWNAk7LbxQFDliUVWGMlfxBvUUA== X-Google-Smtp-Source: AGHT+IFvidLVDYEMqkcVc2VTnTUjnG4yYbJ/cJEKg/LXUXfdB91l+AYuNkagc0o1erJJ1ffsxEKB X-Received: by 2002:a17:90a:c90a:b0:299:70f9:642a with SMTP id v10-20020a17090ac90a00b0029970f9642amr1997940pjt.25.1708337637050; Mon, 19 Feb 2024 02:13:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708337637; cv=pass; d=google.com; s=arc-20160816; b=HSu5XVOzA++DVsK0bdk5DDZ2Qiz00oc3L5JpK6Gpob8KX+crb9LB2DHe85rwUD5Cc5 49UqXfDfNy5SH31ORtIH2P2zAV1TQdtkDTVhawYP8f7EgDYix0LmiYVOHCfoEOp80fss lgoi/Gq0Ns4kGRjVicogKAV4ZPeGltim9AIm+aXCfeaFLYt7R/sQVzoEpperaz7D2qhm 3DzjgTqPpcpSbkEYeyXjs/qbF8olFWLVdoIVWXIR/cqk+bE+VJy+tbPrpTYtyzN+UU8x l/EG974FoskQVsPUmdz6gD2cdtRX+pTTSAWgDB4lJqOIr3H5vpiss9vYtgru9iNEjh5c kmdg== 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=V9boAeDtRKnTLywwP9Uybu0H+Sf3meNGDcWyQHnxW/A=; fh=l/elLLo7M1nSwGYZiEbAnwj82rcXZ4kfeXoVXVQQoPk=; b=EU3ijCpPHv8sTSANAQAH3FxYDYfN1viuVApy7Yf+QGGfOF5JXXRBs6oOKJxocAEdAK j/FDLS5UeOZuBddN/kMkag9ISQAIny5NhJpWF+ynEphzvYEu/6fYYNonU4cvHSQ9rdix +X3z/oApOt4CXFNfhvwBL29EHd7hTHiz5kWA71M4/WlnlUm1FeSOMY9pWGfRR9VqH579 LdvBRrSzasVN5DtFqbF+VZ8uCgoaJtpCd3qnCdVDkqVuiqU2e7oZwkhOXe/4erV+mmta nJiE9OxoIrJp43Pir+gH00SR9M8IYNqqdljlDufezTyTi9EUIiyKjzXYFckbJtzLA4I1 hL9A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TxkGSiW8; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-71105-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71105-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id pf12-20020a17090b1d8c00b00299521eddabsi4032040pjb.85.2024.02.19.02.13.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 02:13:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-71105-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=TxkGSiW8; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-71105-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-71105-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.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 CAD5CB21C7D for ; Mon, 19 Feb 2024 10:13:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6295D2C6B4; Mon, 19 Feb 2024 10:12:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="TxkGSiW8" Received: from relay8-d.mail.gandi.net (relay8-d.mail.gandi.net [217.70.183.201]) (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 AD3FF286AE; Mon, 19 Feb 2024 10:12:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337557; cv=none; b=ZoS3N6OnYHDtyatWAmdqXtetw0eHmm4wH7/5ZwRYhwFP1BKUZ7b6HqiOuvJuxjtPrjkEsK2gcuiWKkHD6vFOxD/BU6aiX+k4mr1lB52IKGe6bhmFb343YClVfbkW8Uhg9diXtr5zy/JrmDeO06hZEDT8iP4/ybETpMapZVsKeCo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708337557; c=relaxed/simple; bh=1QjAqxY5zef+WuTmcs2GSVjk80gVG5r47KEQTCkk59Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=D084kr8uyDjNZAvFNca+rfkTlLKd95pPDtHAIEK1RCy1w6fbry8wHO7z6zEX/OlFyjJCFlWWRUyGtAgoAMcafKlN8U0Sr7pSCRo6rIN/8N+9ErLA1BFgC9170qJXAeyDaqeWxxykEPwf0LbsPsUY/wJ6Me1fDXLf8v3gImHNqJ4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=TxkGSiW8; arc=none smtp.client-ip=217.70.183.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 619E61BF213; Mon, 19 Feb 2024 10:12:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1708337546; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=V9boAeDtRKnTLywwP9Uybu0H+Sf3meNGDcWyQHnxW/A=; b=TxkGSiW8OTydE//zYjoGaPxRbCOYACMGUBX00UZCm10ZAyBYCSSVE+opaJjQbMmo1fLI2I X8ivNpy7klTRoYSQ7SjtYXVed5zEaqLJdeJm6Dl5x9I8WZGveveFmJP5Yt6yZXVqmWi4jJ vKcRxQIDEpN8nbEgTapAu+VHUeSq1rPhLeKqNdnr/R2pWEJeKeoA0bCMtuh0RuJjIQNuz9 EdUhYOx6hEY2sjY92kppLvhW/xfwbwXb2SHMQq06b000WHfrSxWQutN3QUacwF6hM0M8AI p21g3ZI6JlUmYcqnrTkg4hAU7FuC4j7IWrpU1tNVqNpHgn4n/fMxjDTxKHGSOA== From: Kamel Bouhara To: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Henrik Rydberg , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Marco Felsch , Jeff LaBundy Cc: catalin.popescu@leica-geosystems.com, mark.satterthwaite@touchnetix.com, Thomas Petazzoni , Gregory Clement , bsp-development.geo@leica-geosystems.com, Kamel Bouhara Subject: [PATCH v8 3/3] Input: Add TouchNetix axiom i2c touchscreen driver Date: Mon, 19 Feb 2024 11:12:20 +0100 Message-ID: <20240219101221.129750-4-kamel.bouhara@bootlin.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240219101221.129750-1-kamel.bouhara@bootlin.com> References: <20240219101221.129750-1-kamel.bouhara@bootlin.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-GND-Sasl: kamel.bouhara@bootlin.com X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791321846222258143 X-GMAIL-MSGID: 1791321846222258143 Add a new driver for the TouchNetix's axiom family of touchscreen controllers. This driver only supports i2c and can be later adapted for SPI and USB support. Signed-off-by: Kamel Bouhara --- MAINTAINERS | 1 + drivers/input/touchscreen/Kconfig | 12 + drivers/input/touchscreen/Makefile | 1 + drivers/input/touchscreen/touchnetix_axiom.c | 669 +++++++++++++++++++ 4 files changed, 683 insertions(+) create mode 100644 drivers/input/touchscreen/touchnetix_axiom.c diff --git a/MAINTAINERS b/MAINTAINERS index 4b3ed2f22b89..de5fad8f317a 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -22262,6 +22262,7 @@ M: Kamel Bouhara L: linux-input@vger.kernel.org S: Maintained F: Documentation/devicetree/bindings/input/touchscreen/touchnetix,ax54a.yaml +F: drivers/input/touchscreen/touchnetix_axiom.c TPM DEVICE DRIVER M: Peter Huewe diff --git a/drivers/input/touchscreen/Kconfig b/drivers/input/touchscreen/Kconfig index e3e2324547b9..f36bee8d8696 100644 --- a/drivers/input/touchscreen/Kconfig +++ b/drivers/input/touchscreen/Kconfig @@ -803,6 +803,18 @@ config TOUCHSCREEN_MIGOR To compile this driver as a module, choose M here: the module will be called migor_ts. +config TOUCHSCREEN_TOUCHNETIX_AXIOM + tristate "TouchNetix AXIOM based touchscreen controllers" + depends on I2C + help + Say Y here if you have a axiom touchscreen connected to + your system. + + If unsure, say N. + + To compile this driver as a module, choose M here: the + module will be called axiom. + config TOUCHSCREEN_TOUCHRIGHT tristate "Touchright serial touchscreen" select SERIO diff --git a/drivers/input/touchscreen/Makefile b/drivers/input/touchscreen/Makefile index 62bd24f3ac8e..8e32a2df5e18 100644 --- a/drivers/input/touchscreen/Makefile +++ b/drivers/input/touchscreen/Makefile @@ -88,6 +88,7 @@ obj-$(CONFIG_TOUCHSCREEN_SUR40) += sur40.o obj-$(CONFIG_TOUCHSCREEN_SURFACE3_SPI) += surface3_spi.o obj-$(CONFIG_TOUCHSCREEN_TI_AM335X_TSC) += ti_am335x_tsc.o obj-$(CONFIG_TOUCHSCREEN_TOUCHIT213) += touchit213.o +obj-$(CONFIG_TOUCHSCREEN_TOUCHNETIX_AXIOM) += touchnetix_axiom.o obj-$(CONFIG_TOUCHSCREEN_TOUCHRIGHT) += touchright.o obj-$(CONFIG_TOUCHSCREEN_TOUCHWIN) += touchwin.o obj-$(CONFIG_TOUCHSCREEN_TS4800) += ts4800-ts.o diff --git a/drivers/input/touchscreen/touchnetix_axiom.c b/drivers/input/touchscreen/touchnetix_axiom.c new file mode 100644 index 000000000000..f7d1b23a4baf --- /dev/null +++ b/drivers/input/touchscreen/touchnetix_axiom.c @@ -0,0 +1,669 @@ +// SPDX-License-Identifier: GPL-2.0-only +/* + * TouchNetix axiom Touchscreen Driver + * + * Copyright (C) 2020-2023 TouchNetix Ltd. + * + * Author(s): Bart Prescott + * Pedro Torruella + * Mark Satterthwaite + * Hannah Rossiter + * Kamel Bouhara + * + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#define AXIOM_PROX_LEVEL -128 +#define AXIOM_DMA_OPS_DELAY_USEC 250 +#define AXIOM_STARTUP_TIME_MS 110 +/* + * Register group u31 has 2 pages for usage table entries. + */ +#define AXIOM_U31_MAX_USAGES 0xff +#define AXIOM_U31_BYTES_PER_USAGE 6 +#define AXIOM_U31_PAGE0_LENGTH 0x0C +#define AXIOM_U31_BOOTMODE_MASK BIT(7) +#define AXIOM_U31_DEVID_MASK GENMASK(14, 0) + +#define AXIOM_MAX_REPORT_LEN 0x7f + +#define AXIOM_CMD_HEADER_READ_MASK BIT(15) +#define AXIOM_U41_MAX_TARGETS 10 + +#define AXIOM_U46_AUX_CHANNELS 4 +#define AXIOM_U46_AUX_MASK GENMASK(11, 0) + +#define AXIOM_COMMS_MAX_USAGE_PAGES 3 +#define AXIOM_COMMS_PAGE_SIZE 256 +#define AXIOM_COMMS_REPORT_LEN_MASK GENMASK(6, 0) + +#define AXIOM_REPORT_USAGE_ID 0x34 +#define AXIOM_DEVINFO_USAGE_ID 0x31 +#define AXIOM_USAGE_2HB_REPORT_ID 0x01 +#define AXIOM_USAGE_2AUX_REPORT_ID 0x46 +#define AXIOM_USAGE_2DCTS_REPORT_ID 0x41 + +#define AXIOM_PAGE_OFFSET_MASK GENMASK(6, 0) + +struct axiom_devinfo { + __le16 device_id; + u8 fw_minor; + u8 fw_major; + u8 fw_info_extra; + u8 tcp_revision; + u8 bootloader_fw_minor; + u8 bootloader_fw_major; + __le16 jedec_id; + u8 num_usages; +} __packed; + +/* + * Describes parameters of a specific usage, essentially a single element of + * the "Usage Table" + */ +struct axiom_usage_entry { + u8 id; + u8 is_report; + u8 start_page; + u8 num_pages; +}; + +/* + * Represents state of a touch or target when detected prior to a touch (eg. + * hover or proximity events). + */ +enum axiom_target_state { + AXIOM_TARGET_STATE_NOT_PRESENT = 0, + AXIOM_TARGET_STATE_PROX = 1, + AXIOM_TARGET_STATE_HOVER = 2, + AXIOM_TARGET_STATE_TOUCHING = 3, +}; + +struct axiom_u41_target { + enum axiom_target_state state; + u16 x; + u16 y; + s8 z; + bool insert; + bool touch; +}; + +struct axiom_target_report { + u8 index; + u8 present; + u16 x; + u16 y; + s8 z; +}; + +struct axiom_cmd_header { + __le16 target_address; + __le16 length; +} __packed; + +struct axiom_data { + struct axiom_devinfo devinfo; + struct device *dev; + struct gpio_desc *reset_gpio; + struct i2c_client *client; + struct input_dev *input_dev; + u32 max_report_len; + u8 rx_buf[AXIOM_COMMS_MAX_USAGE_PAGES * AXIOM_COMMS_PAGE_SIZE]; + struct axiom_u41_target targets[AXIOM_U41_MAX_TARGETS]; + struct axiom_usage_entry usage_table[AXIOM_U31_MAX_USAGES]; + bool usage_table_populated; + struct regulator *vdda; + struct regulator *vddi; + struct regmap *regmap; + struct touchscreen_properties prop; +}; + +static const struct regmap_config axiom_i2c_regmap_config = { + .reg_bits = 32, + .reg_format_endian = REGMAP_ENDIAN_LITTLE, + .val_bits = 8, + .val_format_endian = REGMAP_ENDIAN_LITTLE, +}; + +/* + * axiom devices are typically configured to report touches at a rate + * of 100Hz (10ms) for systems that require polling for reports. + * When reports are polled, it will be expected to occasionally + * observe the overflow bit being set in the reports. + * This indicates that reports are not being read fast enough. + */ +#define POLL_INTERVAL_DEFAULT_MS 10 + +/* Translate usage/page/offset triplet into physical address. */ +static u16 axiom_usage_to_target_address(struct axiom_data *ts, u8 usage, u8 page, + char offset) +{ + /* At the moment the convention is that u31 is always at physical address 0x0 */ + if (!ts->usage_table_populated) { + if (usage == AXIOM_DEVINFO_USAGE_ID) + return ((page << 8) + offset); + else + return 0xffff; + } + + if (page >= ts->usage_table[usage].num_pages) { + dev_err(ts->dev, "Invalid usage table! usage: u%02x, page: %02x, offset: %02x\n", + usage, page, offset); + return 0xffff; + } + + return ((ts->usage_table[usage].start_page + page) << 8) + offset; +} + +static int axiom_read(struct axiom_data *ts, u8 usage, u8 page, void *buf, u16 len) +{ + struct axiom_cmd_header cmd_header; + u32 preamble; + int ret; + + cmd_header.target_address = cpu_to_le16(axiom_usage_to_target_address(ts, usage, page, 0)); + cmd_header.length = cpu_to_le16(len | AXIOM_CMD_HEADER_READ_MASK); + + preamble = get_unaligned_le32(&cmd_header); + + ret = regmap_write(ts->regmap, preamble, 0); + if (ret) { + dev_err(ts->dev, "failed to write preamble, error %d\n", ret); + return ret; + } + + ret = regmap_raw_read(ts->regmap, 0, buf, len); + if (ret) { + dev_err(ts->dev, "failed to read target address %04x, error %d\n", + cmd_header.target_address, ret); + return ret; + } + + /* Wait device's DMA operations */ + usleep_range(AXIOM_DMA_OPS_DELAY_USEC, AXIOM_DMA_OPS_DELAY_USEC + 50); + + return 0; +} + +/* + * One of the main purposes for reading the usage table is to identify + * which usages reside at which target address. + * When performing subsequent reads or writes to AXIOM, the target address + * is used to specify which usage is being accessed. + * Consider the following discovery code which will build up the usage table. + */ +static u32 axiom_populate_usage_table(struct axiom_data *ts) +{ + struct axiom_usage_entry *usage_table; + u8 *rx_data = ts->rx_buf; + u32 max_report_len = 0; + u32 usage_id; + int error; + + usage_table = ts->usage_table; + + /* Read the second page of usage u31 to get the usage table */ + error = axiom_read(ts, AXIOM_DEVINFO_USAGE_ID, 1, rx_data, + (AXIOM_U31_BYTES_PER_USAGE * ts->devinfo.num_usages)); + + if (error) + return error; + + for (usage_id = 0; usage_id < ts->devinfo.num_usages; usage_id++) { + u16 offset = (usage_id * AXIOM_U31_BYTES_PER_USAGE); + u8 id = rx_data[offset + 0]; + u8 start_page = rx_data[offset + 1]; + u8 num_pages = rx_data[offset + 2]; + u32 max_offset = ((rx_data[offset + 3] & AXIOM_PAGE_OFFSET_MASK) + 1) * 2; + + usage_table[id].is_report = !num_pages; + + /* Store the entry into the usage table */ + usage_table[id].id = id; + usage_table[id].start_page = start_page; + usage_table[id].num_pages = num_pages; + + dev_dbg(ts->dev, "Usage u%02x Info: %*ph\n", id, AXIOM_U31_BYTES_PER_USAGE, + &rx_data[offset]); + + /* Identify the max report length the module will receive */ + if (usage_table[id].is_report && max_offset > max_report_len) + max_report_len = max_offset; + } + + ts->usage_table_populated = true; + + return max_report_len; +} + +static int axiom_discover(struct axiom_data *ts) +{ + int error; + + /* + * Fetch the first page of usage u31 to get the + * device information and the number of usages + */ + error = axiom_read(ts, AXIOM_DEVINFO_USAGE_ID, 0, &ts->devinfo, AXIOM_U31_PAGE0_LENGTH); + if (error) + return error; + + dev_dbg(ts->dev, " Boot Mode : %s\n", + FIELD_GET(AXIOM_U31_BOOTMODE_MASK, + le16_to_cpu(ts->devinfo.device_id)) ? "BLP" : "TCP"); + dev_dbg(ts->dev, " Device ID : %04lx\n", + FIELD_GET(AXIOM_U31_DEVID_MASK, le16_to_cpu(ts->devinfo.device_id))); + dev_dbg(ts->dev, " Firmware Rev : %02x.%02x\n", ts->devinfo.fw_major, + ts->devinfo.fw_minor); + dev_dbg(ts->dev, " Bootloader Rev : %02x.%02x\n", ts->devinfo.bootloader_fw_major, + ts->devinfo.bootloader_fw_minor); + dev_dbg(ts->dev, " FW Extra Info : %04x\n", ts->devinfo.fw_info_extra); + dev_dbg(ts->dev, " Silicon : %04x\n", le16_to_cpu(ts->devinfo.jedec_id)); + dev_dbg(ts->dev, " Number usages : %04x\n", ts->devinfo.num_usages); + + ts->max_report_len = axiom_populate_usage_table(ts); + if (!ts->max_report_len || !ts->devinfo.num_usages || + ts->max_report_len > AXIOM_MAX_REPORT_LEN) { + dev_err(ts->dev, "Invalid report length or usages number"); + return -EINVAL; + } + + dev_dbg(ts->dev, "Max Report Length: %u\n", ts->max_report_len); + + return 0; +} + +/* + * Support function to axiom_process_u41_report. + * Generates input-subsystem events for every target. + * After calling this function the caller shall issue + * a Sync to the input sub-system. + */ +static bool axiom_process_u41_report_target(struct axiom_data *ts, + struct axiom_target_report *target) +{ + struct input_dev *input_dev = ts->input_dev; + struct axiom_u41_target *target_prev_state; + enum axiom_target_state current_state; + int id; + + /* Verify the target index */ + if (target->index >= AXIOM_U41_MAX_TARGETS) { + dev_err(ts->dev, "Invalid target index! %u\n", target->index); + return false; + } + + target_prev_state = &ts->targets[target->index]; + + current_state = AXIOM_TARGET_STATE_NOT_PRESENT; + + if (target->present) { + if (target->z >= 0) + current_state = AXIOM_TARGET_STATE_TOUCHING; + else if (target->z > AXIOM_PROX_LEVEL && target->z < 0) + current_state = AXIOM_TARGET_STATE_HOVER; + else if (target->z == AXIOM_PROX_LEVEL) + current_state = AXIOM_TARGET_STATE_PROX; + } + + if (target_prev_state->state == current_state && + target_prev_state->x == target->x && + target_prev_state->y == target->y && + target_prev_state->z == target->z) + return false; + + id = target->index; + + dev_dbg(ts->dev, "U41 Target T%u, slot:%u present:%u, x:%u, y:%u, z:%d\n", + target->index, slot, target->present, + target->x, target->y, target->z); + + switch (current_state) { + case AXIOM_TARGET_STATE_NOT_PRESENT: + case AXIOM_TARGET_STATE_PROX: + if (!target_prev_state->insert) + break; + target_prev_state->insert = false; + + if (!id) + input_report_key(input_dev, BTN_TOUCH, 0); + + input_mt_report_slot_inactive(input_dev); + /* + * make sure the previous coordinates are + * all off screen when the finger comes back + */ + target->x = 65535; + target->y = 65535; + target->z = AXIOM_PROX_LEVEL; + break; + case AXIOM_TARGET_STATE_HOVER: + case AXIOM_TARGET_STATE_TOUCHING: + target_prev_state->insert = true; + input_report_abs(input_dev, ABS_MT_TRACKING_ID, id); + input_report_abs(input_dev, ABS_MT_POSITION_X, target->x); + input_report_abs(input_dev, ABS_MT_POSITION_Y, target->y); + + if (current_state == AXIOM_TARGET_STATE_TOUCHING) { + input_report_abs(input_dev, ABS_MT_DISTANCE, 0); + input_report_abs(input_dev, ABS_DISTANCE, 0); + input_report_abs(input_dev, ABS_MT_PRESSURE, target->z); + input_report_abs(input_dev, ABS_PRESSURE, target->z); + } else { + input_report_abs(input_dev, ABS_MT_DISTANCE, -target->z); + input_report_abs(input_dev, ABS_DISTANCE, -target->z); + input_report_abs(input_dev, ABS_MT_PRESSURE, 0); + input_report_abs(input_dev, ABS_PRESSURE, 0); + } + + if (!id) + input_report_key(input_dev, BTN_TOUCH, (current_state == + AXIOM_TARGET_STATE_TOUCHING)); + break; + default: + break; + } + + target_prev_state->state = current_state; + target_prev_state->x = target->x; + target_prev_state->y = target->y; + target_prev_state->z = target->z; + + return true; +} + +/* + * U41 is the output report of the 2D CTS and contains the status of targets + * (including contacts and pre-contacts) along with their X,Y,Z values. + * When a target has been removed (no longer detected), + * the corresponding X,Y,Z values will be zeroed. + */ +static bool axiom_process_u41_report(struct axiom_data *ts, u8 *rx_buf) +{ + struct axiom_target_report target; + bool update_done = false; + u16 target_status; + int i; + + target_status = get_unaligned_le16(rx_buf + 1); + + for (i = 0; i < AXIOM_U41_MAX_TARGETS; i++) { + u8 *target_step = &rx_buf[i * 4]; + + target.index = i; + input_mt_slot(ts->input_dev, i); + input_mt_report_slot_state(ts->input_dev, MT_TOOL_FINGER, true); + target.present = ((target_status & (1 << i)) != 0) ? 1 : 0; + target.x = get_unaligned_le16(target_step + 3); + target.y = get_unaligned_le16(target_step + 5); + target.z = (s8)(rx_buf[i + 43]); + touchscreen_report_pos(ts->input_dev, &ts->prop, target.x, target.y, true); + update_done |= axiom_process_u41_report_target(ts, &target); + } + + return update_done; +} + +/* + * U46 report contains a low level measurement data generated by the capacitive + * displacement sensor (CDS) algorithms from the auxiliary channels. + * This information is useful when tuning multi-press to assess mechanical + * consistency in the unit's construction. + */ +static void axiom_process_u46_report(struct axiom_data *ts, u8 *rx_buf) +{ + struct input_dev *input_dev = ts->input_dev; + u32 event_value; + u16 aux_value; + int i; + + for (i = 0; i < AXIOM_U46_AUX_CHANNELS; i++) { + u8 *target_step = &rx_buf[i * 2]; + + input_mt_slot(input_dev, i); + input_mt_report_slot_state(input_dev, MT_TOOL_FINGER, true); + aux_value = get_unaligned_le16(target_step + 1) & AXIOM_U46_AUX_MASK; + event_value = (i << 16) | (aux_value); + input_event(input_dev, EV_MSC, MSC_RAW, event_value); + } +} + +/* + * Validates the crc and demultiplexes the axiom reports to the appropriate + * report handler + */ +static int axiom_handle_events(struct axiom_data *ts) +{ + struct input_dev *input_dev = ts->input_dev; + u8 *report_data = ts->rx_buf; + struct device *dev = ts->dev; + u16 crc_report; + u8 *crc_bytes; + u16 crc_calc; + int error; + u8 len; + + error = axiom_read(ts, AXIOM_REPORT_USAGE_ID, 0, report_data, ts->max_report_len); + if (error) + return error; + + len = (report_data[0] & AXIOM_COMMS_REPORT_LEN_MASK) << 1; + if (len <= 2) { + dev_err(dev, "Zero length report discarded.\n"); + return -ENODATA; + } + + /* Validate the report CRC */ + crc_bytes = &report_data[len]; + + crc_report = get_unaligned_le16(crc_bytes - 2); + /* Length is in 16 bit words and remove the size of the CRC16 itself */ + crc_calc = crc16(0, report_data, (len - 2)); + + if (crc_calc != crc_report) { + dev_err(dev, + "CRC mismatch! Expected: %#x, Calculated CRC: %#x.\n", + crc_report, crc_calc); + return -EINVAL; + } + + switch (report_data[1]) { + case AXIOM_USAGE_2DCTS_REPORT_ID: + if (axiom_process_u41_report(ts, &report_data[1])) { + input_mt_sync_frame(input_dev); + input_sync(input_dev); + } + break; + + case AXIOM_USAGE_2AUX_REPORT_ID: + /* This is an aux report (force) */ + axiom_process_u46_report(ts, &report_data[1]); + input_mt_sync(input_dev); + input_sync(input_dev); + break; + + case AXIOM_USAGE_2HB_REPORT_ID: + /* This is a heartbeat report */ + break; + default: + return -EINVAL; + } + + return 0; +} + +static void axiom_i2c_poll(struct input_dev *input_dev) +{ + struct axiom_data *ts = input_get_drvdata(input_dev); + + axiom_handle_events(ts); +} + +static irqreturn_t axiom_irq(int irq, void *dev_id) +{ + struct axiom_data *ts = dev_id; + + axiom_handle_events(ts); + + return IRQ_HANDLED; +} + +static void axiom_reset(struct gpio_desc *reset_gpio) +{ + gpiod_set_value_cansleep(reset_gpio, 1); + usleep_range(1000, 2000); + gpiod_set_value_cansleep(reset_gpio, 0); + msleep(AXIOM_STARTUP_TIME_MS); +} + +static int axiom_i2c_probe(struct i2c_client *client) +{ + struct device *dev = &client->dev; + struct input_dev *input_dev; + struct axiom_data *ts; + u32 poll_interval; + int target; + int error; + + ts = devm_kzalloc(dev, sizeof(*ts), GFP_KERNEL); + if (!ts) + return -ENOMEM; + + i2c_set_clientdata(client, ts); + ts->client = client; + ts->dev = dev; + + ts->regmap = devm_regmap_init_i2c(client, &axiom_i2c_regmap_config); + error = PTR_ERR_OR_ZERO(ts->regmap); + if (error) { + dev_err(dev, "Failed to initialize regmap: %d\n", error); + return error; + } + + ts->reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); + if (IS_ERR(ts->reset_gpio)) + return dev_err_probe(dev, PTR_ERR(ts->reset_gpio), "failed to get reset GPIO\n"); + + if (ts->reset_gpio) + axiom_reset(ts->reset_gpio); + + ts->vddi = devm_regulator_get_optional(dev, "vddi"); + if (!IS_ERR(ts->vddi)) { + error = devm_regulator_get_enable(dev, "vddi"); + if (error) + return dev_err_probe(&client->dev, error, + "Failed to enable vddi regulator\n"); + } + + ts->vdda = devm_regulator_get_optional(dev, "vdda"); + if (!IS_ERR(ts->vdda)) { + error = devm_regulator_get_enable(dev, "vdda"); + if (error) + return dev_err_probe(&client->dev, error, + "Failed to enable vdda regulator\n"); + msleep(AXIOM_STARTUP_TIME_MS); + } + + error = axiom_discover(ts); + if (error) + return dev_err_probe(dev, error, "Failed touchscreen discover\n"); + + input_dev = devm_input_allocate_device(ts->dev); + if (!input_dev) + return -ENOMEM; + + input_dev->name = "TouchNetix axiom Touchscreen"; + input_dev->phys = "input/axiom_ts"; + + input_set_abs_params(input_dev, ABS_MT_POSITION_X, 0, 65535, 0, 0); + input_set_abs_params(input_dev, ABS_MT_POSITION_Y, 0, 65535, 0, 0); + input_set_abs_params(input_dev, ABS_MT_TOOL_TYPE, 0, MT_TOOL_MAX, 0, 0); + input_set_abs_params(input_dev, ABS_MT_DISTANCE, 0, 127, 0, 0); + input_set_abs_params(input_dev, ABS_MT_PRESSURE, 0, 127, 0, 0); + + touchscreen_parse_properties(input_dev, true, &ts->prop); + + /* Registers the axiom device as a touchscreen instead of a mouse pointer */ + error = input_mt_init_slots(input_dev, AXIOM_U41_MAX_TARGETS, INPUT_MT_DIRECT); + if (error) + return error; + + /* Enables the raw data for up to 4 force channels to be sent to the input subsystem */ + set_bit(EV_REL, input_dev->evbit); + set_bit(EV_MSC, input_dev->evbit); + /* Declare that we support "RAW" Miscellaneous events */ + set_bit(MSC_RAW, input_dev->mscbit); + + ts->input_dev = input_dev; + input_set_drvdata(ts->input_dev, ts); + + /* Ensure that all reports are initialised to not be present. */ + for (target = 0; target < AXIOM_U41_MAX_TARGETS; target++) + ts->targets[target].state = AXIOM_TARGET_STATE_NOT_PRESENT; + + error = devm_request_threaded_irq(dev, client->irq, NULL, + axiom_irq, IRQF_ONESHOT, dev_name(dev), ts); + if (error) { + dev_info(dev, "Request irq failed, falling back to polling mode"); + + error = input_setup_polling(input_dev, axiom_i2c_poll); + if (error) + return dev_err_probe(ts->dev, error, "Unable to set up polling mode\n"); + + if (!device_property_read_u32(ts->dev, "poll-interval", &poll_interval)) + input_set_poll_interval(input_dev, poll_interval); + else + input_set_poll_interval(input_dev, POLL_INTERVAL_DEFAULT_MS); + } + + error = input_register_device(input_dev); + if (error) + return dev_err_probe(ts->dev, error, + "Could not register with Input Sub-system.\n"); + + return 0; +} + +static const struct i2c_device_id axiom_i2c_id_table[] = { + { "ax54a" }, + { }, +}; +MODULE_DEVICE_TABLE(i2c, axiom_i2c_id_table); + +static const struct of_device_id axiom_i2c_of_match[] = { + { .compatible = "touchnetix,ax54a", }, + { } +}; +MODULE_DEVICE_TABLE(of, axiom_i2c_of_match); + +static struct i2c_driver axiom_i2c_driver = { + .driver = { + .name = "axiom", + .of_match_table = axiom_i2c_of_match, + }, + .id_table = axiom_i2c_id_table, + .probe = axiom_i2c_probe, +}; +module_i2c_driver(axiom_i2c_driver); + +MODULE_AUTHOR("Bart Prescott "); +MODULE_AUTHOR("Pedro Torruella "); +MODULE_AUTHOR("Mark Satterthwaite "); +MODULE_AUTHOR("Hannah Rossiter "); +MODULE_AUTHOR("Kamel Bouhara "); +MODULE_DESCRIPTION("TouchNetix axiom touchscreen I2C bus driver"); +MODULE_LICENSE("GPL");