Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp711970iog; Thu, 30 Jun 2022 08:45:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sgExhvlFA3bWm8EjuYD88h13CdBgW5ASf86kt51Rnx6yyGeIRY6yNJzrWlp8HzmxHG3ke5 X-Received: by 2002:a17:90b:3887:b0:1ec:e6a1:b965 with SMTP id mu7-20020a17090b388700b001ece6a1b965mr10919441pjb.162.1656603913703; Thu, 30 Jun 2022 08:45:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656603913; cv=none; d=google.com; s=arc-20160816; b=L40R+MI/3b0b1esx7wPzCkUJVBAFcBnsGesXUrE0RTw1f5VXqGnqP37WQ9z1gcL002 w4Z7e/0sPLfSIDEV8v7qqezBweGQSGwVqwAh8CfkBJYGW/Ybis5rAvV+qhEm1+7ilphO 4c7LPwUrKN7lfR9ufl3YrtyRhg2W1EEKDSuxhMTm6o49NkgYRMSZQxMxyjNViRXuYVeD /c3duPqimAmz62s9zUFcztxCeEoZDjwCvmusJYuCdq+nQ8kMCfLHYrcMahi2TF72sw+e 3yjaWFlpaLTz9XPdvoNZM59f8/x2oxGN8fxuTf2tfvfh6joT8d/Q812hS7+m3uThHjFu /r/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=WTyVByW4G/VecPm2TF+qOEzpB27+vuJjp8UrdLQIO30=; b=MscGjW2FHcwgX23mTlao88AahsKCXX9izWfHBkVjmTi5pHxWxt2QyaZdOpbRQaVb+p DTJmpshfIobndwSeha4/IjOts2jgwCf70IrAAWOW+zN+DNWbkeWwOn4RX1rboIf6Wggh PeYjcqDGDyCQHYVqWtK7N0wGH106NfFk+ZlgjFHjHc4biiRzG4VrsFgP2dzCY13enrd4 OXD2geWuGOlL2Z3v3wSy5gH/cbbEDgfuQmHrOOqrulK/w1rH2almXIg36uN4UlXVXhDr gzo8LEGpuDuSJkTaDQt4rFKxasYuxVDkTB3DsExY8fgHWZ8T2V3NiYYAaTz5qbWQQv2w k7Kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BuaUnODh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x10-20020a63170a000000b0040c25d6612fsi3724238pgl.335.2022.06.30.08.44.56; Thu, 30 Jun 2022 08:45:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BuaUnODh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236194AbiF3PeQ (ORCPT + 99 others); Thu, 30 Jun 2022 11:34:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235203AbiF3Pdg (ORCPT ); Thu, 30 Jun 2022 11:33:36 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2125041618; Thu, 30 Jun 2022 08:33:35 -0700 (PDT) Received: from IcarusMOD.eternityproject.eu (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id 41477660197D; Thu, 30 Jun 2022 16:33:33 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1656603214; bh=SX4P7RsJewzaMEBrvT46jeE3YycPiAePm3ZFNcwi5O0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BuaUnODh1qw4OyIyA6rE3Sii52gGiK6JGI0LeZCFG/rtoiXjA51r6pC8Up3sWiBR/ hxrwfQU4NsW7YyHFG/G+CZTkyPQvNwNiOBZeVJwGepNSWxEYENoeUry8zMj9hOJZOb QnrRqlXecmw7k+Z4Vn7rYgqe1v1eOuZ5kDrhhnMqnZyh/5OoLsSOmi9pHyqc1RCD+4 myxssKckdPykteL25QLzc6Ggz97Ik6Yij1bFMdJxaeZfF2wM4AH88/I8wKsByx2zvN 9BDzKjrRG3Lz0IUdXdY0Hl5PQzYlhzqa6ECWfLqam39/vR/qmhUXoyzNzbr0LhadNq 485JB2fL0wSdA== From: AngeloGioacchino Del Regno 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 Message-Id: <20220630153316.308767-12-angelogioacchino.delregno@collabora.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220630153316.308767-1-angelogioacchino.delregno@collabora.com> References: <20220630153316.308767-1-angelogioacchino.delregno@collabora.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- .../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 = ; + input-enable; + bias-pull-up = ; + }; + pins-rst { + pinmux = ; + output-high; + }; + pins-report-sw { + pinmux = ; + output-low; + }; + }; }; &pmic { -- 2.35.1