Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp136339pxu; Thu, 22 Oct 2020 18:06:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIdLj5bfcjDAPWKvJMdX4TuuSUeBz6uHZsyjMFdmNtUNrtZU9d9GIpYWGp+CDgcTj62rNV X-Received: by 2002:a17:907:94cb:: with SMTP id dn11mr5037270ejc.326.1603415166190; Thu, 22 Oct 2020 18:06:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603415166; cv=none; d=google.com; s=arc-20160816; b=m8c5W56pDT4sYcVafKIXenSKdW54Yhc4GI0SlZlYIfUsbXv3tXA+kl14xlZ0zqWjLO P3CqBNDPGqH1geuAwI3ioNch77ufRvs4M+1zKGCBbM/4/xfY4cUqKOg5V7iybFnwOxHY qJxy7MWWAb7fhgEFax8GJ4kaOic96iHqIwtF4r+OVPrGUmF1k4Ant+kaTfz2H+Anxlck Xn3dlwwaHwRzVO2vcr7acIIVrgFrCybBIaz9hoh39nKnxWhD61oz9Y1hxlLwguCVZnR5 6WuzfxjvCdXaYlGxeJDXVay8tpIZKhpME1H4L9EXte+/+f+Zh4sksM5MnEBfyVGdZY21 NFTA== 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=ZW/th9NgEXHoLNmk2kSGdVDvFpx4ZYm17cL/vIEd3pk=; b=gHU20RTROZIHWakzg8RqRMFqIrqRWtKsqpAspNVRbmiRBL8bN9LBOfKLSpelbVPyWm 6w7uaxqBiQzGlB/IbPxXG76YWcAFmSe1YXW8i1eT/p1vZ7r903OkEH5Ml0OCxtM4iEGM 6y3f6fRUNw3ryamhRa5VM/NP+zGtCq4fV99TkPD6Tggx+7El81UIg4kBD0VmgKmERLgo YYZ8RLP6/s6IkBRqOexkVJ1r9TyUsQ++O0kMlb0URwvYsryTp8Njw6gHk9mi01PTcKsI xucy6n1WmhP9DXCN0kQGvNa1X5kg4QS4IUYVekLllCLa6/4RMnDqMsOhB91S1jIkdBF0 VpHg== 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 r22si1937334eju.372.2020.10.22.18.05.28; Thu, 22 Oct 2020 18:06:06 -0700 (PDT) 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 S368963AbgJVP72 (ORCPT + 99 others); Thu, 22 Oct 2020 11:59:28 -0400 Received: from mx2.suse.de ([195.135.220.15]:48822 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S368934AbgJVP7W (ORCPT ); Thu, 22 Oct 2020 11:59:22 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 52B30AE2C; Thu, 22 Oct 2020 15:59:19 +0000 (UTC) From: Nicolas Saenz Julienne To: u.kleine-koenig@pengutronix.de, linux-kernel@vger.kernel.org, Rob Herring , Nicolas Saenz Julienne Cc: f.fainelli@gmail.com, linux-pwm@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, wahrenst@gmx.net, linux-input@vger.kernel.org, dmitry.torokhov@gmail.com, gregkh@linuxfoundation.org, devel@driverdev.osuosl.org, p.zabel@pengutronix.de, linux-gpio@vger.kernel.org, linus.walleij@linaro.org, linux-clk@vger.kernel.org, sboyd@kernel.org, linux-rpi-kernel@lists.infradead.org Subject: [PATCH v2 09/10] DO NOT MERGE: ARM: dts: Add RPi's official PoE hat support Date: Thu, 22 Oct 2020 17:58:56 +0200 Message-Id: <20201022155858.20867-10-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201022155858.20867-1-nsaenzjulienne@suse.de> References: <20201022155858.20867-1-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an example on how to enable the fan on top of RPi's official PoE hat. Signed-off-by: Nicolas Saenz Julienne --- Changes since v1: - Update patch to use 2 pwm cells arch/arm/boot/dts/bcm2711-rpi-4-b.dts | 54 +++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts index 09a1182c2936..361db82619a4 100644 --- a/arch/arm/boot/dts/bcm2711-rpi-4-b.dts +++ b/arch/arm/boot/dts/bcm2711-rpi-4-b.dts @@ -5,6 +5,7 @@ #include "bcm283x-rpi-usb-peripheral.dtsi" #include +#include / { compatible = "raspberrypi,4-model-b", "brcm,bcm2711"; @@ -68,6 +69,54 @@ sd_vcc_reg: sd_vcc_reg { enable-active-high; gpio = <&expgpio 6 GPIO_ACTIVE_HIGH>; }; + + fan: pwm-fan { + compatible = "pwm-fan"; + cooling-levels = <0 50 150 255>; + #cooling-cells = <2>; + pwms = <&fwpwm RASPBERRYPI_FIRMWARE_PWM_POE 80000>; + }; + + thermal-zones { + cpu_thermal: cpu-thermal { + trips { + threshold: trip-point@0 { + temperature = <45000>; + hysteresis = <5000>; + type = "active"; + }; + + target: trip-point@1 { + temperature = <50000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_hot: cpu_hot@0 { + temperature = <55000>; + hysteresis = <2000>; + type = "active"; + }; + }; + + cooling-maps { + map0 { + trip = <&threshold>; + cooling-device = <&fan 0 1>; + }; + + map1 { + trip = <&target>; + cooling-device = <&fan 1 2>; + }; + + map2 { + trip = <&cpu_hot>; + cooling-device = <&fan 2 3>; + }; + }; + }; + }; }; &ddc0 { @@ -103,6 +152,11 @@ reset: reset { compatible = "raspberrypi,firmware-reset"; #reset-cells = <1>; }; + + fwpwm: pwm { + compatible = "raspberrypi,firmware-pwm"; + #pwm-cells = <2>; + }; }; &gpio { -- 2.28.0