devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno  <angelogioacchino.delregno@collabora.com>
To: robh+dt@kernel.org
Cc: krzysztof.kozlowski+dt@linaro.org, matthias.bgg@gmail.com,
	angelogioacchino.delregno@collabora.com, hsinyi@chromium.org,
	nfraprado@collabora.com, allen-kh.cheng@mediatek.com,
	gtk3@inbox.ru, luca@z3ntu.xyz, sam.shih@mediatek.com,
	sean.wang@mediatek.com, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-mediatek@lists.infradead.org, wenst@chromium.org
Subject: [PATCH 11/11] arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4
Date: Thu, 30 Jun 2022 17:33:16 +0200	[thread overview]
Message-ID: <20220630153316.308767-12-angelogioacchino.delregno@collabora.com> (raw)
In-Reply-To: <20220630153316.308767-1-angelogioacchino.delregno@collabora.com>

This platform carries a HID compatible I2C touchscreen on the i2c4 bus,
but it may either be at 0x10, or at 0x15, depending on the board model:
declare both as disabled in the common Cherry device-tree and enable
the required touchscreen node on a per-board basis.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
---
 .../dts/mediatek/mt8195-cherry-tomato-r1.dts  |  4 ++
 .../dts/mediatek/mt8195-cherry-tomato-r2.dts  |  4 ++
 .../dts/mediatek/mt8195-cherry-tomato-r3.dts  |  4 ++
 .../boot/dts/mediatek/mt8195-cherry.dtsi      | 41 +++++++++++++++++++
 4 files changed, 53 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
index 17e9e4d6f6ab..2837fb24c84c 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r1.dts
@@ -9,3 +9,7 @@ / {
 	model = "MediaTek Tomato (rev1) board";
 	compatible = "google,tomato-rev1", "google,tomato", "mediatek,mt8195";
 };
+
+&ts_10 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
index ee5fd07ad573..4e1d1a1887c7 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r2.dts
@@ -29,3 +29,7 @@ pins-low-power-pcie0-disable {
 		bias-pull-down;
 	};
 };
+
+&ts_10 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
index 792f6c83e88b..4a45884203ea 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry-tomato-r3.dts
@@ -30,3 +30,7 @@ pins-low-power-pcie0-disable {
 		bias-pull-down;
 	};
 };
+
+&ts_10 {
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
index 2687c6d40ac1..7a32c7006a5a 100644
--- a/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt8195-cherry.dtsi
@@ -143,6 +143,31 @@ &i2c4 {
 	clock-frequency = <400000>;
 	pinctrl-names = "default";
 	pinctrl-0 = <&i2c4_pin>;
+
+	/* Depending on the machine, the TS may be at 0x10 or at 0x15 */
+	ts_10: touchscreen@10 {
+		compatible = "hid-over-i2c";
+		reg = <0x10>;
+		hid-descr-addr = <0x0001>;
+		interrupts-extended = <&pio 92 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&touchscreen_pins>;
+		post-power-on-delay-ms = <10>;
+		vdd-supply = <&pp3300_s3>;
+		status = "disabled";
+	};
+
+	ts_15: touchscreen@15 {
+		compatible = "hid-over-i2c";
+		reg = <0x15>;
+		hid-descr-addr = <0x0001>;
+		interrupts-extended = <&pio 92 IRQ_TYPE_LEVEL_LOW>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&touchscreen_pins>;
+		post-power-on-delay-ms = <10>;
+		vdd-supply = <&pp3300_s3>;
+		status = "disabled";
+	};
 };
 
 &i2c5 {
@@ -609,6 +634,22 @@ subpmic_pin_irq: pins-subpmic-int-n {
 			bias-pull-up;
 		};
 	};
+
+	touchscreen_pins: touchscreen-default-pins {
+		pins-int-n {
+			pinmux = <PINMUX_GPIO92__FUNC_GPIO92>;
+			input-enable;
+			bias-pull-up = <MTK_PUPD_SET_R1R0_01>;
+		};
+		pins-rst {
+			pinmux = <PINMUX_GPIO56__FUNC_GPIO56>;
+			output-high;
+		};
+		pins-report-sw {
+			pinmux = <PINMUX_GPIO57__FUNC_GPIO57>;
+			output-low;
+		};
+	};
 };
 
 &pmic {
-- 
2.35.1


  parent reply	other threads:[~2022-06-30 15:34 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-30 15:33 [PATCH 00/11] MT8195 Chromebooks devicetrees - Google Tomato AngeloGioacchino Del Regno
2022-06-30 15:33 ` [PATCH 01/11] dt-bindings: arm: mediatek: Add MT8195 Cherry Tomato Chromebooks AngeloGioacchino Del Regno
2022-06-30 18:26   ` Krzysztof Kozlowski
2022-07-01 15:31   ` Nícolas F. R. A. Prado
2022-07-04  8:51     ` AngeloGioacchino Del Regno
2022-07-01 22:04   ` Nícolas F. R. A. Prado
2022-07-04  8:56     ` AngeloGioacchino Del Regno
2022-06-30 15:33 ` [PATCH 02/11] arm64: dts: mediatek: Introduce MT8195 Cherry platform's Tomato AngeloGioacchino Del Regno
2022-07-01 22:11   ` Nícolas F. R. A. Prado
2022-07-04  4:17     ` Chen-Yu Tsai
2022-07-04  8:59       ` AngeloGioacchino Del Regno
2022-07-04  9:05         ` Chen-Yu Tsai
2022-07-04  9:06           ` AngeloGioacchino Del Regno
2022-06-30 15:33 ` [PATCH 03/11] arm64: dts: mediatek: cherry: Assign interrupt line to MT6359 PMIC AngeloGioacchino Del Regno
2022-07-01 22:20   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 04/11] arm64: dts: mediatek: cherry: Add platform regulators layout and config AngeloGioacchino Del Regno
2022-07-01 22:26   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 05/11] arm64: dts: mediatek: cherry: Add support for internal eMMC storage AngeloGioacchino Del Regno
2022-07-01 22:36   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 06/11] arm64: dts: mediatek: cherry: Document gpios and add default pin config AngeloGioacchino Del Regno
2022-07-01 22:39   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 07/11] arm64: dts: mediatek: cherry: Enable I2C and SPI controllers AngeloGioacchino Del Regno
2022-07-01 22:42   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 08/11] arm64: dts: mediatek: cherry: Enable T-PHYs and USB XHCI controllers AngeloGioacchino Del Regno
2022-07-01 22:43   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 09/11] arm64: dts: mediatek: cherry: Enable MT6360 sub-pmic on I2C7 AngeloGioacchino Del Regno
2022-07-01 22:45   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` [PATCH 10/11] arm64: dts: mediatek: cherry: Enable support for the SPI NOR flash AngeloGioacchino Del Regno
2022-07-01 22:47   ` Nícolas F. R. A. Prado
2022-06-30 15:33 ` AngeloGioacchino Del Regno [this message]
2022-07-01 22:49   ` [PATCH 11/11] arm64: dts: mediatek: cherry: Add I2C-HID touchscreen on I2C4 Nícolas F. R. A. Prado

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220630153316.308767-12-angelogioacchino.delregno@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=allen-kh.cheng@mediatek.com \
    --cc=devicetree@vger.kernel.org \
    --cc=gtk3@inbox.ru \
    --cc=hsinyi@chromium.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=luca@z3ntu.xyz \
    --cc=matthias.bgg@gmail.com \
    --cc=nfraprado@collabora.com \
    --cc=robh+dt@kernel.org \
    --cc=sam.shih@mediatek.com \
    --cc=sean.wang@mediatek.com \
    --cc=wenst@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).