From patchwork Fri Apr 21 13:20:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13219999 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 60663C77B75 for ; Fri, 21 Apr 2023 13:21:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Content-Transfer-Encoding:MIME-Version:References:In-Reply-To:Message-Id:Date :Subject:To:From:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NiNTNWADcq8Wf9sTDfcLcaA78qUAbBkS8piCK+YIth4=; b=Vc6ZEDQc5edU4b QGRpqflTavy8q9UfkJ1/xvNACfQAo8+OPWI8NtQH8kxaPjK4NjEVjR+fajxqdot56v5eJqkPklrIy uBv2ct58+glgfeOx0WKMBS7+VCH/SBF76F89YxrtfW5mraVb2b0LMC36LRajzj2R3IFalFDJxMj6u sexZU8ygfMizTNmljF43PyVApFKraVa3pNmOkM/Aq8snNs5TBvk3tYELbwDe7wh5sRPBPw9RWwr+J g4OjtWGfUsSVcIKB7t7n3v8Zo0MXQKh4VvfYhth3mXmVv4+SIFIIyvuHQG9HN6QASgEgpa60FdIgZ 3Ao/3b3aHAPSRMI7uQPg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1ppqhz-00AxuP-0t; Fri, 21 Apr 2023 13:21:51 +0000 Received: from mxout2.routing.net ([2a03:2900:1:a::b]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1ppqhB-00AxUm-1w; Fri, 21 Apr 2023 13:21:03 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout2.routing.net (Postfix) with ESMTP id 12A946035B; Fri, 21 Apr 2023 13:21:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1682083260; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NiNTNWADcq8Wf9sTDfcLcaA78qUAbBkS8piCK+YIth4=; b=GtRSq3+StukDoPcXTwschldIT9Dh74lS8zWFW/HR3WD2Gprt28Ek92ULzH7jPn+2yEne+P rYmNv/xPJpdA8sGSw0z0zdh0s5oBGf0pny9jULvFO5WkAHYVQ2g4mVIWKCDCUFZD7dZA/V 21zP22t/SyrakEx5djdaovOHFlikY9w= Received: from frank-G5.. (fttx-pool-217.61.159.143.bambit.de [217.61.159.143]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 0DADE10078A; Fri, 21 Apr 2023 13:20:59 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v1 7/7] arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts Date: Fri, 21 Apr 2023 15:20:47 +0200 Message-Id: <20230421132047.42166-8-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230421132047.42166-1-linux@fw-web.de> References: <20230421132047.42166-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: ffa0c9e8-5f36-4bc6-80fc-5fd1b0adccf6 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230421_062101_872725_4A123566 X-CRM114-Status: GOOD ( 11.35 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Andrew-CT Chen , Lars-Peter Clausen , Lala Lin , linux-iio@vger.kernel.org, Zhiyong Tao , "Hui.Liu" , linux-kernel@vger.kernel.org, Daniel Golle , devicetree@vger.kernel.org, Rob Herring , Srinivas Kandagatla , linux-arm-kernel@lists.infradead.org, Krzysztof Kozlowski , Matthias Brugger , Jonathan Cameron , AngeloGioacchino Del Regno Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Daniel Golle Add pwm-fan and cooling-maps to BananaPi-R3 devicetree. Signed-off-by: Daniel Golle Signed-off-by: Frank Wunderlich --- this is based on Patch from openwrt. as my PWM-fan seems to need 5v pwm signal and r3 only provides 3v3 on 3pin-socket it does not work for me. --- .../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts index 782519429497..29c018bbf29d 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts +++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts @@ -37,6 +37,15 @@ dcin: regulator-12vd { regulator-always-on; }; + fan: pwm-fan { + compatible = "pwm-fan"; + #cooling-cells = <2>; + /* cooling level (0, 1, 2) - pwm inverted */ + cooling-levels = <255 96 0>; + pwms = <&pwm 0 10000 0>; + status = "okay"; + }; + gpio-keys { compatible = "gpio-keys"; @@ -132,6 +141,28 @@ sfp2: sfp-2 { }; }; +&cpu_thermal { + cooling-maps { + cpu-active-high { + /* active: set fan to cooling level 2 */ + cooling-device = <&fan 2 2>; + trip = <&cpu_trip_active_high>; + }; + + cpu-active-low { + /* active: set fan to cooling level 1 */ + cooling-device = <&fan 1 1>; + trip = <&cpu_trip_active_low>; + }; + + cpu-passive { + /* passive: set fan to cooling level 0 */ + cooling-device = <&fan 0 0>; + trip = <&cpu_trip_passive>; + }; + }; +}; + &crypto { status = "okay"; };