From patchwork Tue Apr 23 13:46:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 791691 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.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 77FD0136983; Tue, 23 Apr 2024 13:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; cv=none; b=j/07sEKk1+yPvRuqE/4SUcHG1ePk2i6E3aZwNbgVccEk3KvXKjVS8rsSGDEDEv0R18DwbVcBxNP6WUUpEeN4HiotF3q/SzQD0/fBsMxhUKPpzRBB2Du2FfcQKXmWZ4luwzYQw9Z2lb2oZjsB3DxFPpKTkJdPeCsY48n11D1H38U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; c=relaxed/simple; bh=1fUfoe4zZBmvWWiSJkd0f4oR3lZr2TQcJzLpPSJYlVE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=OYc3EYFIu0Is0qtgAjkuv7vdkMu3i5Rs8dUy6SBxYSCEUur0/o10oggCXaCb9d1dHgrmfo3AgeIpKEH2fF5spM6dUebtb2SWF0eFstosLvV8FR4POlcDzSiQYeScYzns+e+KiE9CRu+m3RZkF6mOaMHAikwZft3SNJupWB7K4SY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KgH/8sDd; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KgH/8sDd" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02DA4C32782; Tue, 23 Apr 2024 13:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713880012; bh=1fUfoe4zZBmvWWiSJkd0f4oR3lZr2TQcJzLpPSJYlVE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KgH/8sDdwhaeLtvbmI78nqoTtpQStgP8MFrzaAJUUNeNS4PleoYJG/4u7obcPN340 gt2Jt3zS6KF/aDEIg6nlV0vQ7vccKGmF6N3misp9r3GHxODtW9TO58d9S5Jnb6W3tf YeUF0tY+zkOnBVXF2/xxwRgx3BALMnS8bfJVsh45i32IVUvQ7RDFHVoaNjroGa1AHU +eNjm0GNMPUheLb0xqR/WK1fpsk8nGSb2KjXuClhVjL7qaZ+cModmPM9mdTsT41krG 6hKE6N8v78E36wky6D0qs/MsPs07Gmhw3/j5yabiFJmonuhSXF4LtZOcmZFJ+JrXz1 Oya8pd6Tdg5UA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rzGTy-000000008Kg-0QDi; Tue, 23 Apr 2024 15:46:50 +0200 From: Johan Hovold To: Jiri Kosina , Benjamin Tissoires Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Douglas Anderson , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , Zhengqiao Xia Subject: [PATCH 1/6] dt-bindings: HID: i2c-hid: add dedicated Ilitek ILI2901 schema Date: Tue, 23 Apr 2024 15:46:06 +0200 Message-ID: <20240423134611.31979-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240423134611.31979-1-johan+linaro@kernel.org> References: <20240423134611.31979-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The Ilitek ILI2901 touch screen controller was apparently incorrectly added to the Elan eKTH6915 schema simply because it also has a reset gpio and is currently managed by the Elan driver in Linux. The two controllers are not related even if an unfortunate wording in the commit message adding the Ilitek compatible made it sound like they were. Add a dedicated schema for the ILI2901 which does not specify the I2C address (which is likely 0x41 rather than 0x10 as for other Ilitek touch controllers) to avoid cluttering the Elan schema with unrelated devices and to make it easier to find the correct schema when adding further Ilitek controllers. Fixes: d74ac6f60a7e ("dt-bindings: HID: i2c-hid: elan: Introduce Ilitek ili2901") Cc: Zhengqiao Xia Signed-off-by: Johan Hovold --- .../bindings/input/elan,ekth6915.yaml | 5 +- .../bindings/input/ilitek,ili2901.yaml | 66 +++++++++++++++++++ 2 files changed, 68 insertions(+), 3 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/ilitek,ili2901.yaml diff --git a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml index dc4ac41f2441..3e2d216c6432 100644 --- a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml +++ b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml @@ -18,9 +18,8 @@ allOf: properties: compatible: - enum: - - elan,ekth6915 - - ilitek,ili2901 + items: + - const: elan,ekth6915 reg: const: 0x10 diff --git a/Documentation/devicetree/bindings/input/ilitek,ili2901.yaml b/Documentation/devicetree/bindings/input/ilitek,ili2901.yaml new file mode 100644 index 000000000000..1abeec768d79 --- /dev/null +++ b/Documentation/devicetree/bindings/input/ilitek,ili2901.yaml @@ -0,0 +1,66 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/ilitek,ili2901.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ilitek ILI2901 touchscreen controller + +maintainers: + - Jiri Kosina + +description: + Supports the Ilitek ILI2901 touchscreen controller. + This touchscreen controller uses the i2c-hid protocol with a reset GPIO. + +allOf: + - $ref: /schemas/input/touchscreen/touchscreen.yaml# + +properties: + compatible: + enum: + - ilitek,ili2901 + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + panel: true + + reset-gpios: + maxItems: 1 + + vcc33-supply: true + + vccio-supply: true + +required: + - compatible + - reg + - interrupts + - vcc33-supply + +additionalProperties: false + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@41 { + compatible = "ilitek,ili2901"; + reg = <0x41>; + + interrupt-parent = <&tlmm>; + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + + reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>; + vcc33-supply = <&pp3300_ts>; + }; + }; From patchwork Tue Apr 23 13:46:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 791335 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.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 7801D136986; Tue, 23 Apr 2024 13:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; cv=none; b=HETb22UEp6UKdqWfzD4M9GIHyiahtGnxo5UoCrPW3424HRqKlPtGsdovsNmlYqKkIKf3g/k8qdE6/vCBjbfh/6XN0JrndYIhaJB9yg1hqgyg/WiBQ+gWL0c8aO902b6iKn+ixR9qKwJxmyA90MkU3uCZkBb0sallCiGpIecbQO4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; c=relaxed/simple; bh=OTreVTB2JCvMy1mBHfi2hPMPHGKxxD/lOjIeJI1Zor4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=peTtLLHvDsK0x6Az5uAztFU+RPYA3DnI9Z7fgDsjIjZNdDDUtrTI1tjB7g9zuHDDf7/lTdjlUmmFjo+Khy15s5JlUAEzqJVe6WChu+Vv1RYQfr7rtp7Ri4S7Ex5nxfhmmFhPgCoKGBjpdp0sshFMtucLomSc+PtPAEzzr9dfgkg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=ek9Gb2/J; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="ek9Gb2/J" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 079E5C3277B; Tue, 23 Apr 2024 13:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713880012; bh=OTreVTB2JCvMy1mBHfi2hPMPHGKxxD/lOjIeJI1Zor4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ek9Gb2/J1piXyz6hLQ1J4WRrB1ATlALMehMSRWLL2qqm9ajJMSjh0gGOlvAvJoqUF b5tPTnl1YN4ZWvqa2k3/kAuePrrle+jsuOnXw/IczWPbAnKq0G6fbACrt+5NhjoQ7D +7NqWhKC//Ny0ZYx6MuIeAqL91IYuyRsTI2BlALG8IWa/W8Orl4xAUMbCIXxduWq28 vgCoHqY7cyfr+L8+ZpzkSz97tpxRB980Of8yUTq66GYmsaDMo7NLi3xYONljNfiuWd IRfoXBYKT/w2bsv5QknGL8gC13VwBmVkirFezhxJ6lCWQImXz+Yl9o2ASpWdPgNL1j +4ULUSzIEI0xw== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rzGTy-000000008Ki-0nOy; Tue, 23 Apr 2024 15:46:50 +0200 From: Johan Hovold To: Jiri Kosina , Benjamin Tissoires Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Douglas Anderson , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 2/6] dt-bindings: HID: i2c-hid: elan: add Elan eKTH5015M Date: Tue, 23 Apr 2024 15:46:07 +0200 Message-ID: <20240423134611.31979-3-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240423134611.31979-1-johan+linaro@kernel.org> References: <20240423134611.31979-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add a compatible string for the Elan eKTH5015M touch controller. Judging from the current binding and commit bd3cba00dcc6 ("HID: i2c-hid: elan: Add support for Elan eKTH6915 i2c-hid touchscreens"), eKTH5015M appears to be compatible with eKTH6915. Notably the power-on sequence is the same. While at it, drop a redundant label from the example. Signed-off-by: Johan Hovold --- .../devicetree/bindings/input/elan,ekth6915.yaml | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml index 3e2d216c6432..c3a6f901ff45 100644 --- a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml +++ b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml @@ -18,8 +18,13 @@ allOf: properties: compatible: - items: - - const: elan,ekth6915 + oneOf: + - items: + - enum: + - elan,ekth5015m + - const: elan,ekth6915 + - items: + - const: elan,ekth6915 reg: const: 0x10 @@ -57,8 +62,8 @@ examples: #address-cells = <1>; #size-cells = <0>; - ap_ts: touchscreen@10 { - compatible = "elan,ekth6915"; + touchscreen@10 { + compatible = "elan,ekth5015m", "elan,ekth6915"; reg = <0x10>; interrupt-parent = <&tlmm>; From patchwork Tue Apr 23 13:46:08 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 791336 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.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 77F49135A78; Tue, 23 Apr 2024 13:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; cv=none; b=NFBrKYyWCBPyg6Bl5tOFRItt+nAckE2eiguCsLFlEwqDhCI5WEsEOz/zznCAGdiBXrh6OidcdxnACj3xQ4murn8tJemiyEBbK/UFcFzool4X/wi11Zxqvoz5uVXqN2JLiH16moVTnEVaFC1c0xUTvPf5rPFEeEhAayClclZrkfs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; c=relaxed/simple; bh=tCfBMb3DOalmVHX+fKphZQx4T+5g7FInpPlj/Ww+I/8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RtXGrK9QpbgRuAiH3NzfjDrrCc1bxN/aH8ejj7V+U/FIvVTrbp1h2DWeqnkTDHsKPy75793bAq81Bt45YnQp3jWNFb0x901AkhlQDCo7QapYgNtHwE4CKLwSntw3cQOdKxOehLovSZ8omZrV4XAPBdqHkvuqbByNdNuqjZnYxH8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=MNpvskNG; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="MNpvskNG" Received: by smtp.kernel.org (Postfix) with ESMTPSA id F217FC116B1; Tue, 23 Apr 2024 13:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713880012; bh=tCfBMb3DOalmVHX+fKphZQx4T+5g7FInpPlj/Ww+I/8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MNpvskNGtKjrw85/aCr/RXmboU6e8AvOWeXGUwV329/8YZkgIBU4eKVxMeh9Zboce YuVM4p5AXMykfl+7pzVHREMd6UIa2KkFHqxqy5Yojna4/pfNVlvCReRH0bwcmthPNi eMOnWsKUf+ZtukOShJwCv7qO4qhyljeKcP94opVmYCOQwQ84DD8uZvS/362NEUwY7/ 9jtNu51nqI0ABNE6HtYqhDN7A2Da1vi6Q0Ns3zBWsuVtsopB7uqT/TINBDdSmI2qu5 EEc8GaBSINdd9lsfXj/v27uFA/1NIgjC5+/SJWXrLkVi0v4r+i+6v43019QRE+DDC+ a80J+KdSGwT8w== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rzGTy-000000008Kk-1836; Tue, 23 Apr 2024 15:46:50 +0200 From: Johan Hovold To: Jiri Kosina , Benjamin Tissoires Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Douglas Anderson , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 3/6] dt-bindings: HID: i2c-hid: elan: add 'no-reset-on-power-off' property Date: Tue, 23 Apr 2024 15:46:08 +0200 Message-ID: <20240423134611.31979-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240423134611.31979-1-johan+linaro@kernel.org> References: <20240423134611.31979-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 When the power supply is shared with other peripherals the reset line can be wired in such a way that it can remain deasserted regardless of whether the supply is on or not. This is important as it can be used to avoid holding the controller in reset for extended periods of time when it remains powered, something which can lead to increased power consumption. Leaving reset deasserted also avoids leaking current through the reset circuitry pull-up resistors. Add a new 'no-reset-on-power-off' devicetree property which can be used by the OS to determine when reset needs to be asserted on power down. Note that this property can also be used when the supply cannot be turned off by the OS at all. Signed-off-by: Johan Hovold --- Documentation/devicetree/bindings/input/elan,ekth6915.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml index c3a6f901ff45..3d20673f10b2 100644 --- a/Documentation/devicetree/bindings/input/elan,ekth6915.yaml +++ b/Documentation/devicetree/bindings/input/elan,ekth6915.yaml @@ -37,6 +37,12 @@ properties: reset-gpios: description: Reset GPIO; not all touchscreens using eKTH6915 hook this up. + no-reset-on-power-off: + type: boolean + description: + Reset line is wired so that it can be left deasserted when the power + supply is off. + vcc33-supply: description: The 3.3V supply to the touchscreen. From patchwork Tue Apr 23 13:46:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 791690 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.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 77F081350E3; Tue, 23 Apr 2024 13:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; cv=none; b=gjqEfhzPfhcsIoswOTzdvrnQekAkgiSnkH+EbE+yNyUyw4JctdqNs/nZyn8d0xgmKvYgFLLiab2K04I9xyNLrsS+OZLmvMGdWXoxbY4HyUoVMbxjStBTxtyVLqFU4ytt8EHEtQ4E86h2bi+b0ILTBxA5ESBpbKBsNqeS3JC5TcY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; c=relaxed/simple; bh=pcEsfnawp+PoMGDaKV0gMQ+xLb4cPIiASt03YhZ7TRE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Dw2mriE531PAEuRXF2ZuWwyz5nk/qmzX5K+d5hQxX92+iFjDJR73pboXAT9MZ467kx0fk1NOqk1lUT9pN2ObRNjeBMPiAPADyxHTMfweu+luiBoDNnmxpjt6vrwLdGgbvC438RQ1ApSGdpfftuQAphlUGsLIkjEt5VNJZgDPMMY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KNanTu9i; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KNanTu9i" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 09F93C32783; Tue, 23 Apr 2024 13:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713880012; bh=pcEsfnawp+PoMGDaKV0gMQ+xLb4cPIiASt03YhZ7TRE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KNanTu9ihAD9kpVS7rVPwGmda32PPpxbYwPDCvrSYnGBYqlKnJ+/p8sbuFE2cgfT2 JsWHebg1pmYi5GxnnXbyiV1EIzoTjvg7hDX/PTqWncjC/gUgfjkLS0RWBdpnt7E5v6 IdXsb4XJ6Xg6vdAvayk786j9NUuX3VTJ/e5gvzp1yMIdALY16oTOZ3Fh/I5urQO1lw AVDWl/37y4dvraAJJrJGxrWcqbdx3ALage51cyO7IdzXDmj7gP3g52j8jb8/WKMNu6 jI+bCy4s0p9yRNjFi7OWQq5+bQaCHmFnf78Q3p54LkKT8b63VHB39EQXwQc0nAOmRd zjn8tSfWx8v1A== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rzGTy-000000008Km-1SYI; Tue, 23 Apr 2024 15:46:50 +0200 From: Johan Hovold To: Jiri Kosina , Benjamin Tissoires Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Douglas Anderson , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 4/6] HID: i2c-hid: elan: fix reset suspend current leakage Date: Tue, 23 Apr 2024 15:46:09 +0200 Message-ID: <20240423134611.31979-5-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240423134611.31979-1-johan+linaro@kernel.org> References: <20240423134611.31979-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The Elan eKTH5015M touch controller found on the Lenovo ThinkPad X13s shares the VCC33 supply with other peripherals that may remain powered during suspend (e.g. when enabled as wakeup sources). The reset line is also wired so that it can be left deasserted when the supply is off. This is important as it avoids holding the controller in reset for extended periods of time when it remains powered, which can lead to increased power consumption, and also avoids leaking current through the X13s reset circuitry during suspend (and after driver unbind). Use the new 'no-reset-on-power-off' devicetree property to determine when reset needs to be asserted on power down. Notably this also avoids wasting power on machine variants without a touchscreen for which the driver would otherwise exit probe with reset asserted. Fixes: bd3cba00dcc6 ("HID: i2c-hid: elan: Add support for Elan eKTH6915 i2c-hid touchscreens") Cc: stable@vger.kernel.org # 6.0 Cc: Douglas Anderson Signed-off-by: Johan Hovold --- drivers/hid/i2c-hid/i2c-hid-of-elan.c | 37 ++++++++++++++++++++------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/drivers/hid/i2c-hid/i2c-hid-of-elan.c b/drivers/hid/i2c-hid/i2c-hid-of-elan.c index 5b91fb106cfc..8a905027d5e9 100644 --- a/drivers/hid/i2c-hid/i2c-hid-of-elan.c +++ b/drivers/hid/i2c-hid/i2c-hid-of-elan.c @@ -31,6 +31,7 @@ struct i2c_hid_of_elan { struct regulator *vcc33; struct regulator *vccio; struct gpio_desc *reset_gpio; + bool no_reset_on_power_off; const struct elan_i2c_hid_chip_data *chip_data; }; @@ -40,17 +41,17 @@ static int elan_i2c_hid_power_up(struct i2chid_ops *ops) container_of(ops, struct i2c_hid_of_elan, ops); int ret; + gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1); + if (ihid_elan->vcc33) { ret = regulator_enable(ihid_elan->vcc33); if (ret) - return ret; + goto err_deassert_reset; } ret = regulator_enable(ihid_elan->vccio); - if (ret) { - regulator_disable(ihid_elan->vcc33); - return ret; - } + if (ret) + goto err_disable_vcc33; if (ihid_elan->chip_data->post_power_delay_ms) msleep(ihid_elan->chip_data->post_power_delay_ms); @@ -60,6 +61,15 @@ static int elan_i2c_hid_power_up(struct i2chid_ops *ops) msleep(ihid_elan->chip_data->post_gpio_reset_on_delay_ms); return 0; + +err_disable_vcc33: + if (ihid_elan->vcc33) + regulator_disable(ihid_elan->vcc33); +err_deassert_reset: + if (ihid_elan->no_reset_on_power_off) + gpiod_set_value_cansleep(ihid_elan->reset_gpio, 0); + + return ret; } static void elan_i2c_hid_power_down(struct i2chid_ops *ops) @@ -67,7 +77,14 @@ static void elan_i2c_hid_power_down(struct i2chid_ops *ops) struct i2c_hid_of_elan *ihid_elan = container_of(ops, struct i2c_hid_of_elan, ops); - gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1); + /* + * Do not assert reset when the hardware allows for it to remain + * deasserted regardless of the state of the (shared) power supply to + * avoid wasting power when the supply is left on. + */ + if (!ihid_elan->no_reset_on_power_off) + gpiod_set_value_cansleep(ihid_elan->reset_gpio, 1); + if (ihid_elan->chip_data->post_gpio_reset_off_delay_ms) msleep(ihid_elan->chip_data->post_gpio_reset_off_delay_ms); @@ -87,12 +104,14 @@ static int i2c_hid_of_elan_probe(struct i2c_client *client) ihid_elan->ops.power_up = elan_i2c_hid_power_up; ihid_elan->ops.power_down = elan_i2c_hid_power_down; - /* Start out with reset asserted */ - ihid_elan->reset_gpio = - devm_gpiod_get_optional(&client->dev, "reset", GPIOD_OUT_HIGH); + ihid_elan->reset_gpio = devm_gpiod_get_optional(&client->dev, "reset", + GPIOD_ASIS); if (IS_ERR(ihid_elan->reset_gpio)) return PTR_ERR(ihid_elan->reset_gpio); + ihid_elan->no_reset_on_power_off = of_property_read_bool(client->dev.of_node, + "no-reset-on-power-off"); + ihid_elan->vccio = devm_regulator_get(&client->dev, "vccio"); if (IS_ERR(ihid_elan->vccio)) return PTR_ERR(ihid_elan->vccio); From patchwork Tue Apr 23 13:46:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 791334 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.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 77F9213667A; Tue, 23 Apr 2024 13:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; cv=none; b=hU87AspLKP8PZFEVEFfwsqU3F8kuP72j4fQQI1jgwMvBLVe8jPrLpMjc7NeRcl3wMetPpGhgphMQ7l9p6lzGOHVbQoCx8wNHgjVxDYCNL2e3NU+uEPFd3okXDMUkPM6kyW/JQSB1v9Tohu5pOLVSvBkzFcu/4a8RzH6VNf/IUTs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; c=relaxed/simple; bh=FHGWR5/JvEtSCzN6BsDdKdt7AWKO+kzD4nDxcEDqLvU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=J++itqmysfPFJ71QZ4YX4prt2VbhZ+m+oPIRP9pEdCo+Abk/+mvcUjtHTYj6N0qdr8UzEKdAmQ38dbTZtY/66YgOy6nTqx8jmknHTUmz/Uv3sQqGUwNN9Rx3hbO9n6c5yOwdwMMbnckPU0XL7PRwjbHYBD4rG8E4ejpXpDkU0xE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=TcOuIMN0; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="TcOuIMN0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0040EC2BD11; Tue, 23 Apr 2024 13:46:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713880012; bh=FHGWR5/JvEtSCzN6BsDdKdt7AWKO+kzD4nDxcEDqLvU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=TcOuIMN0CqoaXi3/V2LwYASFmAqpQusYdaqjCht1rNbKaKdoHyb/xtCP2qxs6KdGf drEZWKY9InbjAkL09UA4vLBeSATWd4re35fpgpe8mWH5bsfO9E5VQ/J2GF7fmmmZAU poRg18vFbjCf1GZaMq5uFpuNzbXTzjsLyBWlkbtuHgZx2EokmSfrAbBokFakDR8ZOt K41RktY3rTo1IoMB+BrEmmtehXkz9JJcWDZAokledObRM9eB5osZzNvN9NO2rEDe05 2CIn0EAfyckVoXedQCAcz5cOKkpoIl6S2i5DYa6NGLMfJIE/SyQGnkXhXkCQ6/sSRa Tm169E7DhEQew== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rzGTy-000000008Ko-1mxx; Tue, 23 Apr 2024 15:46:50 +0200 From: Johan Hovold To: Jiri Kosina , Benjamin Tissoires Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Douglas Anderson , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 5/6] arm64: dts: qcom: sc8280xp-x13s: fix touchscreen power on Date: Tue, 23 Apr 2024 15:46:10 +0200 Message-ID: <20240423134611.31979-6-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240423134611.31979-1-johan+linaro@kernel.org> References: <20240423134611.31979-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The Elan eKTH5015M touch controller on the X13s requires a 300 ms delay before sending commands after having deasserted reset during power on. Switch to the Elan specific binding so that the OS can determine the required power-on sequence and make sure that the controller is always detected during boot. Note that the always-on 1.8 V supply (s10b) is not used by the controller directly and should not be described. Fixes: 32c231385ed4 ("arm64: dts: qcom: sc8280xp: add Lenovo Thinkpad X13s devicetree") Cc: stable@vger.kernel.org # 6.0 Signed-off-by: Johan Hovold --- .../dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts index b220ba4fba23..e27c8a21125c 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-lenovo-thinkpad-x13s.dts @@ -674,15 +674,16 @@ &i2c4 { status = "okay"; - /* FIXME: verify */ touchscreen@10 { - compatible = "hid-over-i2c"; + compatible = "elan,ekth5015m", "elan,ekth6915"; reg = <0x10>; - hid-descr-addr = <0x1>; interrupts-extended = <&tlmm 175 IRQ_TYPE_LEVEL_LOW>; - vdd-supply = <&vreg_misc_3p3>; - vddl-supply = <&vreg_s10b>; + reset-gpios = <&tlmm 99 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>; + no-reset-on-power-off; + + vcc33-supply = <&vreg_misc_3p3>; + vccio-supply = <&vreg_misc_3p3>; pinctrl-names = "default"; pinctrl-0 = <&ts0_default>; @@ -1637,8 +1638,8 @@ int-n-pins { reset-n-pins { pins = "gpio99"; function = "gpio"; - output-high; - drive-strength = <16>; + drive-strength = <2>; + bias-disable; }; }; From patchwork Tue Apr 23 13:46:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 791689 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.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 AA6271369A8; Tue, 23 Apr 2024 13:46:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; cv=none; b=A/U8kVQSxtpeBgX52MoYlH++2TxZYx5rVek4cuTG7EqbFdm18wjpomAdOf9tA4gSVKprX07MbtRNu1alnqg0+M7kkw2bg2qGx8daH7ibbdXtx0I8ZI4Bm9d4JKzxkcqZ+fOwUTOkLMFB23qISNYBnbAJYRkfJOkdH68bJoGs5+s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713880012; c=relaxed/simple; bh=57AUgmWZZPSkewtMIOcTfHR1ByUp86J3e5693409NdY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RbnUsS+mJ6taSBp5lz4MO4gj7YYheGm2pUe9o3xUk6hRDWCpZM/m1kembLSmz4keQB52DYuzZ6iQBKhAnO1vECWucPwOCY7trUPVVfn/4FN4XNMvW+wLK+0Ua96FMpaLuEIbqQqozYrRAv6wy+bFp/H0Gy2/iraQT/CEQkJqqkU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Xi4eqHs8; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Xi4eqHs8" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 47F18C4AF60; Tue, 23 Apr 2024 13:46:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713880012; bh=57AUgmWZZPSkewtMIOcTfHR1ByUp86J3e5693409NdY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Xi4eqHs8aOghaj81YHDiBaS+QrS5jlIF07O6y608L33yNXVu7DiSv3CSFoXfTWQAj 9zle0Ennl+k1ZQqAQtaAyhGtDisY2FmTRAzqr/GUo8CV9+xkt4uGECyBz45FfNAZi2 7QYr403cUxxkH6uBS62uAeLuphDtkEcLuVPR+r/xJ4L4TOKG89VSKu1+mKrzwC/ZK5 jUTOs6xf8Z6O+F3XyVtZ4WQW9xJEt58GSEn23kkEWYKYtNzQj9tPIFwTbHyOKztvN4 z5wdXV0W43XA4tvBuXkRkvW1DRD6awovTsixcs07c+TL83dAcatmZJJmLV8PGWuHpq jqrhYXAk5cnTA== Received: from johan by xi.lan with local (Exim 4.97.1) (envelope-from ) id 1rzGTy-000000008Kq-27Dq; Tue, 23 Apr 2024 15:46:50 +0200 From: Johan Hovold To: Jiri Kosina , Benjamin Tissoires Cc: Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Linus Walleij , Douglas Anderson , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 6/6] arm64: dts: qcom: sc8280xp-crd: use external pull up for touch reset Date: Tue, 23 Apr 2024 15:46:11 +0200 Message-ID: <20240423134611.31979-7-johan+linaro@kernel.org> X-Mailer: git-send-email 2.43.2 In-Reply-To: <20240423134611.31979-1-johan+linaro@kernel.org> References: <20240423134611.31979-1-johan+linaro@kernel.org> Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The touch controller reset line is currently not described by the devicetree except in the pin configuration which is used to deassert reset. As the reset line has an external pull up to an always-on rail there is no need to drive the pin high so just leave it configured as an input and disable the internal pull down. Signed-off-by: Johan Hovold --- arch/arm64/boot/dts/qcom/sc8280xp-crd.dts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts index 08b3627049bc..68e70c983c94 100644 --- a/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts +++ b/arch/arm64/boot/dts/qcom/sc8280xp-crd.dts @@ -1014,8 +1014,7 @@ int-n-pins { reset-n-pins { pins = "gpio99"; function = "gpio"; - output-high; - drive-strength = <16>; + bias-disable; }; };