Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp665315img; Fri, 22 Mar 2019 06:11:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqweivffPdL1TFOXhSFBUA6kbTccY2UWBv7hrqnZVsSEa1UoufrTijgyxLAdFWg7cFWze6re X-Received: by 2002:a63:1723:: with SMTP id x35mr8596612pgl.364.1553260297071; Fri, 22 Mar 2019 06:11:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553260297; cv=none; d=google.com; s=arc-20160816; b=WjD1vNqFshw7MILMWj8q32R4w0I8/MPIUCnJTuF4uDrr/FmMCJdKQwLfUCkOqhUX6f NiIlkRFYtfuihjAv2ODiKmDP6Dhwmu3eCh689N1JI2JOaIcPxuc4hFFr8dRV/mt8a8Dg aODhDBH3MLNkNc/xPcARGypSvfi0VX9S9QXRptpmKyx2x4RSZlf6alF5G2sZyawAYupX nb+tGSTpw7MyiRkOv1p/hoM657tVI0FeIY8P2EoK8YkZclP6qA1Eg/Mba0uWgUBsazqI IrP+wWXV+6F8cZ4zFivrGaS28obn9RsnesndYEagbieCmSYA0HUK/uH+EglXRq7W/PiR ZhOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=tyfM4l4Pth3Fa5XJTTM5TiLxYMz5W0I4wNmLy8gJ89g=; b=aFDg/0NNfsjMkFfMwCtsNVNTZ5NNGkiBhMJRyJvyQb7SuHg/ClPuRWpjr2K97vfrCR cNQZmcpDkNeyu4Lb2TyXjARi6Icrq4xIcs5siO5eWMP/gMhX0i/hf/0qzxeGzp415XQr IxkRPuPbFYTPyANMZJK0owM/sqbKeSRFYt4lgkE6H5lEOWaTuX5PNJI1Y3ohu56IEtVw SDeHJRAurFLTJAAPSzhZDGcoMxQxK+2t8SgvIsjWXZ3K+/EX+mo0f6+DjeK7WcWDUsiG UilojDJMVKfwp9DugT+DsdsdzsKyrTAk/OI4XHmrKXoBAcZAVRsln1EY3JYHsLFfbQ5R XIww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VjN/vkDp"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s35si6621326pgl.101.2019.03.22.06.11.21; Fri, 22 Mar 2019 06:11:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="VjN/vkDp"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730185AbfCVLd5 (ORCPT + 99 others); Fri, 22 Mar 2019 07:33:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:34378 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729953AbfCVLdw (ORCPT ); Fri, 22 Mar 2019 07:33:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3223E20449; Fri, 22 Mar 2019 11:33:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553254430; bh=wNG4OR0wEqkw1OhZm2xLYG6BEXk46yf6Dsskb5a6Ins=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=VjN/vkDpta90/UOBA1FgjQjaQ8pzbVia0StMUZ1EbOxdUOpnq35BTk5We5+4rGAzh Of7TuTwzBNKXzeEVUDF1FIgsw9AAFujVs/9Nv5rZO0vb7TyFplT9MChNM65WiTPl1s iylQWxpd+MpPEhugob4hmg2Urz3pfQApFJbGux1Q= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Eduardo Valentin , Javier Martinez Canillas , Anand Moon Subject: [PATCH 4.4 118/230] ARM: dts: exynos: Do not ignore real-world fuse values for thermal zone 0 on Exynos5420 Date: Fri, 22 Mar 2019 12:14:16 +0100 Message-Id: <20190322111244.935498203@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111236.796964179@linuxfoundation.org> References: <20190322111236.796964179@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Krzysztof Kozlowski commit 28928a3ce142b2e4e5a7a0f067cefb41a3d2c3f9 upstream. In Odroid XU3 Lite board, the temperature levels reported for thermal zone 0 were weird. In warm room: /sys/class/thermal/thermal_zone0/temp:32000 /sys/class/thermal/thermal_zone1/temp:51000 /sys/class/thermal/thermal_zone2/temp:55000 /sys/class/thermal/thermal_zone3/temp:54000 /sys/class/thermal/thermal_zone4/temp:51000 Sometimes after booting the value was even equal to ambient temperature which is highly unlikely to be a real temperature of sensor in SoC. The thermal sensor's calibration (trimming) is based on fused values. In case of the board above, the fused values are: 35, 52, 43, 58 and 43 (corresponding to each TMU device). However driver defined a minimum value for fused data as 40 and for smaller values it was using a hard-coded 55 instead. This lead to mapping data from sensor to wrong temperatures for thermal zone 0. Various vendor 3.10 trees (Hardkernel's based on Samsung LSI, Artik 10) do not impose any limits on fused values. Since we do not have any knowledge about these limits, use 0 as a minimum accepted fused value. This should essentially allow accepting any reasonable fused value thus behaving like vendor driver. The exynos5420-tmu-sensor-conf.dtsi is copied directly from existing exynos4412 with one change - the samsung,tmu_min_efuse_value. Signed-off-by: Krzysztof Kozlowski Acked-by: Bartlomiej Zolnierkiewicz Acked-by: Eduardo Valentin Reviewed-by: Javier Martinez Canillas Tested-by: Javier Martinez Canillas Reviewed-by: Anand Moon Tested-by: Anand Moon Signed-off-by: Greg Kroah-Hartman --- arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi | 25 ++++++++++++++++++++++ arch/arm/boot/dts/exynos5420.dtsi | 10 ++++---- 2 files changed, 30 insertions(+), 5 deletions(-) --- /dev/null +++ b/arch/arm/boot/dts/exynos5420-tmu-sensor-conf.dtsi @@ -0,0 +1,25 @@ +/* + * Device tree sources for Exynos5420 TMU sensor configuration + * + * Copyright (c) 2014 Lukasz Majewski + * Copyright (c) 2017 Krzysztof Kozlowski + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + */ + +#include + +#thermal-sensor-cells = <0>; +samsung,tmu_gain = <8>; +samsung,tmu_reference_voltage = <16>; +samsung,tmu_noise_cancel_mode = <4>; +samsung,tmu_efuse_value = <55>; +samsung,tmu_min_efuse_value = <0>; +samsung,tmu_max_efuse_value = <100>; +samsung,tmu_first_point_trim = <25>; +samsung,tmu_second_point_trim = <85>; +samsung,tmu_default_temp_offset = <50>; +samsung,tmu_cal_type = ; --- a/arch/arm/boot/dts/exynos5420.dtsi +++ b/arch/arm/boot/dts/exynos5420.dtsi @@ -777,7 +777,7 @@ interrupts = <0 65 0>; clocks = <&clock CLK_TMU>; clock-names = "tmu_apbif"; - #include "exynos4412-tmu-sensor-conf.dtsi" + #include "exynos5420-tmu-sensor-conf.dtsi" }; tmu_cpu1: tmu@10064000 { @@ -786,7 +786,7 @@ interrupts = <0 183 0>; clocks = <&clock CLK_TMU>; clock-names = "tmu_apbif"; - #include "exynos4412-tmu-sensor-conf.dtsi" + #include "exynos5420-tmu-sensor-conf.dtsi" }; tmu_cpu2: tmu@10068000 { @@ -795,7 +795,7 @@ interrupts = <0 184 0>; clocks = <&clock CLK_TMU>, <&clock CLK_TMU>; clock-names = "tmu_apbif", "tmu_triminfo_apbif"; - #include "exynos4412-tmu-sensor-conf.dtsi" + #include "exynos5420-tmu-sensor-conf.dtsi" }; tmu_cpu3: tmu@1006c000 { @@ -804,7 +804,7 @@ interrupts = <0 185 0>; clocks = <&clock CLK_TMU>, <&clock CLK_TMU_GPU>; clock-names = "tmu_apbif", "tmu_triminfo_apbif"; - #include "exynos4412-tmu-sensor-conf.dtsi" + #include "exynos5420-tmu-sensor-conf.dtsi" }; tmu_gpu: tmu@100a0000 { @@ -813,7 +813,7 @@ interrupts = <0 215 0>; clocks = <&clock CLK_TMU_GPU>, <&clock CLK_TMU>; clock-names = "tmu_apbif", "tmu_triminfo_apbif"; - #include "exynos4412-tmu-sensor-conf.dtsi" + #include "exynos5420-tmu-sensor-conf.dtsi" }; thermal-zones {