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: 86305 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1067728vqo; Fri, 21 Apr 2023 06:29:46 -0700 (PDT) X-Google-Smtp-Source: AKy350Zay2BBOLkYe6ZFewRLgn1S3lD0/nGaRPdtsmLqWVOTlimoQCow8PeS5P68vsEqMsi/cgfM X-Received: by 2002:a05:6a20:8e19:b0:f2:630e:f60f with SMTP id y25-20020a056a208e1900b000f2630ef60fmr2880130pzj.36.1682083786646; Fri, 21 Apr 2023 06:29:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682083786; cv=none; d=google.com; s=arc-20160816; b=ZAIZQIkL3EXjCjQJhYQBOrnTHxBvuuPA1I0QCH2iqa4ZJTkk2nZTbT5dpD0rnoA0PT gFh4x5Cnp7zjXZm/oVN0y4Po3byOHxgHT/OkmQM9Osm6C96mjHDYrlivKqLeZdmPozH/ TvtwLWyQ2jvdwE7k98KCgmx7qskS5uCnljf6wz5+cn+WMnN3GDgUe/rUPYE+J1L9zbEE vchBMxXRfFRUFQTfQVTP9qDPe9M7BQNownmY8aQUKSSg823S6fkQP4LL2IoelKiE7Qk6 pXwXJoUR5IfNKhN534f0pivjhQR4cx37MUqIV9sm1ZVs9b8C3Mcan4p6SOcPvkHZKtOT dNFQ== 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=NiNTNWADcq8Wf9sTDfcLcaA78qUAbBkS8piCK+YIth4=; b=KJUWaj0G10aEE7sqSfLBvjwfL8puexM5OZ9whRZv292HH7wLiuGgmTp21sOJKg2JOk qmzStAADJ78sX2ShMV39phLgfqxAHK4XS8YxTvfxAeXwd7PJpJfBM2j9gbO4HeUgvCOD tHnj/prtM0Baq0ywm/uCNgfkcRZjgy0qRv0RutfiHJCbbUU7M0Izyvs4VjpGZd1+bLBp fHWDwtzCjO/lWmSAmpKrLlmZ+hsepmUSTpsftdIYkwhWsUkIk6nlzcQoES1GrkbQVlYs eiPSNDWUz6qliEveLEbEoFm+uDVEojTxvCuUR/S/04yLQGwAffKxKZM8gyEIVQoI6h0b OhVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mailerdienst.de header.s=20200217 header.b=GtRSq3+S; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v71-20020a63894a000000b0051a24ba4d74si4201176pgd.837.2023.04.21.06.29.34; Fri, 21 Apr 2023 06:29:46 -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=@mailerdienst.de header.s=20200217 header.b=GtRSq3+S; 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 S232456AbjDUN1G (ORCPT + 99 others); Fri, 21 Apr 2023 09:27:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230148AbjDUN1A (ORCPT ); Fri, 21 Apr 2023 09:27:00 -0400 Received: from mxout2.routing.net (mxout2.routing.net [IPv6:2a03:2900:1:a::b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28483C17C; Fri, 21 Apr 2023 06:26:59 -0700 (PDT) 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 Cc: Frank Wunderlich , Jonathan Cameron , Lars-Peter Clausen , Rob Herring , Krzysztof Kozlowski , Matthias Brugger , AngeloGioacchino Del Regno , Srinivas Kandagatla , "Hui.Liu" , Zhiyong Tao , Andrew-CT Chen , Lala Lin , linux-iio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Daniel Golle 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-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1763792688592599859?= X-GMAIL-MSGID: =?utf-8?q?1763792688592599859?= 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"; };