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: 10262065 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 4E02F6016D for ; Tue, 6 Mar 2018 14:50:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DA7929038 for ; Tue, 6 Mar 2018 14:50:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3211E2903C; Tue, 6 Mar 2018 14:50:48 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable 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 3FF9329041 for ; Tue, 6 Mar 2018 14:50:46 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-reply-to: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:List-Owner; bh=Ti40QHiSArCrOuikLfpdY7pmM24t1UZpSkB/4EloowI=; b=U3hbAq6GTQYF7v0LClfrnL9+/O VB3XeCXdnkZrjC6NVzGx58mkDIRC7GhWvN5z7zKUT6B4a1Nv91WBH+RbtVdhb9gWksU+VERiSIpC+ sKmV0MmNsFqnsOpQLlpL0Wfk9oeQVSFbmEua6615g7RKcXNO4D8E1VX89+DzX/tFEZV49QXCSKQZj NPajer5Oqxl7NDzTYJuqYu7t53cGudfjHu+3/U7v2dQyGmL8qy2l3RF5tz2ahwAjCNvUPZbeUuXgT 2Ii8gfxDJcp3JT/gulvSx5fGU2zSrU7vcOagtx0bqSjoZViRI2sl8jBfX1tiq0am1XgkxRi9OuiX+ s+4U5J8Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.89 #1 (Red Hat Linux)) id 1etDvB-00019F-7X; Tue, 06 Mar 2018 14:50:29 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etDs3-0006bs-CQ for linux-arm-kernel@bombadil.infradead.org; Tue, 06 Mar 2018 14:47:15 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=References:In-reply-to:Message-id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=NsAELKvZyz3AqqPtaTNeVqpygaHjdDjdsjwjwDv9gxo=; b=PRmIY7Htbs4+mo75+xfpL7uom yGmDRja4//OouB+RA8sTaFChkn6HljoMz9+wBVaSIkVWr7DQtUOTIcXr8FeNa5C95cYsQD/v3kopE Gp3pK+yQ3nu+lxpfnsEC1cAXkmkWV5rh2v1j98Xkki710hdLDEmS5mCJCfTos8WTfP2KAyXkdltZE 17pMhZA6TcmnTQTtqAfSV9OwEMccWWjV607LBq7kR4pbJZQWIt5kDkGdU8o5/oX0xfOh+NJ2nUNru +vcZpdZKVfxwnecVWVlZHKqsGAZJwLdyeVzCRZV57yDVXgD/0ktHeHWn8zxw0dELB+Tp5RVO3pdCu vzTdMtqRw==; Received: from mailout4.samsung.com ([203.254.224.34]) by casper.infradead.org with esmtps (Exim 4.89 #1 (Red Hat Linux)) id 1etDpn-0001lc-VI for linux-arm-kernel@lists.infradead.org; Tue, 06 Mar 2018 14:44:59 +0000 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 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 OMsksWP7O7BuYYEciemz2tlBbBYBVYkd7zvA4rwCH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4T+vCgh3pTEyqrUovz4otKc1OJDjNIcLErivPz5xyKFBNITS1KzU1MLUotgskwc nFINjIqcVlVTfboPz3vDFsKkU/PrdbKWd/Dd4leGvl8jEu/kF0VVPNmym8siZpK+9AXrwzKC a4Vb3l3izpk9RfJciUnOmcdTs0MO5ew7v1N457Nb0v7ML/PZX1olnGaU/2dzXjhuZ0uAqUX1 07pVMxw7dSYz9TcKB5+xmzbb4L/pAbmd8Q4ciXWrlViKMxINtZiLihMBUvrv1EsCAAA= 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180306_144456_537522_5721EAA1 X-CRM114-Status: GOOD ( 12.47 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , devicetree@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, b.zolnierkie@samsung.com, Russell King , Rob Herring , linux-kernel@vger.kernel.org, Kukjin Kim , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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; };