From patchwork Mon May 29 20:42:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13258964 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 EBCAFC77B7E for ; Mon, 29 May 2023 20:43: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: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=/UhVQK7t+HosSVy3q0W/MQmzaLul2qg9td8dQYWmD0k=; b=HZII4mMllDhSFA O9S6HVD0Mkq1ma1x0K2ybzgGmNkMMzwHVrym7IOqFsXC7XqXtqs4zfJcs1c85VALkXBa0nDunrkix E03aABVb7cXUMGjgL8jDHV9rR4qgOpTnON3yzB/ZWyruadKPFRtdxMiw13JDk3GahhUHpTIHcP1dp OEG95dQQnlHQz43h4pX0wo1a15OeRTCI7MQZhKsIHbXhwd91jYlbmGqecocVBf2wrITU3xHaH0FME ERlt162050NPO76pYJ7BdsoxQ1uliw5ZhevvJ/oUitKusEi8El8KiEQMfxFvVBKN5lhH6d94hTJ+g Ofuqum4D/VWTCf8ZODuA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3jiW-00Bf2Y-1b; Mon, 29 May 2023 20:43:48 +0000 Received: from mxout4.routing.net ([2a03:2900:1:a::9]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3jiR-00BexZ-0K; Mon, 29 May 2023 20:43:45 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout4.routing.net (Postfix) with ESMTP id ADD441005E9; Mon, 29 May 2023 20:43:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1685393012; 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=/UhVQK7t+HosSVy3q0W/MQmzaLul2qg9td8dQYWmD0k=; b=BR1ELm0lTE3YGEG0DQRxvZAaxdI24SK7OtZgNG9O471K5TJQF/KKId68A3wUnZyBpe6Ai6 klpuc/f5L6nRPJFTk0M9mViM8330O3X2Wog18JST5c5Ud4OCILQcOiHOf9s/2BqymHOcj0 trrK64xgMn/d4X9+VRSEkQVOJNdrBw0= Received: from frank-G5.. (fttx-pool-217.61.156.2.bambit.de [217.61.156.2]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id B9450100AD7; Mon, 29 May 2023 20:43:31 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v2 1/4] dt-bindings: nvmem: mediatek: efuse: add support for mt7986 Date: Mon, 29 May 2023 22:42:55 +0200 Message-Id: <20230529204258.65238-2-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230529204258.65238-1-linux@fw-web.de> References: <20230529204258.65238-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 43c692b0-9847-4de0-bc01-d0ed8cf8e474 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230529_134343_290873_8EDE8195 X-CRM114-Status: UNSURE ( 8.63 ) X-CRM114-Notice: Please train this message. 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 , Rob Herring , Jonathan Cameron , AngeloGioacchino Del Regno Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org From: Frank Wunderlich Add compatible string for mt7986 SoC. Signed-off-by: Frank Wunderlich Acked-by: Rob Herring --- Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml index d16d42fb98b6..7ec2988b597e 100644 --- a/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml +++ b/Documentation/devicetree/bindings/nvmem/mediatek,efuse.yaml @@ -27,6 +27,7 @@ properties: - enum: - mediatek,mt7622-efuse - mediatek,mt7623-efuse + - mediatek,mt7986-efuse - mediatek,mt8173-efuse - mediatek,mt8183-efuse - mediatek,mt8186-efuse From patchwork Mon May 29 20:42:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13258966 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 57120C77B7A for ; Mon, 29 May 2023 20:44:12 +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=LEvUQRyEjuyLGOQSr30JCL5wkoldAB6QzYq6vNAehBw=; b=AIYiypKtGKH6Jd PVnCW67hz5RdrjzG/wa/blyieZ4Efk9WmuRCKyjujfMLrqv3jLT+xcxAszscNG0l6C1bYbIQNrwoo g1xEQMKBWW98KTgx4GlvgUA1qHWkYQDxehANfhxZRDZdKWrfjPokYRLhJ4HdrUeZcCuHNJ7P/mTBS kq/0PCGEGD4ebpXnfzA7oqFE2V6OU/a0al1UA8x9MCGCEG6rTj9qKGn6TkNbrR5XpeS0KMpzkiEAg vcFUVl3G5A0JhVDdyKeH4r250+orpaS0bd2BPfDZRW4835X+YaiN1MvP8ZluvptKETKiDWCq+aEsM w9AdDxJiZGGFK3Yn2MLQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3jip-00BfB9-0I; Mon, 29 May 2023 20:44:07 +0000 Received: from mxout3.routing.net ([2a03:2900:1:a::8]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3jiR-00BexU-0g; Mon, 29 May 2023 20:43:46 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout3.routing.net (Postfix) with ESMTP id 7DDDE60546; Mon, 29 May 2023 20:43:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1685393013; 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=LEvUQRyEjuyLGOQSr30JCL5wkoldAB6QzYq6vNAehBw=; b=Ggy3yFGo9RI2DwMHZRxHsxRHAsUBt7zxYpA8e8klBos0XjeYwjPmH8jggN7xKnpZNi3Z7R WNc2QGG4kdOjlB90GtKZt2OYxB56ZbVC2cmb2RlX5QjfDAYPEvclLT+gYN7+wGSoXyNw7v clBAJBEkDCWQrUB37mKxZx7H9O4v6so= Received: from frank-G5.. (fttx-pool-217.61.156.2.bambit.de [217.61.156.2]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 95DD31006D1; Mon, 29 May 2023 20:43:32 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v2 2/4] arm64: dts: mt7986: add thermal and efuse Date: Mon, 29 May 2023 22:42:56 +0200 Message-Id: <20230529204258.65238-3-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230529204258.65238-1-linux@fw-web.de> References: <20230529204258.65238-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: c0f3b566-cefa-4a02-b786-1cb62287543d X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230529_134343_455751_E1190626 X-CRM114-Status: GOOD ( 10.85 ) 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 thermal related nodes to mt7986 devicetree. Signed-off-by: Daniel Golle Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno --- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 37 ++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index aa9e679b78e2..a409d5e845c2 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -337,6 +337,15 @@ spi1: spi@1100b000 { status = "disabled"; }; + auxadc: adc@1100d000 { + compatible = "mediatek,mt7986-auxadc"; + reg = <0 0x1100d000 0 0x1000>; + clocks = <&infracfg CLK_INFRA_ADC_26M_CK>; + clock-names = "main"; + #io-channel-cells = <1>; + status = "disabled"; + }; + ssusb: usb@11200000 { compatible = "mediatek,mt7986-xhci", "mediatek,mtk-xhci"; @@ -375,6 +384,21 @@ mmc0: mmc@11230000 { status = "disabled"; }; + thermal: thermal@1100c800 { + #thermal-sensor-cells = <1>; + compatible = "mediatek,mt7986-thermal"; + reg = <0 0x1100c800 0 0x800>; + interrupts = ; + clocks = <&infracfg CLK_INFRA_THERM_CK>, + <&infracfg CLK_INFRA_ADC_26M_CK>, + <&infracfg CLK_INFRA_ADC_FRC_CK>; + clock-names = "therm", "auxadc", "adc_32k"; + mediatek,auxadc = <&auxadc>; + mediatek,apmixedsys = <&apmixedsys>; + nvmem-cells = <&thermal_calibration>; + nvmem-cell-names = "calibration-data"; + }; + pcie: pcie@11280000 { compatible = "mediatek,mt7986-pcie", "mediatek,mt8192-pcie"; @@ -426,6 +450,18 @@ pcie_port: pcie-phy@11c00000 { }; }; + efuse: efuse@11d00000 { + compatible = "mediatek,mt7986-efuse", + "mediatek,efuse"; + reg = <0 0x11d00000 0 0x1000>; + #address-cells = <1>; + #size-cells = <1>; + + thermal_calibration: calib@274 { + reg = <0x274 0xc>; + }; + }; + usb_phy: t-phy@11e10000 { compatible = "mediatek,mt7986-tphy", "mediatek,generic-tphy-v2"; @@ -567,5 +603,4 @@ wifi: wifi@18000000 { memory-region = <&wmcpu_emi>; }; }; - }; From patchwork Mon May 29 20:42:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13258965 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 D2ECCC7EE31 for ; Mon, 29 May 2023 20:43:54 +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=cDhjjWLFoezZAi/uvwan8VYbJJegbs/FI4UlVYsQEcA=; b=ZpI3LhJvjYa2fh NavHLZDCEiYcATPKOXNQMtWlLsLu9oys3BTSMA74D3HPB12CG+VJkhkC+AFOyaEPMLayrpmy+wJ2u Yt+66pupusL1vUKojlH2CTXusf6RaduIBavTKUPAysXMLq4NuUoZ9uf/aZyFFedmxM0fepkusmdfv aVW09Z2ab7XcEarT4U+8yDXw/PfC/EGpS4yLSFHKCixk9kxofyBfAOYkpUFz1DabCe9YxuGKI+A6w y7mbSbSixl06T9Iuw7Z89kk72MRLY2HGOS1t1lX/vrNobtAe9HkTtOaVpU4SjlXUhkvurHFwgo5eD 8bf9Qk00AbJZ4l83EXzA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3jiW-00Bf2Q-0I; Mon, 29 May 2023 20:43:48 +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 1q3jiR-00BexY-0G; Mon, 29 May 2023 20:43:45 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout2.routing.net (Postfix) with ESMTP id 54B9C5FBD8; Mon, 29 May 2023 20:43:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1685393014; 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=cDhjjWLFoezZAi/uvwan8VYbJJegbs/FI4UlVYsQEcA=; b=WzpP0SHn+OnZOkihcA/BoupceBtWe7QqKIQ1D4yILwJwnZxeZcAmBZO9N0brpsAL1vaMCo VNekBSXfHtErz5nvHTaLb9pym86CweVfQgVfiqCV7LQ3knRalaBMX45ijUVX9qdAiUOQ4d qYLV5hTKoPjFYsGqnTTBJAUHQM38Z2w= Received: from frank-G5.. (fttx-pool-217.61.156.2.bambit.de [217.61.156.2]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 6A3D6100AD7; Mon, 29 May 2023 20:43:33 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v2 3/4] arm64: dts: mt7986: add thermal-zones Date: Mon, 29 May 2023 22:42:57 +0200 Message-Id: <20230529204258.65238-4-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230529204258.65238-1-linux@fw-web.de> References: <20230529204258.65238-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: 1e0afbdd-08cb-4eec-9e6e-32b2db403961 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230529_134343_290672_FD7E934B X-CRM114-Status: UNSURE ( 9.64 ) X-CRM114-Notice: Please train this message. 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 thermal-zones to mt7986 devicetree. Signed-off-by: Daniel Golle Signed-off-by: Frank Wunderlich Reviewed-by: AngeloGioacchino Del Regno --- changes in v2: - drop top 2 thermal trips as suggested by matthias --- arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi index a409d5e845c2..a059fcdaa8b7 100644 --- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi @@ -603,4 +603,32 @@ wifi: wifi@18000000 { memory-region = <&wmcpu_emi>; }; }; + + thermal-zones { + cpu_thermal: cpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <1000>; + thermal-sensors = <&thermal 0>; + + trips { + cpu_trip_active_high: active-high { + temperature = <115000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_active_low: active-low { + temperature = <85000>; + hysteresis = <2000>; + type = "active"; + }; + + cpu_trip_passive: passive { + temperature = <40000>; + hysteresis = <2000>; + type = "passive"; + }; + }; + }; + }; }; From patchwork Mon May 29 20:42:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wunderlich X-Patchwork-Id: 13258967 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 12EB7C77B7E for ; Mon, 29 May 2023 20:44:12 +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=Yo8Ic7xdf7LbZE 8qR0VDAcKqdJ4gGBGxVLTWj8A1UW3bcytYHGTzNSfIxL3vVUmTbJAArshV84t39e1DxkA+lTsShRY k7JwbFvWXKLdB7kSRT0szXhZPglwfW9i+CamnZW3SoMsmGsbkdeQfdwOdfQUKABCN7YoJ2tQbq/zu 05qKOBGZGi8ZwVRI+xwIFnkcut74kjZsd+h/53UMTeMJkffikPY/bnT2RwEH5c+mypt6QTkSE7EO4 iTz08SKKRXGBHg1KBrJAg9p4NB7SxFZxr3Ykr2w5jKG9lIC7GyLCIXqPRFtS5MqzjFvd2u5/+zAIs eLauwPndO0ia/DzB5viw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1q3jio-00BfAf-1w; Mon, 29 May 2023 20:44:06 +0000 Received: from mxout1.routing.net ([2a03:2900:1:a::a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1q3jiR-00Bexe-0U; Mon, 29 May 2023 20:43:46 +0000 Received: from mxbox2.masterlogin.de (unknown [192.168.10.89]) by mxout1.routing.net (Postfix) with ESMTP id 695513FC7F; Mon, 29 May 2023 20:43:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailerdienst.de; s=20200217; t=1685393015; 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=X7uCk1A5RWowtoLg5C28QXGgBuPhnlgquA0AlaMFd43ibD+ZUiiExwvswPC2MKv8xwn93/ lYdNhnN/6uXhuWKKJ1g57S9tFrJvZcprKeOWolnq3tU34kfnUUp1wV3Es+/nhVbwQv8nsJ lqZPUaqmWk5su9LXSJu66RUD+Zv4PZg= Received: from frank-G5.. (fttx-pool-217.61.156.2.bambit.de [217.61.156.2]) by mxbox2.masterlogin.de (Postfix) with ESMTPSA id 4483E1006D1; Mon, 29 May 2023 20:43:34 +0000 (UTC) From: Frank Wunderlich To: linux-mediatek@lists.infradead.org Subject: [PATCH v2 4/4] arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts Date: Mon, 29 May 2023 22:42:58 +0200 Message-Id: <20230529204258.65238-5-linux@fw-web.de> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230529204258.65238-1-linux@fw-web.de> References: <20230529204258.65238-1-linux@fw-web.de> MIME-Version: 1.0 X-Mail-ID: b1d02627-873f-44dd-a92e-df7ed1a9bf87 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230529_134343_357032_2AEEB859 X-CRM114-Status: GOOD ( 11.31 ) 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 Reviewed-by: AngeloGioacchino Del Regno --- 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"; };