From patchwork Tue Sep 20 04:26:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12981348 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 70AD6C6FA90 for ; Tue, 20 Sep 2022 04:27:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=TO/qOinHqRI35m7VqASPo3KJSygEOk3Lls1pleVzPkk=; b=CMY9NrIwy2dj0O omcda/imFybegzwOpnYE2e6lpWBpQbly6iYhCdZ/jj75PDhQgrXFtM+XCI1bbwVaPjwkPjZSsOQuT 6kpG1+oq8qr8hYfnKg9kruNWODITkA8CLzMa/accm4VMN7k2pvG8g76NqpUQFtnltiAYVhwgh8ZYz XDES3fcxfvfR3V0ZsGsfH7f1QH1vshZBxzjoxnq8XnD1DF3TkU08V0EZfB2kmC31OU11iCen6WRap qse+DoG1KXeBAJviCLZgJg23mzfG2CW90HlVxxqwIoFIfAETc7FS/8asRJeZ+Ukf8oaX7IOnY85Uj UAV+R8Ql+PKEuUNDTAQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaUpw-000NBG-AJ; Tue, 20 Sep 2022 04:26:20 +0000 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaUps-000N6w-JE for linux-arm-kernel@lists.infradead.org; Tue, 20 Sep 2022 04:26:17 +0000 Received: by mail-pf1-x433.google.com with SMTP id b75so1601507pfb.7 for ; Mon, 19 Sep 2022 21:26:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date; bh=uVqkXrKh/BOL72z7RBz/jXCRaf0wbeq1TN40XiN2ST0=; b=H7mdcLBDJJDfrxDeMtiv1gAHhc5Y2zNKH7rxB7L+cveN7GFkfxN8M2aNCkirA8GhXW Ld3PRMtg4mssDLcXHoQuSbuy6is2/3kYaa9XOZUu1cH244uF5CRW1y0L7m9B0BSevky0 DQBGpm2omE6vdTc60XiHsonxzCyL3VYzjKgeAZsEgcWsXk/wmT4t3OOUBF2gWF9HjykU FWCfho+uCzumfXk0mlQNO4NstAZWFG/sgbtt61dye+6EkRe8I3GfZHZzpCg66i3ykxZX 6dXf5PNzXHUA1M+65bNIijKbc+NL3oahfccTZt+30DNUyywpcj2KC12r317P+3Oyb8fk yK1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date; bh=uVqkXrKh/BOL72z7RBz/jXCRaf0wbeq1TN40XiN2ST0=; b=5n1FtLKnbdrCq7GiL3sM+iDcSSx1tNnMOcM0GkGgeSpAmV8R3Q9Rdm63emIIy6o7Np F753m9RS7//W+F4+5eITD/hPEADfmwPF1JkC8x7snaF1nMTgzbuliG+HQ9dzZJSPhJPi vKtQ71dVjbVjFavK40pCGcnaG9lHYMFmuduugmzWa9LRysfsRAloxvX3TjA5YceLwuO6 BGqyxXbpeUfFeW+XvAyWx3vKA8zrOT7HYGAznSkAa3H1qQArRWCp3J2Et0saXm6lo81p nrV8cWKkIVv/t8USus8FtRAYguwT79o5zScy/4jax7MBRCT+sLAIHGODtmvHj8lvQpPj Sr6A== X-Gm-Message-State: ACrzQf2Tz+hodLCYd/QbwWXulD4tzXoSshOOn18/CO+GOfuHxAcoB893 lu5JLeNuBcK+ZuQwhg1jYMs= X-Google-Smtp-Source: AMsMyM6weMjGDsVYFkcghzfNlMx4UQ6aeMIYIS6GGO8IPN7xgqg7/XhpJJz54LI2DSqMInhnpw23wA== X-Received: by 2002:a63:9041:0:b0:438:8ed0:8470 with SMTP id a62-20020a639041000000b004388ed08470mr17979059pge.25.1663647972762; Mon, 19 Sep 2022 21:26:12 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:b095:5d5d:4c28:8088]) by smtp.gmail.com with ESMTPSA id t15-20020a17090a024f00b001fab208523esm337518pje.3.2022.09.19.21.26.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 21:26:12 -0700 (PDT) From: Dmitry Torokhov To: Shawn Guo , Sascha Hauer , linux-input@vger.kernel.org Cc: Krzysztof Kozlowski , Fabio Estevam , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/4] ARM: dts: imx6qdl-sabre*: fix Egalax touchscreen properties Date: Mon, 19 Sep 2022 21:26:05 -0700 Message-Id: <20220920042608.1865560-1-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220919_212616_675376_E7D86C9F X-CRM114-Status: GOOD ( 15.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This patch fixes interrupt trigger (should be level low as that is what the driver is always using), the GPIO that is the interrupt source that is also used to wake up chip by driving the line low. The proper polarity is be needed for converting the driver to gpiod API. Signed-off-by: Dmitry Torokhov Acked-by: Shawn Guo --- arch/arm/boot/dts/imx6qdl-sabreauto.dtsi | 4 ++-- arch/arm/boot/dts/imx6qdl-sabresd.dtsi | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi index 1368a4762037..1883350d004e 100644 --- a/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabreauto.dtsi @@ -451,8 +451,8 @@ touchscreen@4 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_egalax_int>; interrupt-parent = <&gpio2>; - interrupts = <28 IRQ_TYPE_EDGE_FALLING>; - wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_HIGH>; + interrupts = <28 IRQ_TYPE_LEVEL_LOW>; + wakeup-gpios = <&gpio2 28 GPIO_ACTIVE_LOW>; }; }; diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi index 37482a9023fc..09f4c2fa3ad6 100644 --- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi +++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi @@ -311,8 +311,8 @@ touchscreen@4 { pinctrl-names = "default"; pinctrl-0 = <&pinctrl_i2c2_egalax_int>; interrupt-parent = <&gpio6>; - interrupts = <8 IRQ_TYPE_EDGE_FALLING>; - wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_HIGH>; + interrupts = <8 IRQ_TYPE_LEVEL_LOW>; + wakeup-gpios = <&gpio6 8 GPIO_ACTIVE_LOW>; }; ov5640: camera@3c { @@ -450,8 +450,8 @@ egalax_ts@4 { compatible = "eeti,egalax_ts"; reg = <0x04>; interrupt-parent = <&gpio6>; - interrupts = <7 2>; - wakeup-gpios = <&gpio6 7 0>; + interrupts = <7 IRQ_TYPE_LEVEL_LOW>; + wakeup-gpios = <&gpio6 7 GPIO_ACTIVE_LOW>; }; magnetometer@e { From patchwork Tue Sep 20 04:26:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12981345 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 959BFC54EE9 for ; Tue, 20 Sep 2022 04:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=GoJVPNkmks+5OT4O27SioMtzWrAdy7HEiwcZwsQk2lg=; b=xUpFMEYS6AA/nP BRPRy5WZc4tf9XJ8TIuSNeY3NafZwmacrqI3C8cYH/O3fv3PMf2jVWW2mAEm+ZbPk2UlzMlZ/N+Nk pPr4eyYhnepYMz50rt62YIrA/LMO+AeRjZMURz/CnahOc0ksTsIJb7/nORRnuSGdDNleuqZYSZF1u kzaiRJeIePhMF7wLmzjzPuar1f6HjvKuMMMtskt0XwTXwiAjg8RqkPjQy6HM+2fGxTZOz/J4ghabx 0QE6Szp6654EK1QjkCPz3bZnM62r3CBfTUt+ON86tl2JHm44QCCivNKYDlKUIC4Ge2Xu5+n8YZsVB G7wODtys7kHZjaz60ULQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaUq4-000NDN-II; Tue, 20 Sep 2022 04:26:28 +0000 Received: from mail-pg1-x52b.google.com ([2607:f8b0:4864:20::52b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaUps-000N7E-TZ for linux-arm-kernel@lists.infradead.org; Tue, 20 Sep 2022 04:26:18 +0000 Received: by mail-pg1-x52b.google.com with SMTP id h188so1318261pgc.12 for ; Mon, 19 Sep 2022 21:26:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=kNFWWy7bwpQVYleHcT5hR/K7/r+CDpNqO6pCTqZ+Bqk=; b=iEoOYDQuDeKqlyz9GzDA5FBF1n+Te1LRLAVTNZY+LC9cDRaDrwdI07j386rCcjd/+b jWSruN7EDHX7ArOufpN/hDIWzVfTZfN7YgrBRuGcWQRg6lH7e4sbajvVJ9oXiNQeCaTe 76+dqf22D4yzJl3PPTKcG948hM6pO+PlHjvyW1vtG4Sf/nbJjMVxVWNCn+HTUe/cLsui 8Q4bs1P5Jh8MAmvTVnp2O1IF6BBq/6nJcVdYZob/VlrrTIXE574cAKRnKWGGVpINxWHM QY90cN6dlVwwMtoWODH+RcX8nJPUGlI0HUXd3nEsZwXziRBq/UEfUkb12AkCK+HSvolf RFkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=kNFWWy7bwpQVYleHcT5hR/K7/r+CDpNqO6pCTqZ+Bqk=; b=qysNv0THFD7Z/46rNE63yxVdtNMs30lzNn9+yBTwFPFhLfRTx17/CjAxpARYeFVecp almUrmZcmrvwnM/Hk2e8XezMJm7sF7XPnQklR6u1jaY0rOE2TYawV0l8gGuzfw4sb3/7 t7/yhRSgxthVx50OWfxw7ae10kQDsVJ9ff74n7dO1sE+k++ddN9c41ytVIIk0FVxjpI1 jyuC9DWw32QI8QZQ86T3WtFgFJmWhGaTgLOb98oOxEkgKs1zpGCVXIYLraKuKwIu9gfI JzCgG0l1pOnoxPmXIlzLloUcZF5phCWwY0p2fVaBx7IgjrY0OSqk2osGypQFC4m5TctT 2SDA== X-Gm-Message-State: ACrzQf22VuOFV9aASx6ixlITl2ynK721JNpsntRb92cVSFBHkQDQ/mwF BBvn28K145F5aOm0B0z8ABE= X-Google-Smtp-Source: AMsMyM6kjzieQk2rKnAzOxto0IPCpm9CxxoKAfWuP0jfdKwCKYLBCjC1iEbrRHSMs6hoOtRm5gZHew== X-Received: by 2002:aa7:952f:0:b0:540:e8ee:a077 with SMTP id c15-20020aa7952f000000b00540e8eea077mr22001999pfp.34.1663647973928; Mon, 19 Sep 2022 21:26:13 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:b095:5d5d:4c28:8088]) by smtp.gmail.com with ESMTPSA id t15-20020a17090a024f00b001fab208523esm337518pje.3.2022.09.19.21.26.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 21:26:13 -0700 (PDT) From: Dmitry Torokhov To: Shawn Guo , Sascha Hauer , linux-input@vger.kernel.org Cc: Krzysztof Kozlowski , Fabio Estevam , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/4] dt-binding: input: egalax-ts: fix GPIO and IRQ in example Date: Mon, 19 Sep 2022 21:26:06 -0700 Message-Id: <20220920042608.1865560-2-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog In-Reply-To: <20220920042608.1865560-1-dmitry.torokhov@gmail.com> References: <20220920042608.1865560-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220919_212616_970172_3F04EF53 X-CRM114-Status: GOOD ( 12.84 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The driver is using level triggered interrupt (low) which is backed by and active low GPIO that can be used to wake the controller by driving it low. Let's annotate it properly in the example. Signed-off-by: Dmitry Torokhov Acked-by: Krzysztof Kozlowski --- .../devicetree/bindings/input/touchscreen/egalax-ts.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt index 92fb2620f5e2..ebbe93810574 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt +++ b/Documentation/devicetree/bindings/input/touchscreen/egalax-ts.txt @@ -13,6 +13,6 @@ Example: compatible = "eeti,egalax_ts"; reg = <0x04>; interrupt-parent = <&gpio1>; - interrupts = <9 2>; - wakeup-gpios = <&gpio1 9 0>; + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + wakeup-gpios = <&gpio1 9 GPIO_ACTIVE_LOW>; }; From patchwork Tue Sep 20 04:26:07 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12981346 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id C3EFCECAAD8 for ; Tue, 20 Sep 2022 04:27:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=KvW3eIQ4j9PLCeki328JKQKTSzwH4sCVs18cTaf0UdE=; b=RmpqpjaYDvLXcX GgQjOG7wz2UvxxBaQKYbZclC3+cKKQVxwAKoCZ2e4niGTHW8Zqn+c4TglC6OzN8C9BCzvYCUdTcFB L8D1FQBZxitEdm7IpxutjFtYpj2AGdrNej0vrOiaqEnMLUBGmVf4y2mM2+TLiW9mABkvxjOvbVV+E wDxvJGH+tVnA1ODLTnltkbovHYDsmQFtO5JBtNIyuYZsC06sRQ2IBJL6W2m/OMYUVX4pzK2nYbxMC 14pi7OsHimF+6dM2swp6qukgA6Xm6Q6nvdRBvSLlcNywtrsmLYxk6fzWLO6cxePavKPhqWQdujSsr ee0mE+mEnsbino9zJS7w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaUqL-000NIm-HN; Tue, 20 Sep 2022 04:26:45 +0000 Received: from mail-pl1-x633.google.com ([2607:f8b0:4864:20::633]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaUpu-000N8c-3b for linux-arm-kernel@lists.infradead.org; Tue, 20 Sep 2022 04:26:19 +0000 Received: by mail-pl1-x633.google.com with SMTP id iw17so1241068plb.0 for ; Mon, 19 Sep 2022 21:26:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=pIGkYbf9yJq729wkfcXhqGqwyONGFWTL2PsMGXYGRvA=; b=b1A/UY/etRaIToqRoaqAcmDdOu0iH5cXbcOhn+YhlJosnosC1rD7s7QfxhFGiRikNE /zYKEgqwFVesX6Qcky1cciscr/9ZSZXXlVlQCSdy/oFiJfPpSDUrSkSSGegMYdyM9rS/ ubmH2jI8lBtJ0qjtYexMwjJKAFRorbONbNTqS0vIQvhsnoqPxQXQ4NWGdZ9rkA/oARy6 /6rsAK6w/rIKrVamDDJa/WNYOdhEROcdUebOcI+6MFNZ2k/N0OYt45cxfQ07aQqKu12W I7+csj1oIBRGJYKbVwt8hgAak8Da7iXHXlyCFhG3c8A2rn6ZkcuJW81OzJoSr1BtORKb ORvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=pIGkYbf9yJq729wkfcXhqGqwyONGFWTL2PsMGXYGRvA=; b=G6C5PW7rtZDJxLLy5ZQmkr/PJ3HQ69KcoYj15UjbJZDTfRysZGX7xJ7UPVhqPSM1hu k8mYHGLJFA7liQ4RLhdtmUB5XpFENjWifDIrDFEzjyv4WwHTZ94nvj0ZfItyU01SqrXj 6mtdnDRVZFavWUbpOwCEOB5ENQwuc6VWYMZXG6hQFGuE1I7CO+1DjaFRniHqcbh/qV+D 85CL9rkimJ3JyE30KmWlNyS1Wfja6btPtNENEDsjFGLGcat2i/mu5GsUyqQJrA6QElCu lWRxFhpuEbxUeZkPZCjwXrsug9EHaP4VQ1fbCLRqhdCUcO98bfQQ4UprVWfcFv+6N3+6 q7QQ== X-Gm-Message-State: ACrzQf2ObJq5QhOMz9GWqxJ2VCM28FBz/IE1iBsGeZVwc3hE73cVYfzL lX9T4qAZwKpJ6E0PC6cTQZE9GBgcOcI= X-Google-Smtp-Source: AMsMyM57I0D9KIVw5AL4bdyaT/GSXFo5QhBvAjAk5tjNPB7zD3KhkddmqgVNM5gMV4mJBMN9PV5OmQ== X-Received: by 2002:a17:902:c941:b0:177:e69a:a517 with SMTP id i1-20020a170902c94100b00177e69aa517mr3090266pla.144.1663647975125; Mon, 19 Sep 2022 21:26:15 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:b095:5d5d:4c28:8088]) by smtp.gmail.com with ESMTPSA id t15-20020a17090a024f00b001fab208523esm337518pje.3.2022.09.19.21.26.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 21:26:14 -0700 (PDT) From: Dmitry Torokhov To: Shawn Guo , Sascha Hauer , linux-input@vger.kernel.org Cc: Krzysztof Kozlowski , Fabio Estevam , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/4] Input: egalax_ts - switch to using gpiod API Date: Mon, 19 Sep 2022 21:26:07 -0700 Message-Id: <20220920042608.1865560-3-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog In-Reply-To: <20220920042608.1865560-1-dmitry.torokhov@gmail.com> References: <20220920042608.1865560-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220919_212618_176219_86FF4044 X-CRM114-Status: GOOD ( 18.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This updates the driver to gpiod API, and removes yet another use of of_get_named_gpio(). Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/egalax_ts.c | 42 +++++++++++---------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 83ac8c128192..9e9b1c52720d 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c @@ -14,17 +14,17 @@ - auto idle mode support */ +#include #include #include #include #include #include -#include +#include #include #include #include #include -#include /* * Mouse Mode: some panel may configure the controller to mouse mode, @@ -119,32 +119,26 @@ static irqreturn_t egalax_ts_interrupt(int irq, void *dev_id) /* wake up controller by an falling edge of interrupt gpio. */ static int egalax_wake_up_device(struct i2c_client *client) { - struct device_node *np = client->dev.of_node; - int gpio; + struct gpio_desc *gpio; int ret; - if (!np) - return -ENODEV; - - gpio = of_get_named_gpio(np, "wakeup-gpios", 0); - if (!gpio_is_valid(gpio)) - return -ENODEV; - - ret = gpio_request(gpio, "egalax_irq"); - if (ret < 0) { - dev_err(&client->dev, - "request gpio failed, cannot wake up controller: %d\n", - ret); + /* wake up controller via an falling edge on IRQ gpio. */ + gpio = gpiod_get(&client->dev, "wakeup", GPIOD_OUT_HIGH); + ret = PTR_ERR_OR_ZERO(gpio); + if (ret) { + if (ret != -EPROBE_DEFER) + dev_err(&client->dev, + "failed to request wakeup gpio, cannot wake up controller: %d\n", + ret); return ret; } - /* wake up controller via an falling edge on IRQ gpio. */ - gpio_direction_output(gpio, 0); - gpio_set_value(gpio, 1); + /* release the line */ + gpiod_set_value_cansleep(gpio, 0); - /* controller should be waken up, return irq. */ - gpio_direction_input(gpio); - gpio_free(gpio); + /* controller should be woken up, return irq. */ + gpiod_direction_input(gpio); + gpiod_put(gpio); return 0; } @@ -185,10 +179,8 @@ static int egalax_ts_probe(struct i2c_client *client, /* controller may be in sleep, wake it up. */ error = egalax_wake_up_device(client); - if (error) { - dev_err(&client->dev, "Failed to wake up the controller\n"); + if (error) return error; - } error = egalax_firmware_version(client); if (error < 0) { From patchwork Tue Sep 20 04:26:08 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Torokhov X-Patchwork-Id: 12981347 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7E7E8C6FA91 for ; Tue, 20 Sep 2022 04:27:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=T1ZgmyaEusciEYHvrTWORyzfrPuqZ620xIppAOQ7mMs=; b=h231gzfh2WPj7g 1sIQVjQTwzq7BDdBUklneZ50+MLV7k+anaJrVdU6+CTwbxqWFqJF/po/cTu1Ectq4UGqdYlDOY+yD +8QI4guEXRApFNjYPJWs0m5PkrZCHcYf+ZvwFWsg2AkfkBgSSgTlnB/mp2n6nQmhbRnh/IyP2mkiZ A/UVZoZKikHz6chnwqP+zCMpYJNSr6cheVnnO5qbT51rYie4DitfcnKSKwkvZvsDPGP1WUEiHS0M/ U82RhJp2n1novnYtcgdKBXUfqcSxaX8e7Ag6IpPj4UGwWy2GHzfHVz97e0xCCze/LjGsB52uggGRy e9yTVj8IGtOSB+CcdQFQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaUqD-000NFi-8h; Tue, 20 Sep 2022 04:26:37 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oaUpu-000N8z-4D for linux-arm-kernel@lists.infradead.org; Tue, 20 Sep 2022 04:26:19 +0000 Received: by mail-pl1-x62b.google.com with SMTP id b21so1189090plz.7 for ; Mon, 19 Sep 2022 21:26:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date; bh=rfUpzYsI63frIDNqdmtPpUE/MEzLhWYo/H+oG5zg+h8=; b=UbE8mSCw4zn9exu+f8n6nmg2N5VlvTNPteV9yQ84pmabq9FyvlDwWZUtyEB/gFIPcL YcHgfHgRkZtRpwpIw4rh/OmS0bSbwYkynpmB2cY3tswQTH8tLkoHlsuMUMAbiJnKlh+Q vwa5wxZ4thbiZY9lmUsdSvrjTGzmNW8t3wOPRDunGxfzfbPlbGVv/9Me9VhJFoX/T51r 4Xhh3R+mohFH245CVSTeW4fNK2LjuD8d8XQ0HqsO6yu9zp7usqoXjBsVJSSobWmdVKwR 3LF0ZJaV9A4q4w35HbOOOKioeuArN7unkZ3Ir/X1LxHGbywXfs1mqeWitwBj/iFm6QTp 2d/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date; bh=rfUpzYsI63frIDNqdmtPpUE/MEzLhWYo/H+oG5zg+h8=; b=Cr9X3XeCw0dac0ibChRES9bBgw6WbTrFKzxln7/wSbrEkOG/0IdC0uXdmu4Jk1772H re53mQnOC2Eqf6zPbZ7H7b2BzfmYXvUeKC/GNH4h5XOAH7JZrZm7yriCiR+K6OlBfzgA 5ZlNICJ30N22cUiS8sgfEwmBzaQadfxOP3Utxr+pF0ybddgZaQAf5wGtc87WB0i6ro3f SnKZSy1nhPPQzrbbF/SD/owP6v702Gw4qvbQo/OAsbiLdRVtVk0i8C9sZacOy6MtMIhy p6PlClJwLgilO2VOx6lALq7+UPHlq7MFORIY7G9pRHo+mQtPshXbtf4DppNx7Wdu2h4y 6jOA== X-Gm-Message-State: ACrzQf0p61oLPnx9bhKuyyohXi+PjV/hL5H2YwLk+4fbb6x8ON9eBbtF eLKXbLNKTQZqavHMkw7lAP8= X-Google-Smtp-Source: AMsMyM6Eo2sVwAvW4yjDLBtQUL5K0AJwz1fwTFJsPODUbnZKBr5vLscVdpLogQsr8lAuEC1TZag7Eg== X-Received: by 2002:a17:902:e550:b0:177:f115:1646 with SMTP id n16-20020a170902e55000b00177f1151646mr3148201plf.112.1663647976320; Mon, 19 Sep 2022 21:26:16 -0700 (PDT) Received: from dtor-ws.mtv.corp.google.com ([2620:15c:202:201:b095:5d5d:4c28:8088]) by smtp.gmail.com with ESMTPSA id t15-20020a17090a024f00b001fab208523esm337518pje.3.2022.09.19.21.26.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Sep 2022 21:26:15 -0700 (PDT) From: Dmitry Torokhov To: Shawn Guo , Sascha Hauer , linux-input@vger.kernel.org Cc: Krzysztof Kozlowski , Fabio Estevam , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/4] Input: egalax_ts - do not hardcode interrupt trigger Date: Mon, 19 Sep 2022 21:26:08 -0700 Message-Id: <20220920042608.1865560-4-dmitry.torokhov@gmail.com> X-Mailer: git-send-email 2.37.3.968.ga6b4b080e4-goog In-Reply-To: <20220920042608.1865560-1-dmitry.torokhov@gmail.com> References: <20220920042608.1865560-1-dmitry.torokhov@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220919_212618_201868_002B7DBC X-CRM114-Status: GOOD ( 12.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Stop hard-coding interrupt trigger, instead rely on the platform code to do the right thing, according to DT or ACPI data. Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/egalax_ts.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c index 9e9b1c52720d..8333a512b605 100644 --- a/drivers/input/touchscreen/egalax_ts.c +++ b/drivers/input/touchscreen/egalax_ts.c @@ -203,10 +203,9 @@ static int egalax_ts_probe(struct i2c_client *client, ABS_MT_POSITION_Y, 0, EGALAX_MAX_Y, 0, 0); input_mt_init_slots(input_dev, MAX_SUPPORT_POINTS, 0); - error = devm_request_threaded_irq(&client->dev, client->irq, NULL, - egalax_ts_interrupt, - IRQF_TRIGGER_LOW | IRQF_ONESHOT, - "egalax_ts", ts); + error = devm_request_threaded_irq(&client->dev, client->irq, + NULL, egalax_ts_interrupt, + IRQF_ONESHOT, "egalax_ts", ts); if (error < 0) { dev_err(&client->dev, "Failed to register interrupt\n"); return error;