From patchwork Sun Sep 30 15:50:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Bergas X-Patchwork-Id: 10621435 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F9ED14BD for ; Sun, 30 Sep 2018 15:51:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C0B529169 for ; Sun, 30 Sep 2018 15:51:07 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6BD0529192; Sun, 30 Sep 2018 15:51:07 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 426BE29169 for ; Sun, 30 Sep 2018 15:51:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject: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=i11KJvxD3OrDtZpUyoNW6yku4elkkxwTs0ruvM71IY8=; b=cn2B2XNUIKp0vE 0vyBPQLNHKhdq0cqoBv8cjyk3k8xQqXateYAiE9eRuVE0laV711vZQk8+5wspyL5bEXlG4G7RP3Jg BlpmRO06IcEwJI/+Kjw+fFHUXfJAIA7aG0lW1BP1NZVZa3+kPoSgOpmzpgfIBEYexvZCQiFnxEjwP p+UfRBaRyPYimnpZ0tYb0W5T/vFfGXO0gm3Sbqpz01Yfd69aJOGLzm1E8/hEizM6Dzi81TIJ+lM4m J8BhYaxwANfvbwrpcuL7lsTGm0BDF8AXNvu2Gx2i4s4Kp7stbOCwU6lJ4x5TpxdWyGRCOQ6jpaTFB x7c8YsbuBlZ+hcfjkwng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g6dzq-0004uX-Cw; Sun, 30 Sep 2018 15:51:02 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g6dzm-0004mv-Bd for linux-rockchip@lists.infradead.org; Sun, 30 Sep 2018 15:51:00 +0000 Received: by mail-wr1-x444.google.com with SMTP id 63-v6so3858624wra.11 for ; Sun, 30 Sep 2018 08:50:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YVDMcfLwNfnHm7EDBRNbJWGqiiCj9uvobJxrUPjxs0o=; b=V/vo9xPhtp1Cxbk7wriBL4O6fswZPxWqGUc38sN1Cwr5PZ9e0exwfozmqMhoPAHA++ /mx0O5exxe+B2hxzlcq1mbXuTEd7XspR81H3ASI/XJ2DpsGuGMRXkSuoZTAYQEFPvKmf M2CkXykOnUICENsNZoZqa4vqZKZU2GGT20TR4rJ5PEoPIypbF8EiWiAPlwOk13Do0sdD ZFGZ0JKvoEozNr6cfM8UwYrG1jWhqCPXbA2A1hBIcYxGJ6cqtbcEYKRALa3cHaIpELfh ngktS9rfnl5t3bC7z0DNiAJky4zZOXlh14VoBYW1iVhFI2ttF4KGk18AZhWd5lH9IDaC VtCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=YVDMcfLwNfnHm7EDBRNbJWGqiiCj9uvobJxrUPjxs0o=; b=NHmuj2Mph1F92qBR9UWi45SgpbK3as0OHsnSyylUCNf8UDhEOgGTfzn8uKWPIh7SCI hpBpwviyvtjMWKzTOsbAsPaqTzAhuEMmo94eVGkZTuNPdzG0yXbpN29SDsQCTBIaL6UM yRUHENAYkL65tvllmr6k3jPnZccWHavfmMULaqUaAiuNPsIH1LsM4XIJ7+bNqB+XduPI YPCZh5tXajIEYOPjE+emG38PG0qRSORjzh0lufhp2VQfzELTYjB2tZqFMp9CL35JdDJH rQFyu7hTiEAfdy9zS1dtjWN1dwO2rpJi3eyCGdMj8JexNWcPMO5T6n8YIPoMKfQoMwXV nL7w== X-Gm-Message-State: ABuFfohS7V2rCbcCNY+ZIK6OIY8oPY9x7FruiKFHaPzat99DpAp4KUzc hK55x4ozodDBe5yuAwUBQzk= X-Google-Smtp-Source: ACcGV60hv6T9e/o03jTYfrxeuOkyIFjpRUrSEB+zO8mnzV9GVpUJfc7LgMzaVOvxFHm6Sxp353sVsw== X-Received: by 2002:adf:e8d2:: with SMTP id k18-v6mr4413694wrn.104.1538322644722; Sun, 30 Sep 2018 08:50:44 -0700 (PDT) Received: from localhost.localdomain ([92.59.184.0]) by smtp.gmail.com with ESMTPSA id a105-v6sm28319329wrc.23.2018.09.30.08.50.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Sep 2018 08:50:43 -0700 (PDT) From: Vicente Bergas To: Heiko Stuebner , linux-rockchip@lists.infradead.org Subject: [PATCH] arm64: dts: rockchip: add fan on Sapphire board Date: Sun, 30 Sep 2018 17:50:33 +0200 Message-Id: <20180930155033.31105-1-vicencb@gmail.com> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180930_085058_428089_156B2108 X-CRM114-Status: GOOD ( 12.87 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vicente Bergas Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The Sapphire board has a 12V fan. So, adding it to the DTS. There is no power supply directly connected, it needs the baseboard to work. If the board is used standalone then a hardware modification is needed. On the Sapphire board there is an unpopulated resistor to connect it to VBUS_TYPEC, which is usually 5V (too low) and can range up to 20V (too high). I tested it for a week connected to VCC_SYS which is 8.4V and proved to be more than enough for the required cooling needs. This is the connection described in the comment. Signed-off-by: Vicente Bergas --- .../boot/dts/rockchip/rk3399-sapphire.dtsi | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi index 5421e23760c3..90d813bdabde 100644 --- a/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi +++ b/arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi @@ -66,6 +66,19 @@ regulator-max-microvolt = <12000000>; }; + /* + * The fan power supply comes from the baseboard. + * For the standalone Sapphire one option is to connect a wire + * from R90030 DNP R0805 pin2 to C90002 10uF C0805 pin1 (vcc_sys). + */ + fan0: gpio-fan { + #cooling-cells = <2>; + compatible = "gpio-fan"; + gpio-fan,speed-map = <0 0 3000 1>; + gpios = <&gpio1 RK_PC2 GPIO_ACTIVE_HIGH>; + status = "okay"; + }; + keys: gpio-keys { compatible = "gpio-keys"; autorepeat; @@ -183,6 +196,24 @@ cpu-supply = <&vdd_cpu_b>; }; +&cpu_thermal { + trips { + cpu_hot: cpu_hot { + hysteresis = <10000>; + temperature = <55000>; + type = "active"; + }; + }; + + cooling-maps { + map2 { + cooling-device = + <&fan0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + trip = <&cpu_hot>; + }; + }; +}; + &emmc_phy { status = "okay"; }; @@ -472,6 +503,13 @@ }; }; + fan { + motor_pwr: motor-pwr { + rockchip,pins = + ; + }; + }; + pmic { pmic_int_l: pmic-int-l { rockchip,pins =