From patchwork Mon Jan 6 17:46:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 11319729 X-Patchwork-Delegate: daniel.lezcano@linaro.org Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A8ABA930 for ; Mon, 6 Jan 2020 17:46:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 87EEA21744 for ; Mon, 6 Jan 2020 17:46:44 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="t0vgrTSV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726612AbgAFRqo (ORCPT ); Mon, 6 Jan 2020 12:46:44 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:38107 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbgAFRqn (ORCPT ); Mon, 6 Jan 2020 12:46:43 -0500 Received: by mail-pg1-f195.google.com with SMTP id a33so27189278pgm.5; Mon, 06 Jan 2020 09:46:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=YdPHerSYFOJLKYefQHipXAmsHXvXtkbfyGcWcsin/Eo=; b=t0vgrTSVmmj/57ZBr/Sm79BsA7lylrWcfhlGn3rqkCJQCiNewUgV8qMRVWd8rd+egl y4YVUkO7FONNsn1TClHXBiMGXvlSzd8EjZHCxDyfZ8/ypJCvTGSy8kp4u/luDiWgNpte /xuomSpMzKHv0y+ZJvGamupdnU4OhCIJqHfkhjDpnrsSs1rV4bksqvmVVGeldtCqIFk/ 819/hKDzWB8e247vq3PjjUkLt61zIYtkRKmSMFad+FWT6x6C6Jcsl1fq+RH6GheqS9+k 1403NTO1gKuKwNcYpL902uwwL6oQ+rariS58bn2hsAqJ3rxjl1Eqtojz7ewaRqFZIAVH LL/w== 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; bh=YdPHerSYFOJLKYefQHipXAmsHXvXtkbfyGcWcsin/Eo=; b=pOwWaKC7mQ2CfgaJItXKNrop3Muuhm0LdQvXWhraQrgUDnNhhFkNOqmbpcn0rUcn2v +TM8LNPZSAS37Rlyp/p7ltcQG7DGsWWzh2FYTra6jSujrxFFLAfhWx8DfLSlf2mQeFOU eDV/yman44bQaqOxgb350jQhcrY8CjMM8BRbFzO9TRnSwOiIIxwNdEXD9Tbq6TgvVR6v QE3RhAkEUgY5aI3iKNKeV69xz31BdZ9gxMvGb4+xv++MrK8ZbUo0mDwAMKrvlbdAFXdB gQmp0bs2ykyVTVthrkiOfRvdk6bGOHEbIhrQHirUYNj3gHa9Yn/i5HVuDbmEQlmjhkTz Ablg== X-Gm-Message-State: APjAAAXpyVoc7RK98S0L3q8XbjbZuWy7KIm1JR8oyMTq7q/26/RM4TBj Up1QFblKZuymomVBqlb7Z7o= X-Google-Smtp-Source: APXvYqwNzPNo38qKaDE4TWjCFQ11EAzeBDsfFL07gxRaNNMnBA7f1Wmk2ubLY9y2gRba8Y9FzmQz5w== X-Received: by 2002:aa7:874a:: with SMTP id g10mr91607578pfo.205.1578332803309; Mon, 06 Jan 2020 09:46:43 -0800 (PST) Received: from localhost ([2001:19f0:6001:12c8:5400:2ff:fe72:6403]) by smtp.gmail.com with ESMTPSA id z4sm25051105pjn.29.2020.01.06.09.46.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Jan 2020 09:46:42 -0800 (PST) From: Yangtao Li To: robh+dt@kernel.org, mark.rutland@arm.com, mripard@kernel.org, wens@csie.org, anarsoul@gmail.com, rui.zhang@intel.com, daniel.lezcano@linaro.org, amit.kucheria@verdurent.com, megous@megous.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Yangtao Li Subject: [PATCH v2 1/2] thermal: sun8i: fix r40 ths number Date: Mon, 6 Jan 2020 17:46:38 +0000 Message-Id: <20200106174639.20862-1-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.1 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org According to the spec, r40 has 2 thermal sensors. Sensor0 located in the CPU, another in the GPU. Fixes: 730a45ccd9322 ("thermal/drivers/sun8i: Add thermal driver for H6/H5/H3/A64/A83T/R40") Signed-off-by: Yangtao Li Tested-by: Corentin Labbe Tested-on: sun8i-r40-bananapi-m2-ultra --- drivers/thermal/sun8i_thermal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/thermal/sun8i_thermal.c b/drivers/thermal/sun8i_thermal.c index 23a5f4aa4be4..c5661d7c3e20 100644 --- a/drivers/thermal/sun8i_thermal.c +++ b/drivers/thermal/sun8i_thermal.c @@ -565,7 +565,7 @@ static const struct ths_thermal_chip sun8i_h3_ths = { }; static const struct ths_thermal_chip sun8i_r40_ths = { - .sensor_num = 3, + .sensor_num = 2, .offset = 251086, .scale = 1130, .has_mod_clk = true, From patchwork Mon Jan 6 17:46:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yangtao Li X-Patchwork-Id: 11319733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EC140921 for ; Mon, 6 Jan 2020 17:46:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CAEC5214D8 for ; Mon, 6 Jan 2020 17:46:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UaFPkDcs" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726708AbgAFRqq (ORCPT ); Mon, 6 Jan 2020 12:46:46 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:36518 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726448AbgAFRqq (ORCPT ); Mon, 6 Jan 2020 12:46:46 -0500 Received: by mail-pf1-f196.google.com with SMTP id x184so27285183pfb.3; Mon, 06 Jan 2020 09:46:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EiXC/MriP+cdpOhem11vYI94GWNz0CCSOZkGZBL2d9U=; b=UaFPkDcsmqcQKqX3+FYyaP9kZ89B9Q3kyv4mqMnp/Jm8+bImb4IYLtjvkl80f8bXUh 1f8UPPP63XiKkYuEnJaX9ZtGFspbz/vMd06l0aTs+BN8Jo/W/5gXW/IXAUSbZm0CHq7J 8JTR+1I5hdf9CRStbAS5cAUI/wAcG8hFXl+HxcAJZLUe5c80zANFiwcOfx9/mICBeypY MXEDARX/OLFgTLuELG4sdsv4aV06RkdtQ9AB4nwrNDzw+FUUKopybwhrQyccBhDNcQEZ SGeOiBSMvTGMHOnbiCYU+UqKqCiou19nibQ1jnRZCEwYMsoz4KmGd3IyouMy8hWypYJW cO7Q== 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:in-reply-to :references; bh=EiXC/MriP+cdpOhem11vYI94GWNz0CCSOZkGZBL2d9U=; b=iZl5DPTplBWMac7Oih7oQMc2K/wu8t2eTqZ4J3QwIYlM4X6l6pEki6qMGo92bl6r1E afOwrojtCjjOr5icJtygmBfvfB5WHBbd8l8NyJuyQaz47EcdsML2n+QZxOD/C954H0cv v93E1pi7zyGYlXvCj9SJKiDEr7khjrjfHMli+ghjcD5yW+QpgeIFJh/u2HHTFogGvJuA lMn/9g+vzUJ5hNs2GL5HwYqjP+BsMBxK+lBI73hG2j6TeBmvYjNKagr42mXGYM1LqZ7q SJ5j2K2D1ZPSYBnjlOBPxvbnGW3iIJJVtaeyF3fDHBaWZeb8BFztJi2Gr1/KGfFsXA4M Xhvw== X-Gm-Message-State: APjAAAWinLYsFcR8O/6UwQRQ+sg89MdwefneO2sSxAeDF2TZQlWCziIR fvEFMoO+tH3ajQ3NRxycSnY= X-Google-Smtp-Source: APXvYqzsNn60tFIDS08//elWhClHXWYYTqFBsfumM81M+fXB1pfEhQnuBltx+uVuXKE/434H9TCGeg== X-Received: by 2002:aa7:96f9:: with SMTP id i25mr111741807pfq.161.1578332805413; Mon, 06 Jan 2020 09:46:45 -0800 (PST) Received: from localhost ([2001:19f0:6001:12c8:5400:2ff:fe72:6403]) by smtp.gmail.com with ESMTPSA id l2sm59166879pff.59.2020.01.06.09.46.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 Jan 2020 09:46:44 -0800 (PST) From: Yangtao Li To: robh+dt@kernel.org, mark.rutland@arm.com, mripard@kernel.org, wens@csie.org, anarsoul@gmail.com, rui.zhang@intel.com, daniel.lezcano@linaro.org, amit.kucheria@verdurent.com, megous@megous.com, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Cc: Yangtao Li Subject: [PATCH v2 2/2] ARM: dts: sun8i-r40: Add thermal sensor and thermal zones Date: Mon, 6 Jan 2020 17:46:39 +0000 Message-Id: <20200106174639.20862-2-tiny.windzz@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200106174639.20862-1-tiny.windzz@gmail.com> References: <20200106174639.20862-1-tiny.windzz@gmail.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org There are two sensors, sensor0 for CPU, sensor1 for GPU. Signed-off-by: Yangtao Li Tested-by: Corentin Labbe Tested-on: sun8i-r40-bananapi-m2-ultra --- arch/arm/boot/dts/sun8i-r40.dtsi | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/arch/arm/boot/dts/sun8i-r40.dtsi b/arch/arm/boot/dts/sun8i-r40.dtsi index 421dfbbfd7ee..8ccda5cb873f 100644 --- a/arch/arm/boot/dts/sun8i-r40.dtsi +++ b/arch/arm/boot/dts/sun8i-r40.dtsi @@ -46,6 +46,7 @@ #include #include #include +#include / { #address-cells = <1>; @@ -109,6 +110,22 @@ status = "disabled"; }; + thermal-zones { + cpu_thermal: cpu0-thermal { + /* milliseconds */ + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 0>; + }; + + gpu_thermal: gpu-thermal { + /* milliseconds */ + polling-delay-passive = <0>; + polling-delay = <0>; + thermal-sensors = <&ths 1>; + }; + }; + soc { compatible = "simple-bus"; #address-cells = <1>; @@ -421,6 +438,17 @@ clocks = <&osc24M>; }; + ths: thermal-sensor@1c24c00 { + compatible = "allwinner,sun8i-r40-ths"; + reg = <0x01c24c00 0x100>; + clocks = <&ccu CLK_BUS_THS>, <&ccu CLK_THS>; + clock-names = "bus", "mod"; + interrupts = ; + resets = <&ccu RST_BUS_THS>; + /* TODO: add nvmem-cells for calibration */ + #thermal-sensor-cells = <1>; + }; + uart0: serial@1c28000 { compatible = "snps,dw-apb-uart"; reg = <0x01c28000 0x400>;