Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp650987pxu; Fri, 11 Dec 2020 10:50:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJwlX9gQhExrqvhkW0mPygCWHpB+EK9nInUdY0CiIlXvAhEc1QH+QTtplrflrp/EKxRheMrJ X-Received: by 2002:a50:e791:: with SMTP id b17mr13144101edn.388.1607712645905; Fri, 11 Dec 2020 10:50:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607712645; cv=none; d=google.com; s=arc-20160816; b=GVuZSDW4vaOgN0Z3W7b3Cw+KU9lRsJWQ/lJSZV1+9kwpx169gDEGQy0P8Vne9MNj8B BfSFeMtmtV9gergvf0vY6pIQrGb4Tu/H8Ls5QbKUiHxTgToeFwpOd0OzLftRtlAt9Ewv tbIMlyLoFCoXIAwjyn5xUkdosWWknNI2IWdp2Z+y3WtRHMLeLDyeF4fvmZZtKAmSusxb DCDvKYdU6UeTYHNyqiw+iNJ6yNfi5WgJiyeqdGSvJlv66v7Cvu5tBVeuIi1kDcbTZKHs 5VeohMO8LHIJiO5ULaLsHGVVPrZlHZ3bHsuEKmziQmKU/Pj1UNBjAvtqvP4ge2uKenMg LPDA== 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=UC6E6zbE4QHy0tduk+3X4f0sRqmaLq8jWy6ynUh5v8U=; b=M9Re5lB0zg1+xAwGF2brIHR2CLH45BbYrEtHUECSDT2L1IgWBRToOZEmar0q9LKiA+ WZ/rv7JkSyLA85kkmRJKs4Z/KH1hv8p3Nmlw6GJk/Oq7ZjJ3uDw4W6KROi6P3bt//HGe OFdEviFpSZ63wdDtIT5OF+47LJEVxegZ4FsQTVX1TQGsIMnu+9QlfM9lKKYsOUoOVAL4 4Pgo6bIh4ceCK0MfC1g1fLWWUsvhVqOySxd+2Lgtu919GUDpO4CFc1WqHQVb1HxxWdIJ +tdvrrMDPFB2oZO9eTWX2CV8MB2/Es4INczCxbxK/Q2HrplReX5vWMXD4fN/mwSrq32F fpIg== 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 o21si5222570edi.210.2020.12.11.10.50.23; Fri, 11 Dec 2020 10:50:45 -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 S2391934AbgLKQvz (ORCPT + 99 others); Fri, 11 Dec 2020 11:51:55 -0500 Received: from mx2.suse.de ([195.135.220.15]:34846 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390282AbgLKQtf (ORCPT ); Fri, 11 Dec 2020 11:49:35 -0500 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 A4C10B283; Fri, 11 Dec 2020 16:48:20 +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, bgolaszewski@baylibre.com, andy.shevchenko@gmail.com Subject: [PATCH v6 10/11] DO NOT MERGE: ARM: dts: Add RPi's official PoE hat support Date: Fri, 11 Dec 2020 17:47:59 +0100 Message-Id: <20201211164801.7838-11-nsaenzjulienne@suse.de> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201211164801.7838-1-nsaenzjulienne@suse.de> References: <20201211164801.7838-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 --- 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 403bacf986eb..9ae44620c5b8 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-poe-pwm"; + #pwm-cells = <2>; + }; }; &gpio { -- 2.29.2