Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp683104pxb; Tue, 1 Feb 2022 08:17:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyH2/XzPISudTrX4nAjhBHOmSGmg610F7v1CzUt1GqOupCd8c/QICKBurWtPlYhkTRB5c7l X-Received: by 2002:a17:90b:1b0e:: with SMTP id nu14mr3148015pjb.44.1643732248558; Tue, 01 Feb 2022 08:17:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643732248; cv=none; d=google.com; s=arc-20160816; b=iSyeZOTCGGNq8i3Z4n0MoCT4N52kKAQv5sZJ/9CtIxlT6j8nYy+0YfWO4QZTpB5k12 bm3Y9SpWJsNMpzYV/f/TCW7ApA3USdTS9/88otyKngOevuJNzbVTfjkJzZEfW7s1uG+X KM4KVKQv+EPsL3QSnCK674NxtknNT/Ie2m7RyyGVs6FG//2ZL7IMQewZ5lrm5SsbOTZy 6GO4oWNLNR5OUpVRo4kIOZNnOJGJrLJAbAPZMRx/lfQpymldYaofZmlUw+N2IkWouXh3 1fcc1esBBjJdhiMCrZLGuh51M/rPCm9bdrlBCOa6WJm0je5hz30wK0CORAnMCRpCQbqF PJ4g== 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=k7H/jcEhq9DQ75vyuXeuUOZBhMSvHD4gd5P79jD03d0=; b=VLZx0kHR6v4j2F7KT2FG5TO4NggYRrp1NXl2NqnG9XtWyyHqzXyWjiyMdxiM0nHYe3 fAgUOamOAq1OZrFxDPRYg7+Zlwh/ObUwYWTPboU4BoJSObzDpxyNnmxS7BlRn330nUr2 lvTvbu2DL+dgF1glXX9U0iesEjUHd4epSEogtFtoP5NCP/ioB2NbaUMDz8fsolkxAh5w lT6s8JbaAbJCK9uieZnde7Kz8JT2hOdfiP+BkkFVGBqUvPzW6XkCxsN8f+KwzhnfDNZj 1iT/GX/3thGh0j6LGFDDnmSAKWvCro0RTHWjDzMvj8KkZsSUa1hyLmMp8vO8W7utYVEN XwIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i191si11265962pge.19.2022.02.01.08.17.14; Tue, 01 Feb 2022 08:17:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358182AbiAaK3I (ORCPT + 99 others); Mon, 31 Jan 2022 05:29:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358087AbiAaK3E (ORCPT ); Mon, 31 Jan 2022 05:29:04 -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 A7581C06173D for ; Mon, 31 Jan 2022 02:29:04 -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 1nETvR-0008WI-Oj; Mon, 31 Jan 2022 11:28:45 +0100 Received: from ore by dude.hi.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1nETvO-008CcS-H4; Mon, 31 Jan 2022 11:28:42 +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 v2 5/5] ARM: dts: imx6dl: plym2m, prtvt7, victgo: add thermal zones and hwmon Date: Mon, 31 Jan 2022 11:28:41 +0100 Message-Id: <20220131102841.1955032-6-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20220131102841.1955032-1-o.rempel@pengutronix.de> References: <20220131102841.1955032-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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add thermal zones and hwmon connected to the ADC-touchscreen controller. Signed-off-by: Oleksij Rempel --- arch/arm/boot/dts/imx6dl-plym2m.dts | 74 ++++++++++++++++++++++++++++- arch/arm/boot/dts/imx6dl-prtvt7.dts | 57 ++++++++++++++++++++++ arch/arm/boot/dts/imx6dl-victgo.dts | 62 +++++++++++++++++++++++- 3 files changed, 191 insertions(+), 2 deletions(-) diff --git a/arch/arm/boot/dts/imx6dl-plym2m.dts b/arch/arm/boot/dts/imx6dl-plym2m.dts index 73c7622bfe0f..c4ce23d8ac9f 100644 --- a/arch/arm/boot/dts/imx6dl-plym2m.dts +++ b/arch/arm/boot/dts/imx6dl-plym2m.dts @@ -50,6 +50,11 @@ display_out: endpoint { }; }; + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&vdiv_vaccu>; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default"; @@ -102,6 +107,26 @@ reg_12v0: regulator-12v0 { regulator-max-microvolt = <12000000>; }; + thermal-zones { + chassis-thermal { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&tsens0>; + }; + + touch-thermal0 { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&touch_temp0>; + }; + + touch-thermal1 { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&touch_temp1>; + }; + }; + touchscreen { compatible = "resistive-adc-touch"; io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>, @@ -113,6 +138,32 @@ touchscreen { touchscreen-x-plate-ohms = <300>; touchscreen-y-plate-ohms = <800>; }; + + touch_temp0: touch-temperature-sensor0 { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&adc_ts 0>; + io-channel-names = "sensor-channel"; + temperature-lookup-table = < (-40000) 736 + 85000 474>; + }; + + touch_temp1: touch-temperature-sensor1 { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&adc_ts 7>; + io-channel-names = "sensor-channel"; + temperature-lookup-table = < (-40000) 826 + 85000 609>; + }; + + vdiv_vaccu: voltage-divider-vaccu { + compatible = "voltage-divider"; + io-channels = <&adc_ts 2>; + output-ohms = <2500>; + full-ohms = <64000>; + #io-channel-cells = <0>; + }; }; &can1 { @@ -153,12 +204,24 @@ adc_ts: adc@0 { #address-cells = <1>; #size-cells = <0>; + channel@0 { + reg = <0>; + settling-time-us = <300>; + oversampling-ratio = <5>; + }; + channel@1 { reg = <1>; settling-time-us = <700>; oversampling-ratio = <5>; }; + channel@2 { + reg = <2>; + settling-time-us = <300>; + oversampling-ratio = <5>; + }; + channel@3 { reg = <3>; settling-time-us = <700>; @@ -176,6 +239,14 @@ channel@5 { settling-time-us = <700>; oversampling-ratio = <5>; }; + + /* channel 6 is not connected */ + + channel@7 { + reg = <7>; + settling-time-us = <300>; + oversampling-ratio = <5>; + }; }; }; @@ -260,9 +331,10 @@ &i2c3 { pinctrl-0 = <&pinctrl_i2c3>; status = "okay"; - temperature-sensor@70 { + tsens0: temperature-sensor@70 { compatible = "ti,tmp103"; reg = <0x70>; + #thermal-sensor-cells = <0>; }; }; diff --git a/arch/arm/boot/dts/imx6dl-prtvt7.dts b/arch/arm/boot/dts/imx6dl-prtvt7.dts index 59e0674420a1..b86deebef7b7 100644 --- a/arch/arm/boot/dts/imx6dl-prtvt7.dts +++ b/arch/arm/boot/dts/imx6dl-prtvt7.dts @@ -53,6 +53,11 @@ display_out: endpoint { }; }; + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&vdiv_vaccu>; + }; + keys { compatible = "gpio-keys"; autorepeat; @@ -236,6 +241,26 @@ simple-audio-card,codec { }; }; + thermal-zones { + chassis-thermal { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&tsens0>; + }; + + touch-thermal0 { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&touch_temp0>; + }; + + touch-thermal1 { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&touch_temp1>; + }; + }; + touchscreen { compatible = "resistive-adc-touch"; io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>, @@ -247,6 +272,32 @@ touchscreen { touchscreen-x-plate-ohms = <300>; touchscreen-y-plate-ohms = <800>; }; + + touch_temp0: touch-temperature-sensor0 { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&adc_ts 0>; + io-channel-names = "sensor-channel"; + temperature-lookup-table = < (-40000) 736 + 85000 474>; + }; + + touch_temp1: touch-temperature-sensor1 { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&adc_ts 7>; + io-channel-names = "sensor-channel"; + temperature-lookup-table = < (-40000) 826 + 85000 609>; + }; + + vdiv_vaccu: voltage-divider-vaccu { + compatible = "voltage-divider"; + io-channels = <&adc_ts 2>; + output-ohms = <2500>; + full-ohms = <64000>; + #io-channel-cells = <0>; + }; }; &audmux { @@ -372,6 +423,12 @@ rtc@51 { reg = <0x51>; }; + tsens0: temperature-sensor@70 { + compatible = "ti,tmp103"; + reg = <0x70>; + #thermal-sensor-cells = <0>; + }; + gpio_pca: gpio@74 { compatible = "nxp,pca9539"; reg = <0x74>; diff --git a/arch/arm/boot/dts/imx6dl-victgo.dts b/arch/arm/boot/dts/imx6dl-victgo.dts index 52de091ea452..227c952543d4 100644 --- a/arch/arm/boot/dts/imx6dl-victgo.dts +++ b/arch/arm/boot/dts/imx6dl-victgo.dts @@ -66,6 +66,11 @@ enter { }; }; + iio-hwmon { + compatible = "iio-hwmon"; + io-channels = <&vdiv_vaccu>, <&vdiv_hitch_pos>; + }; + leds { compatible = "gpio-leds"; pinctrl-names = "default"; @@ -182,6 +187,26 @@ simple-audio-card,codec { }; }; + thermal-zones { + chassis-thermal { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&tsens0>; + }; + + touch-thermal0 { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&touch_temp0>; + }; + + touch-thermal1 { + polling-delay = <20000>; + polling-delay-passive = <0>; + thermal-sensors = <&touch_temp1>; + }; + }; + touchscreen { compatible = "resistive-adc-touch"; io-channels = <&adc_ts 1>, <&adc_ts 3>, <&adc_ts 4>, @@ -193,6 +218,40 @@ touchscreen { touchscreen-x-plate-ohms = <300>; touchscreen-y-plate-ohms = <800>; }; + + touch_temp0: touch-temperature-sensor0 { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&adc_ts 0>; + io-channel-names = "sensor-channel"; + temperature-lookup-table = < (-40000) 736 + 85000 474>; + }; + + touch_temp1: touch-temperature-sensor1 { + compatible = "generic-adc-thermal"; + #thermal-sensor-cells = <0>; + io-channels = <&adc_ts 7>; + io-channel-names = "sensor-channel"; + temperature-lookup-table = < (-40000) 826 + 85000 609>; + }; + + vdiv_vaccu: voltage-divider-vaccu { + compatible = "voltage-divider"; + io-channels = <&adc_ts 2>; + output-ohms = <2500>; + full-ohms = <64000>; + #io-channel-cells = <0>; + }; + + vdiv_hitch_pos: voltage-divider-hitch-pos { + compatible = "voltage-divider"; + io-channels = <&adc_ts 6>; + output-ohms = <3300>; + full-ohms = <13300>; + #io-channel-cells = <0>; + }; }; &audmux { @@ -477,9 +536,10 @@ rtc@51 { reg = <0x51>; }; - temperature-sensor@70 { + tsens0: temperature-sensor@70 { compatible = "ti,tmp103"; reg = <0x70>; + #thermal-sensor-cells = <0>; }; }; -- 2.30.2