From patchwork Tue Mar 6 14:43:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 10262031 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 A11FE6055D for ; Tue, 6 Mar 2018 14:48:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8D3C2286B7 for ; Tue, 6 Mar 2018 14:48:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 81B0228F7A; Tue, 6 Mar 2018 14:48:21 +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 2188A286B7 for ; Tue, 6 Mar 2018 14:48:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753065AbeCFOot (ORCPT ); Tue, 6 Mar 2018 09:44:49 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:63080 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932313AbeCFOoo (ORCPT ); Tue, 6 Mar 2018 09:44:44 -0500 Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20180306144441epoutp0421b06723c1523e4e2cb62a51895bebdb~ZW-q9Eler1173611736epoutp04Q; Tue, 6 Mar 2018 14:44:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20180306144441epoutp0421b06723c1523e4e2cb62a51895bebdb~ZW-q9Eler1173611736epoutp04Q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1520347481; bh=NsAELKvZyz3AqqPtaTNeVqpygaHjdDjdsjwjwDv9gxo=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=szN8LLHr4VNDTGhkXxZZOgAainC5fFKQAVZF0UdTMox1YDDGjJ/6peE0UGsozpY3f jU8XWgObubkPnxoyNfzM1JadjNMMPYac5qwPDu0/RSot2uIyw/ZUb1lELBKWRP/Db4 LEFRDBLmKwgsE3xSFRFJ4lfIrEmaQPjwTbs7PJCw= Received: from epsmges2p1.samsung.com (unknown [182.195.42.69]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20180306144441epcas2p398c30c72efaa749658f71dcc68311156~ZW-qfjSNk2139821398epcas2p3n; Tue, 6 Mar 2018 14:44:41 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 08.DE.04131.959AE9A5; Tue, 6 Mar 2018 23:44:41 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20180306144440epcas2p30fd2531c12454051bfe6ae0cf0d35b2e~ZW-p_nYul2115621156epcas2p3f; Tue, 6 Mar 2018 14:44:40 +0000 (GMT) X-AuditID: b6c32a45-3ebff70000001023-da-5a9ea959e3dc Received: from epmmp1.local.host ( [203.254.227.16]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 39.C3.03890.859AE9A5; Tue, 6 Mar 2018 23:44:40 +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:40 +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 03/12] thermal: exynos: remove parsing of samsung,tmu_[first,second]_point_trim properties Date: Tue, 06 Mar 2018 15:43:46 +0100 Message-id: <1520347435-22970-4-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+NgFnrAIsWRmVeSWpSXmKPExsWy7bCmuW7kynlRBrfms1tsnLGe1WL+kXNA 4so1Vov+x6+ZLc6f38BusekxkHt51xw2i8+9RxgtZpzfx2RxaOpeRoul1y8yWbTuPcJu8eRh H5sDr8eaeWsYPS5fu8jssXPWXXaPxXteMnlsWtXJ5rF5Sb1H35ZVjB6fN8kFcERx2aSk5mSW pRbp2yVwZXzYt52l4KZUxasLC1gaGLeKdTFyckgImEjM2jmHtYuRi0NIYAejxLqda5lBEkIC 3xkllvSqwBS9WLONBSK+m1FiRWcCRMMvRomPH9YzgSTYBKwkJravYgSxRQRKJKat6mUEKWIW OMsksWP7O7BuYYEciemz2tlBbBYBVYkd7zvA4rwCHhIrrk9ggtgmJ3Hy2GRWEJtTwFPiRMc5 NpBBEgIn2CQuf9zNDlHkInGmfzILhC0s8er4Fqi4tMSzVRsZIRqaGSW+7djDDJGYwCixZ70Q hG0tcfj4RbANzAJ8Eh2H/wI1cwDFeSU62qBKPCRmXmphhLAdJTonn2KGeHkOo8Sl+R+YJjBK LWBkWMUollpQnJueWmxUYKhXnJhbXJqXrpecn7uJERzvWq47GGec8znEKMDBqMTDu8FjbpQQ a2JZcWXuIUYJDmY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sCAAA= X-CMS-MailID: 20180306144440epcas2p30fd2531c12454051bfe6ae0cf0d35b2e X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180306144440epcas2p30fd2531c12454051bfe6ae0cf0d35b2e X-RootMTR: 20180306144440epcas2p30fd2531c12454051bfe6ae0cf0d35b2e 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 All SoCs use the same values (25, 85) for trim points (except Exynos5440 which currently specifices value 70 for the second trim point -> it seems to be a mistake because documentation uses value 85 and two points based trimming has never been used by the driver for this SoC anyway) so just make it explicit and remove parsing of samsung,tmu_[first,second]_point_trim properties. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/samsung/exynos_tmu.c | 20 +++++++++----------- drivers/thermal/samsung/exynos_tmu.h | 2 -- 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index e42a08b..5877dd4 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -165,6 +165,9 @@ #define EXYNOS7_EMUL_DATA_SHIFT 7 #define EXYNOS7_EMUL_DATA_MASK 0x1ff +#define EXYNOS_FIRST_POINT_TRIM 25 +#define EXYNOS_SECOND_POINT_TRIM 85 + #define MCELSIUS 1000 /** * struct exynos_tmu_data : A structure to hold the private data of the TMU @@ -251,13 +254,13 @@ static int temp_to_code(struct exynos_tmu_data *data, u8 temp) switch (pdata->cal_type) { case TYPE_TWO_POINT_TRIMMING: - temp_code = (temp - pdata->first_point_trim) * + temp_code = (temp - EXYNOS_FIRST_POINT_TRIM) * (data->temp_error2 - data->temp_error1) / - (pdata->second_point_trim - pdata->first_point_trim) + + (EXYNOS_SECOND_POINT_TRIM - EXYNOS_FIRST_POINT_TRIM) + data->temp_error1; break; case TYPE_ONE_POINT_TRIMMING: - temp_code = temp + data->temp_error1 - pdata->first_point_trim; + temp_code = temp + data->temp_error1 - EXYNOS_FIRST_POINT_TRIM; break; default: WARN_ON(1); @@ -279,12 +282,12 @@ static int code_to_temp(struct exynos_tmu_data *data, u16 temp_code) switch (pdata->cal_type) { case TYPE_TWO_POINT_TRIMMING: temp = (temp_code - data->temp_error1) * - (pdata->second_point_trim - pdata->first_point_trim) / + (EXYNOS_SECOND_POINT_TRIM - EXYNOS_FIRST_POINT_TRIM) / (data->temp_error2 - data->temp_error1) + - pdata->first_point_trim; + EXYNOS_FIRST_POINT_TRIM; break; case TYPE_ONE_POINT_TRIMMING: - temp = temp_code - data->temp_error1 + pdata->first_point_trim; + temp = temp_code - data->temp_error1 + EXYNOS_FIRST_POINT_TRIM; break; default: WARN_ON(1); @@ -1160,11 +1163,6 @@ static int exynos_of_sensor_conf(struct device_node *np, of_property_read_u32(np, "samsung,tmu_max_efuse_value", &pdata->max_efuse_value); - of_property_read_u32(np, "samsung,tmu_first_point_trim", &value); - 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_cal_type", &pdata->cal_type); of_node_put(np); diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h index a7e81b4..a5d8c9c 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++ b/drivers/thermal/samsung/exynos_tmu.h @@ -62,8 +62,6 @@ struct exynos_tmu_platform_data { u32 efuse_value; u32 min_efuse_value; u32 max_efuse_value; - u8 first_point_trim; - u8 second_point_trim; u32 cal_type; };