From patchwork Sat Jun 11 17:08:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Furkan Kardame X-Patchwork-Id: 12878598 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 3865CC433EF for ; Sat, 11 Jun 2022 17:10:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=W4lFtadrDdL6U/a1ao/9AuJkRMyh5ie152299Tinl2Y=; b=BKU/aH3W3lkg+E WJwCp1AYIlUHj6Nj12COrB10GB+DPiaKEvA2SWuTuud/nRAED8AXFab7wt7hbjE2eI2HMe5cVlLjx aeZfvcd1wAT5Fb7jIMaY/S2P50XZ3Hlm3UdKGJ+6/XN9pJ3fBhxYn5r+JaPWlmmB6smBvFw+1GpEc gvvABopKsemlhmoxVsygfnJvNVvF/1DGFZNeeX4MLSZ4s0sYA3n1DVA4JCRazVyuy5RCBGsOu1Jm7 Gy8GrtCYKJm9lfCLYiYHN7mc7vct+NzQYl+DJM2zqhdoPuZzVW9VPixabFKv9ON5M51iSwEUpByka 7rJcnE8SXhyHdyQuA5gg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o04cS-00Dujd-Da; Sat, 11 Jun 2022 17:09:52 +0000 Received: from mail.manjaro.org ([116.203.91.91]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o04cO-00Dui5-Rw; Sat, 11 Jun 2022 17:09:50 +0000 From: Furkan Kardame To: narmstrong@baylibre.com Cc: khilman@baylibre.com, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org, Furkan Kardame Subject: [PATCH v4] arm64: dts: meson: add gpio-fan control to GS-King-X Date: Sat, 11 Jun 2022 20:08:52 +0300 Message-Id: <20220611170852.19487-1-f.kardame@manjaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220611_100949_092877_CA9BDD36 X-CRM114-Status: UNSURE ( 8.17 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+linux-amlogic=archiver.kernel.org@lists.infradead.org GS-King-X has a single speed GPIO fan which is always-on by default. If we add controls for the fan and a trip point, the fan stays off most of the time, reducing background noise from the unit. Signed-off-by: Furkan Kardame Reviewed-by: Neil Armstrong --- Changelog: V1: * Using tabs instead of space. V2: * Remove unused map. V3: * Fixed speed-map indentation * Aligned brackets * Changed cooling-device * Increased temperature to 70°C V4: * Fixed syntax error. .../boot/dts/amlogic/meson-g12b-gsking-x.dts | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts b/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts index 6c7bfacba..23592ae21 100644 --- a/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts +++ b/arch/arm64/boot/dts/amlogic/meson-g12b-gsking-x.dts @@ -20,6 +20,14 @@ aliases { rtc1 = &vrtc; }; + gpio_fan: gpio-fan { + compatible = "gpio-fan"; + gpios = <&gpio GPIOH_5 GPIO_ACTIVE_HIGH>; + /* Using Dummy Speed */ + gpio-fan,speed-map = <0 0>, <1 1>; + #cooling-cells = <2>; + }; + gpio-keys-polled { compatible = "gpio-keys-polled"; #address-cells = <1>; @@ -96,6 +104,23 @@ &clkc_audio { status = "okay"; }; +&cpu_thermal { + trips { + cpu_active: cpu-active { + temperature = <70000>; /* millicelsius */ + hysteresis = <2000>; /* millicelsius */ + type = "active"; + }; + }; + + cooling-maps { + map { + trip = <&cpu_active>; + cooling-device = <&gpio_fan THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + }; +}; + &frddr_a { status = "okay"; };