Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp4102146pxb; Fri, 11 Feb 2022 15:40:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGgMIPOfTXw7RYg+97p39iFb7MC0Okb05hufBPvUVU+g9abMw+jhX338wc/GSqcoxl9HLX X-Received: by 2002:a17:907:c26:: with SMTP id ga38mr3183702ejc.626.1644622845527; Fri, 11 Feb 2022 15:40:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644622845; cv=none; d=google.com; s=arc-20160816; b=NzzNMZl7igoB6dJbq254XV7jStSRpJ/7xTFFZ5n60yosMsp2hS+ueZwas2//nXP86a D+1CF6xj3kiykyRJrZ2fhfTOH3YD+kyMKKKjnwmwJfY2AOu+K7javWgxHlUCCNOd0x+J L2goLNI2PojfBF7GI4IJkwtwRAXzCG78fwKVYjVIs3hsN+sIi8Rj6gPYzXglkz0rSwly ag7cSyphsiYanL18L2Pqmb2nbucybR9LJzUC1boxGtcmYNkkGyq1yY6VlRqWlq9jqZZ7 KdXsSYA0IdosZuKWFc8HxRO4l3Ct3uyyn70pFBAv1dhq66712SJpDgRCq4LZKB801S/k 4zxQ== 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; bh=AQe2V4M/7zuoyRdGfD9ExKXHGRV7Bw5wOgnRsBQ+BNk=; b=suFJjwbEBei9t9JBgnDn5YbX5LPMF1xgyaSXVUA68bjHWs0tBtkGuiNIVqSxyBiMV5 +XTk3blzvn/MLjYleRIIVM/Ejh6t3ZZxY9QxLNzjreQ9dGuHU1uNkuG/JV09KGAGxSAe UXEYSkkoEa0UKT+ur0I/u2XeVUF4MNSK4zWqoN1XPg5vH+SKrfyPkFUhLZ3JiccSWGl8 acDR0/oRznxkEyS0JNHoL/LEnqouUuYZXt/3/uytTZw9kYi+5EYaRCR0w6OOclnGjaQd i968EiKsVKBHxyTIc2YM8Ep7pLX57GKwG0y4gGVQGMZ9Qf9HVKR3fNpzd8+sPKgZLquA sa+w== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 11si10765109eje.845.2022.02.11.15.40.21; Fri, 11 Feb 2022 15:40:45 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243816AbiBKNbb (ORCPT + 99 others); Fri, 11 Feb 2022 08:31:31 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:54618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350574AbiBKNbY (ORCPT ); Fri, 11 Feb 2022 08:31:24 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65F8021A for ; Fri, 11 Feb 2022 05:31:23 -0800 (PST) Received: from dude.hi.pengutronix.de ([2001:67c:670:100:1d::7]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nIW0V-0005x1-Ie; Fri, 11 Feb 2022 14:30:39 +0100 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nIW0T-009jug-9l; Fri, 11 Feb 2022 14:30:37 +0100 From: Oleksij Rempel To: Mark Rutland , Rob Herring , Sascha Hauer , Shawn Guo , Thierry Reding , Sam Ravnborg , David Airlie , Daniel Vetter Cc: Oleksij Rempel , devicetree@vger.kernel.org, Fabio Estevam , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, NXP Linux Team , Pengutronix Kernel Team , David Jander , Robin van der Gracht , dri-devel@lists.freedesktop.org Subject: [PATCH v3 4/5] ARM: dts: imx6dl: plym2m, prtvt7, victgo: make use of new resistive-adc-touch driver Date: Fri, 11 Feb 2022 14:30:34 +0100 Message-Id: <20220211133035.2321330-5-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220211133035.2321330-1-o.rempel@pengutronix.de> References: <20220211133035.2321330-1-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::7 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 The tsc2046 is an ADC used as touchscreen controller. To share as mach code as possible, we should use it as actual ADC + virtual touchscreen controller. With this patch we make use of the new kernel IIO and HID infrastructure. Signed-off-by: Oleksij Rempel --- arch/arm/boot/dts/imx6dl-plym2m.dts | 59 +++++++++++++++++++++-------- arch/arm/boot/dts/imx6dl-prtvt7.dts | 57 +++++++++++++++++++++------- arch/arm/boot/dts/imx6dl-victgo.dts | 59 ++++++++++++++++++++++------- 3 files changed, 132 insertions(+), 43 deletions(-) diff --git a/arch/arm/boot/dts/imx6dl-plym2m.dts b/arch/arm/boot/dts/imx6dl-plym2m.dts index 60fe5f14666e..73c7622bfe0f 100644 --- a/arch/arm/boot/dts/imx6dl-plym2m.dts +++ b/arch/arm/boot/dts/imx6dl-plym2m.dts @@ -101,6 +101,18 @@ reg_12v0: regulator-12v0 { regulator-min-microvolt = <12000000>; regulator-max-microvolt = <12000000>; }; + + touchscreen { + compatible = "resistive-adc-touch"; + io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>, + <&adc_ts 5>; + io-channel-names = "y", "z1", "z2", "x"; + touchscreen-min-pressure = <64687>; + touchscreen-inverted-x; + touchscreen-inverted-y; + touchscreen-x-plate-ohms = <300>; + touchscreen-y-plate-ohms = <800>; + }; }; &can1 { @@ -129,26 +141,41 @@ &ecspi2 { pinctrl-0 = <&pinctrl_ecspi2>; status = "okay"; - touchscreen@0 { - compatible = "ti,tsc2046"; + adc_ts: adc@0 { + compatible = "ti,tsc2046e-adc"; reg = <0>; pinctrl-0 = <&pinctrl_tsc2046>; pinctrl-names ="default"; - spi-max-frequency = <100000>; - interrupts-extended = <&gpio3 20 IRQ_TYPE_EDGE_FALLING>; - pendown-gpio = <&gpio3 20 GPIO_ACTIVE_LOW>; + spi-max-frequency = <1000000>; + interrupts-extended = <&gpio3 20 IRQ_TYPE_LEVEL_LOW>; + #io-channel-cells = <1>; - touchscreen-inverted-x; - touchscreen-inverted-y; - touchscreen-max-pressure = <4095>; - - ti,vref-delay-usecs = /bits/ 16 <100>; - ti,x-plate-ohms = /bits/ 16 <800>; - ti,y-plate-ohms = /bits/ 16 <300>; - ti,debounce-max = /bits/ 16 <3>; - ti,debounce-tol = /bits/ 16 <70>; - ti,debounce-rep = /bits/ 16 <3>; - wakeup-source; + #address-cells = <1>; + #size-cells = <0>; + + channel@1 { + reg = <1>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@3 { + reg = <3>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@4 { + reg = <4>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@5 { + reg = <5>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; }; }; diff --git a/arch/arm/boot/dts/imx6dl-prtvt7.dts b/arch/arm/boot/dts/imx6dl-prtvt7.dts index baaa6ffc4df9..59e0674420a1 100644 --- a/arch/arm/boot/dts/imx6dl-prtvt7.dts +++ b/arch/arm/boot/dts/imx6dl-prtvt7.dts @@ -235,6 +235,18 @@ simple-audio-card,codec { frame-master; }; }; + + touchscreen { + compatible = "resistive-adc-touch"; + io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>, + <&adc_ts 5>; + io-channel-names = "y", "z1", "z2", "x"; + touchscreen-min-pressure = <64687>; + touchscreen-inverted-x; + touchscreen-inverted-y; + touchscreen-x-plate-ohms = <300>; + touchscreen-y-plate-ohms = <800>; + }; }; &audmux { @@ -277,22 +289,41 @@ &ecspi2 { pinctrl-0 = <&pinctrl_ecspi2>; status = "okay"; - touchscreen@0 { - compatible = "ti,tsc2046"; + adc_ts: adc@0 { + compatible = "ti,tsc2046e-adc"; reg = <0>; pinctrl-0 = <&pinctrl_tsc>; pinctrl-names ="default"; - spi-max-frequency = <100000>; - interrupts-extended = <&gpio3 20 IRQ_TYPE_EDGE_FALLING>; - pendown-gpio = <&gpio3 20 GPIO_ACTIVE_LOW>; - touchscreen-max-pressure = <4095>; - ti,vref-delay-usecs = /bits/ 16 <100>; - ti,x-plate-ohms = /bits/ 16 <800>; - ti,y-plate-ohms = /bits/ 16 <300>; - ti,debounce-max = /bits/ 16 <3>; - ti,debounce-tol = /bits/ 16 <70>; - ti,debounce-rep = /bits/ 16 <3>; - wakeup-source; + spi-max-frequency = <1000000>; + interrupts-extended = <&gpio3 20 IRQ_TYPE_LEVEL_LOW>; + #io-channel-cells = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + channel@1 { + reg = <1>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@3 { + reg = <3>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@4 { + reg = <4>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@5 { + reg = <5>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; }; }; diff --git a/arch/arm/boot/dts/imx6dl-victgo.dts b/arch/arm/boot/dts/imx6dl-victgo.dts index d37ba4ed847d..52de091ea452 100644 --- a/arch/arm/boot/dts/imx6dl-victgo.dts +++ b/arch/arm/boot/dts/imx6dl-victgo.dts @@ -181,6 +181,18 @@ simple-audio-card,codec { frame-master; }; }; + + touchscreen { + compatible = "resistive-adc-touch"; + io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>, + <&adc_ts 5>; + io-channel-names = "y", "z1", "z2", "x"; + touchscreen-min-pressure = <64687>; + touchscreen-inverted-x; + touchscreen-inverted-y; + touchscreen-x-plate-ohms = <300>; + touchscreen-y-plate-ohms = <800>; + }; }; &audmux { @@ -244,22 +256,41 @@ &ecspi2 { pinctrl-0 = <&pinctrl_ecspi2>; status = "okay"; - touchscreen@0 { - compatible = "ti,tsc2046"; + adc_ts: adc@0 { + compatible = "ti,tsc2046e-adc"; reg = <0>; - pinctrl-names = "default"; pinctrl-0 = <&pinctrl_touchscreen>; - spi-max-frequency = <200000>; - interrupts-extended = <&gpio5 8 IRQ_TYPE_EDGE_FALLING>; - pendown-gpio = <&gpio5 8 GPIO_ACTIVE_LOW>; - touchscreen-size-x = <800>; - touchscreen-size-y = <480>; - touchscreen-inverted-y; - touchscreen-max-pressure = <4095>; - ti,vref-delay-usecs = /bits/ 16 <100>; - ti,x-plate-ohms = /bits/ 16 <800>; - ti,y-plate-ohms = /bits/ 16 <300>; - wakeup-source; + pinctrl-names ="default"; + spi-max-frequency = <1000000>; + interrupts-extended = <&gpio5 8 IRQ_TYPE_LEVEL_LOW>; + #io-channel-cells = <1>; + + #address-cells = <1>; + #size-cells = <0>; + + channel@1 { + reg = <1>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@3 { + reg = <3>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@4 { + reg = <4>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; + + channel@5 { + reg = <5>; + settling-time-us = <700>; + oversampling-ratio = <5>; + }; }; }; -- 2.30.2