From patchwork Tue Oct 18 09:33:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Stein X-Patchwork-Id: 13010213 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 910FDC4332F for ; Tue, 18 Oct 2022 09:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xCjbxSQcr9uwcons/vGJ/BaZfnguDeXmVzjNuvYlMT8=; b=4H4k9S790Av4bZ 4law8HS9mDiwu2XM+09S2w9Zj0YOHublnN4PbSjYNjT1Y+7BG4aWEJHrefmca8CimxxmjCL3wSu+n oDNc6V2L3P7a1XcZQpXMkPEYp3C+DaV+ry97ITpOgOhLAVCsUpuyAy7Aorn/u2hEq9PDGpEZj+/C2 m7ioaasyQ8w1+2cA7MZkgzyMiGaR3yFNp5zakvmL2w5o84HI+3zyK/Hy48KJ8SjqCmAdtQR7DyrQg oTQ5rg2WYQeX9mnuCQShcgumzE0yuVTsFX3JdcHbITUBl1g6uvUF1yL8I1wryFFJn0mwfcxHHG54F uYA4cITW0++KcyAjgPtw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1okiyu-0052Jv-Ez; Tue, 18 Oct 2022 09:33:52 +0000 Received: from mx1.tq-group.com ([93.104.207.81]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1okiyr-0052Il-4y for linux-arm-kernel@lists.infradead.org; Tue, 18 Oct 2022 09:33:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1666085629; x=1697621629; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zzVmzdf9gGe6KCjUmJRnPyJwgjw7AVvnmW0eSNXMoC8=; b=fvPrn9GCl+zOzJHlLLE+SMNprLEk0lp5lMd1xdlTfZw4E5yJo8dVCdDW /ZQSNJRT7anfjEK2yG8uo2IDgUjHbp9aTwQOd4fi8ayzZKyXVvmcgza36 A0jmX4kjseh1S0l70cXabo72lEiMoujk9L2tN+JXH+CcKEiQ/3KCEyF4m pd0h9TsyX5uTn4vvYYoRma2orfOY1w1NPnrVlnbyiCfog+7D6Lm2PdI8Z ub/Xj7/65cZnN/p5fw1yBg1Dx+RK/KNqRSGrW9ZsHh2av/+bE9w+Wlg13 2PZoH3uB/wCrvKFmqJzpx1y+7KXh4qiJG6UBOc1sR1LU0TnqpzMvQ8LPq Q==; X-IronPort-AV: E=Sophos;i="5.95,193,1661810400"; d="scan'208";a="26813589" Received: from unknown (HELO tq-pgp-pr1.tq-net.de) ([192.168.6.15]) by mx1-pgp.tq-group.com with ESMTP; 18 Oct 2022 11:33:46 +0200 Received: from mx1.tq-group.com ([192.168.6.7]) by tq-pgp-pr1.tq-net.de (PGP Universal service); Tue, 18 Oct 2022 11:33:47 +0200 X-PGP-Universal: processed; by tq-pgp-pr1.tq-net.de on Tue, 18 Oct 2022 11:33:47 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tq-group.com; i=@tq-group.com; q=dns/txt; s=key1; t=1666085626; x=1697621626; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=zzVmzdf9gGe6KCjUmJRnPyJwgjw7AVvnmW0eSNXMoC8=; b=EHyiul8KPBSffkSpvkHU8oyl95MpO7vpuoOGyncqo/X53d/V3zJjO/FQ EPABVpEwi51cZh7207zrMowQV+TqkwN0O5Xzaox4VSBZ6LPdTkahMzLfx FqQVoMpkKWNBEBscheH5vy78UNcbnX/1g4CG9ksLSo1G2twXq100xlaQ8 wCGWKrjt2w/bqeppo3wr930PnRr0pWYOo6fqdeixYtIydA/bL8WYAWFLZ YH+NR3Vh2IQcaJHDJebDthZyvrPzOIwJXbwt1Is0V/Lgams7fhkpP3hIK zqv0niGJQwqW1c+Sp25SXbA92ZIFIsccw+oacFRNDLt5LWa78G+gcJUL6 w==; X-IronPort-AV: E=Sophos;i="5.95,193,1661810400"; d="scan'208";a="26813587" Received: from vtuxmail01.tq-net.de ([10.115.0.20]) by mx1.tq-group.com with ESMTP; 18 Oct 2022 11:33:46 +0200 Received: from steina-w.tq-net.de (unknown [10.123.53.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by vtuxmail01.tq-net.de (Postfix) with ESMTPSA id 940E0280056; Tue, 18 Oct 2022 11:33:46 +0200 (CEST) From: Alexander Stein To: Rob Herring , Krzysztof Kozlowski , Shawn Guo , Sascha Hauer , Fabio Estevam Cc: Alexander Stein , Pengutronix Kernel Team , NXP Linux Team , devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH 1/1] arm64: dts: freescale: Add PWM fan support Date: Tue, 18 Oct 2022 11:33:41 +0200 Message-Id: <20221018093341.2581862-1-alexander.stein@ew.tq-group.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221018_023349_589714_A786B824 X-CRM114-Status: GOOD ( 15.32 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds the support for optional PWM fan 422J/2HP. Signed-off-by: Alexander Stein --- Now with inverted polarity support for pwm-fan in place, add PWM fan DT nodes for TQMa8MPQL + MBa8MPxL. As this is optional, it's disabled by default. This is based on next-20221018. Note: This device needs 'pwm1_enable' set to 3. E.g. using udev rule: SUBSYSTEM=="hwmon", DRIVERS=="pwm-fan", ATTR{pwm1_enable}="3" .../freescale/imx8mp-tqma8mpql-mba8mpxl.dts | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) diff --git a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts index 7a32379cd006..ffd117f17bbe 100644 --- a/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts +++ b/arch/arm64/boot/dts/freescale/imx8mp-tqma8mpql-mba8mpxl.dts @@ -55,6 +55,21 @@ clk_xtal25: clk-xtal25 { clock-frequency = <25000000>; }; + fan0: pwm-fan { + compatible = "pwm-fan"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_pwmfan>; + fan-supply = <®_pwm_fan>; + #cooling-cells = <2>; + /* typical 25 kHz -> 40.000 nsec */ + pwms = <&pwm3 0 40000 PWM_POLARITY_INVERTED>; + cooling-levels = <0 32 64 128 196 240>; + pulses-per-revolution = <2>; + interrupt-parent = <&gpio5>; + interrupts = <18 IRQ_TYPE_EDGE_FALLING>; + status = "disabled"; + }; + gpio-keys { compatible = "gpio-keys"; pinctrl-names = "default"; @@ -115,6 +130,18 @@ display: display { status = "disabled"; }; + reg_pwm_fan: regulator-pwm-fan { + compatible = "regulator-fixed"; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_regpwmfan>; + regulator-name = "FAN_PWR"; + regulator-min-microvolt = <12000000>; + regulator-max-microvolt = <12000000>; + gpio = <&gpio4 27 GPIO_ACTIVE_HIGH>; + enable-active-high; + vin-supply = <®_vcc_12v0>; + }; + reg_usdhc2_vmmc: regulator-usdhc2 { compatible = "regulator-fixed"; pinctrl-names = "default"; @@ -172,6 +199,47 @@ linux,cma { linux,cma-default; }; }; + + thermal-zones { + soc-thermal { + trips { + soc_active0: trip-active0 { + temperature = <40000>; + hysteresis = <5000>; + type = "active"; + }; + + soc_active1: trip-active1 { + temperature = <48000>; + hysteresis = <3000>; + type = "active"; + }; + + soc_active2: trip-active2 { + temperature = <60000>; + hysteresis = <10000>; + type = "active"; + }; + }; + + cooling-maps { + map1 { + trip = <&soc_active0>; + cooling-device = <&fan0 1 1>; + }; + + map2 { + trip = <&soc_active1>; + cooling-device = <&fan0 2 2>; + }; + + map3 { + trip = <&soc_active2>; + cooling-device = <&fan0 3 3>; + }; + }; + }; + }; }; &ecspi1 { @@ -725,10 +793,18 @@ pinctrl_pwm3: pwm3grp { fsl,pins = ; }; + pinctrl_pwmfan: pwmfangrp { + fsl,pins = ; /* FAN RPM */ + }; + pinctrl_reg12v0: reg12v0grp { fsl,pins = ; /* VCC12V enable */ }; + pinctrl_regpwmfan: regpwmfangrp { + fsl,pins = ; + }; + /* X61 */ pinctrl_uart1: uart1grp { fsl,pins = ,