From patchwork Tue Mar 6 14:43:45 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 10262045 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F2D8560596 for ; Tue, 6 Mar 2018 14:48:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E2EAF29010 for ; Tue, 6 Mar 2018 14:48:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D7CEB2901E; Tue, 6 Mar 2018 14:48:54 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B6CB29020 for ; Tue, 6 Mar 2018 14:48:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753598AbeCFOsi (ORCPT ); Tue, 6 Mar 2018 09:48:38 -0500 Received: from mailout1.samsung.com ([203.254.224.24]:53271 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932773AbeCFOok (ORCPT ); Tue, 6 Mar 2018 09:44:40 -0500 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180306144437epoutp018d2cb4533f36e55fd22fc60fb2462878~ZW-nNsyO42727327273epoutp01N; Tue, 6 Mar 2018 14:44:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180306144437epoutp018d2cb4533f36e55fd22fc60fb2462878~ZW-nNsyO42727327273epoutp01N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1520347477; bh=CEzr3cfHWVid9vqR/Vex8k9p65G2F0qVz1bKziMR/ZY=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=XUSSvtTfmtmF5q9HEGAQgaggSSeT+fXXyI9UEHuaeupdUZ5Fv1BV3EBvDC/QItp2b 8HFp4AnUDVYFKQ6gWlK7XapNpIqD90JQPpmrjKJK0B4TUJDHXPAnPwcMpx220mQvp0 ++fWce1QjZmyzHNHXgi+ou+Aff6gYPRtRfZN3rwc= Received: from epsmges2p1.samsung.com (unknown [182.195.42.69]) by epcas2p4.samsung.com (KnoxPortal) with ESMTP id 20180306144437epcas2p4adfe81d9d3631a4cd795aee2167fc022~ZW-m3CqC61830318303epcas2p4H; Tue, 6 Mar 2018 14:44:37 +0000 (GMT) Received: from epcas2p4.samsung.com ( [182.195.41.56]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 07.DE.04131.559AE9A5; Tue, 6 Mar 2018 23:44:37 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20180306144436epcas2p2f26ee2297cbd0e654930e8bb85512fe6~ZW-l5HTGF0522005220epcas2p2g; Tue, 6 Mar 2018 14:44:36 +0000 (GMT) X-AuditID: b6c32a45-3ebff70000001023-d4-5a9ea9551a45 Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 38.C3.03890.359AE9A5; Tue, 6 Mar 2018 23:44:36 +0900 (KST) Received: from AMDC3058.DIGITAL.local ([106.120.53.102]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P56000X0BLSFM10@mmp1.samsung.com>; Tue, 06 Mar 2018 23:44:35 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Zhang Rui , Eduardo Valentin , Krzysztof Kozlowski Cc: Kukjin Kim , Rob Herring , Mark Rutland , Russell King , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 02/12] thermal: exynos: remove parsing of samsung,tmu_default_temp_offset property Date: Tue, 06 Mar 2018 15:43:45 +0100 Message-id: <1520347435-22970-3-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1520347435-22970-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEIsWRmVeSWpSXmKPExsWy7bCmhW7oynlRBi/ucVlsnLGe1WL+kXNA 4so1Vov+x6+ZLc6f38BusekxkHt51xw2i8+9RxgtZpzfx2RxaOpeRoul1y8yWbTuPcJu8eRh H5sDr8eaeWsYPS5fu8jssXPWXXaPxXteMnlsWtXJ5rF5Sb1H35ZVjB6fN8kFcERx2aSk5mSW pRbp2yVwZWy9Mp+5oEukonPCH5YGxs8CXYycHBICJhJ3tqxg7mLk4hAS2MEocfLzMijnO6NE x/qvbDBV7/40skAkdjNKTGhdywbh/GKUWPxqHzNIFZuAlcTE9lWMILaIQInEtFW9jCBFzAJn mSR2bH/HApIQFkiRuH7wMTuIzSKgKtHV/hqsmVfAQ2LRMph1chInj01mBbE5BTwlTnScA9sm IXCETeLZ9fdMEEUuEqf6JkDZwhKvjm9hh7ClJZ6t2sgI0dDMKPFtxx5miMQERok964UgbGuJ w8cvgm1gFuCT6Dj8F6iZAyjOK9HRBlXiIXHy/TuoVkeJQ1ca2SFensMoceT+a6YJjFILGBlW MYqlFhTnpqcWGxUY6hUn5haX5qXrJefnbmIEx7yW6w7GGed8DjEKcDAq8fBu8JgbJcSaWFZc mXuIUYKDWUmE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: 20180306144436epcas2p2f26ee2297cbd0e654930e8bb85512fe6 X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180306144436epcas2p2f26ee2297cbd0e654930e8bb85512fe6 X-RootMTR: 20180306144436epcas2p2f26ee2297cbd0e654930e8bb85512fe6 References: <1520347435-22970-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Trimming (one point based or two points based) is always used for the temperature calibration and the default non-trimming code should never be reached. Modify temp_to_code() and code_to_temp() accordingly (WARN_ON(1) in the default cases) and then remove no longer needed parsing of samsung,tmu_default_temp_offset property. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/samsung/exynos_tmu.c | 6 ++---- drivers/thermal/samsung/exynos_tmu.h | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index ed805c7..e42a08b 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -260,7 +260,7 @@ static int temp_to_code(struct exynos_tmu_data *data, u8 temp) temp_code = temp + data->temp_error1 - pdata->first_point_trim; break; default: - temp_code = temp + pdata->default_temp_offset; + WARN_ON(1); break; } @@ -287,7 +287,7 @@ static int code_to_temp(struct exynos_tmu_data *data, u16 temp_code) temp = temp_code - data->temp_error1 + pdata->first_point_trim; break; default: - temp = temp_code - pdata->default_temp_offset; + WARN_ON(1); break; } @@ -1164,8 +1164,6 @@ static int exynos_of_sensor_conf(struct device_node *np, pdata->first_point_trim = (u8)value; of_property_read_u32(np, "samsung,tmu_second_point_trim", &value); pdata->second_point_trim = (u8)value; - of_property_read_u32(np, "samsung,tmu_default_temp_offset", &value); - pdata->default_temp_offset = (u8)value; of_property_read_u32(np, "samsung,tmu_cal_type", &pdata->cal_type); diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h index 8c468b6..a7e81b4 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h @@ -50,7 +50,6 @@ enum soc_type { * @efuse_value: platform defined fuse value * @min_efuse_value: minimum valid trimming data * @max_efuse_value: maximum valid trimming data - * @default_temp_offset: default temperature offset in case of no trimming * @cal_type: calibration type for temperature * * This structure is required for configuration of exynos_tmu driver. @@ -65,7 +64,6 @@ struct exynos_tmu_platform_data { u32 max_efuse_value; u8 first_point_trim; u8 second_point_trim; - u8 default_temp_offset; u32 cal_type; };