From patchwork Mon Apr 16 10:11:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bartlomiej Zolnierkiewicz X-Patchwork-Id: 10342575 X-Patchwork-Delegate: eduardo.valentin@ti.com 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 A1E3260365 for ; Mon, 16 Apr 2018 10:17:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9214A28635 for ; Mon, 16 Apr 2018 10:17:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86AB12863B; Mon, 16 Apr 2018 10:17:14 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI 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 20BAC28632 for ; Mon, 16 Apr 2018 10:17:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754264AbeDPKRA (ORCPT ); Mon, 16 Apr 2018 06:17:00 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:61744 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753823AbeDPKOC (ORCPT ); Mon, 16 Apr 2018 06:14:02 -0400 Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180416101400epoutp01ef6aa6ace837884ef9abaac3c9cb5384~l4wCs8UUt2798927989epoutp014; Mon, 16 Apr 2018 10:14:00 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180416101400epoutp01ef6aa6ace837884ef9abaac3c9cb5384~l4wCs8UUt2798927989epoutp014 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1523873641; bh=kcfSASgXKiH1RzuaJfvTqhYBffmcWvApTYlHfq2YG34=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=XUEcXTs2DQcmhTepapgukC+EzzlAtFbwH1g9WYmAEQUsUetQjNH+HFJs9i+kIw+wN gsmpJS3fuR6JQ6jXpLQQFpBu3hnGAXMrWzFzf1OPM7soJlWpuikPLfOyJoWJ8DCc6a XYHbJjOuK6jIfR9g1Mhm0d0kfdH3P0prsOklibv4= Received: from epsmges1p2.samsung.com (unknown [182.195.42.54]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180416101400epcas1p16962ee9dd68b97b78a6173eac0d66c57~l4wCHhRmK0854408544epcas1p1n; Mon, 16 Apr 2018 10:14:00 +0000 (GMT) Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 9B.AC.04034.86774DA5; Mon, 16 Apr 2018 19:14:00 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p4.samsung.com (KnoxPortal) with ESMTP id 20180416101400epcas1p45e65b37b922a5d0265de7879eeb1df87~l4wB7Oj3J1796317963epcas1p47; Mon, 16 Apr 2018 10:14:00 +0000 (GMT) X-AuditID: b6c32a36-f6fff70000000fc2-a3-5ad47768eb13 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 94.AB.03849.76774DA5; Mon, 16 Apr 2018 19:14:00 +0900 (KST) Received: from AMDC3058.DIGITAL.local ([106.120.53.102]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P79000EEWCHS590@mmp2.samsung.com>; Mon, 16 Apr 2018 19:13:59 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Eduardo Valentin Cc: Zhang Rui , Krzysztof Kozlowski , Kukjin Kim , Daniel Lezcano , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 05/14] thermal: exynos: remove parsing of samsung,tmu_default_temp_offset property Date: Mon, 16 Apr 2018 12:11:56 +0200 Message-id: <1523873525-23718-6-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1523873525-23718-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRmVeSWpSXmKPExsWy7bCmgW5G+ZUogw9/BC02zljPajHvs6zF /CvXWC36H79mtjh/fgO7xeVdc9gsPvceYbSYcX4fk8WTh31sDpweO2fdZfdYvOclk8emVZ1s Hneu7WHz6NuyitHj8ya5ALYoLpuU1JzMstQifbsEroz2byfYCl7LVzQ2RTYwvpfqYuTkkBAw kVh36zpzFyMXh5DADkaJFxcWM0E43xkl5h4+wwxT9eNoDztEYgOjxOVzEAkhgV+MEltfFIHY bAJWEhPbVzGC2CICWhInLm0Hm8QsMIFJ4umrmWwgCWGBFIkv23tZQWwWAVWJdY0PWEBsXgEP id4P7WwQ2+QkTh6bDFbDKeAp0bTmGhvIIAmBBWwS7RNOAzkcQI6LxO8tURD1whKvjm9hhwhL S1w6agtR3swo8W3HHqgPJjBK7FkvBGFbSxw+fhFsPrMAn8S7rz2sEL28Eh1tQhCmh8TfPZEQ 1Y4Sy/buZ4X4fQ6jxLzD7cwTGKUWMDKsYhRLLSjOTU8tNiww0itOzC0uzUvXS87P3cQIjlYt sx2Mi875HGIU4GBU4uHdcfZylBBrYllxZe4hRgkOZiUR3mWJQCHelMTKqtSi/Pii0pzU4kOM 0hwsSuK8T33ORAkJpCeWpGanphakFsFkmTg4pRoYtVwUdfYVu/073fPw8H6zab55XufvP/kW 8Y6BqV78g6W96o4WP/25J7Pk91xfe69p9nensm01wZ/mxa/V3PxhusPH97NrjIQlg0NtFELe PfR6usZ72uMnb79bHiozqBGVtYlWznb7y2Iy4Rurlv5Dril5xnstOqPUvVpOB5mv+70z63bx f4spSizFGYmGWsxFxYkAnP9k1dICAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprFLMWRmVeSWpSXmKPExsVy+t9jQd2M8itRBtdesFpsnLGe1WLeZ1mL +VeusVr0P37NbHH+/AZ2i8u75rBZfO49wmgx4/w+JosnD/vYHDg9ds66y+6xeM9LJo9NqzrZ PO5c28Pm0bdlFaPH501yAWxRXDYpqTmZZalF+nYJXBnt306wFbyWr2hsimxgfC/VxcjJISFg IvHjaA97FyMXh5DAOkaJs+sWQzm/GCUWzu1hA6liE7CSmNi+ihHEFhHQkjhxaTsTSBGzwAQm iSVrF7GDJIQFUiS+bO9lBbFZBFQl1jU+YAGxeQU8JHo/tLNBrJOTOHlsMlgNp4CnRNOaa2Bx IaCaxolXGScw8ixgZFjFKJlaUJybnltsVGCYl1quV5yYW1yal66XnJ+7iREYYtsOa/XtYLy/ JP4QowAHoxIP746zl6OEWBPLiitzDzFKcDArifAuSwQK8aYkVlalFuXHF5XmpBYfYpTmYFES 572ddyxSSCA9sSQ1OzW1ILUIJsvEwSnVwDj9ulXk48V5L/OFxY94rXebsnDT4yrZX40PlIuK bWRFdyUcveyll5vcfuId051Y3VMTCibomV7aHZt3rI7/hO32Mz9Ps6Suef/vM7fUhmMcG5W2 V/bzr/wXv+yzuCu/sHZG6Ww/01dten/1xN5enTp9I7NRc4DdnPZu4xsPRXQk8nrfGX4NjlRi Kc5INNRiLipOBACqAvH4LQIAAA== X-CMS-MailID: 20180416101400epcas1p45e65b37b922a5d0265de7879eeb1df87 X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180416101400epcas1p45e65b37b922a5d0265de7879eeb1df87 X-RootMTR: 20180416101400epcas1p45e65b37b922a5d0265de7879eeb1df87 References: <1523873525-23718-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@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 is never reached. Remove it 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 Reviewed-by: Daniel Lezcano --- drivers/thermal/samsung/exynos_tmu.c | 48 ++++++++++-------------------------- drivers/thermal/samsung/exynos_tmu.h | 2 -- 2 files changed, 13 insertions(+), 37 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index d7a3c3c..958a7c4 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -249,24 +249,14 @@ static void exynos_report_trigger(struct exynos_tmu_data *p) static int temp_to_code(struct exynos_tmu_data *data, u8 temp) { struct exynos_tmu_platform_data *pdata = data->pdata; - int temp_code; - - switch (pdata->cal_type) { - case TYPE_TWO_POINT_TRIMMING: - temp_code = (temp - pdata->first_point_trim) * - (data->temp_error2 - data->temp_error1) / - (pdata->second_point_trim - pdata->first_point_trim) + - data->temp_error1; - break; - case TYPE_ONE_POINT_TRIMMING: - temp_code = temp + data->temp_error1 - pdata->first_point_trim; - break; - default: - temp_code = temp + pdata->default_temp_offset; - break; - } - return temp_code; + if (pdata->cal_type == TYPE_ONE_POINT_TRIMMING) + return temp + data->temp_error1 - pdata->first_point_trim; + + return (temp - pdata->first_point_trim) * + (data->temp_error2 - data->temp_error1) / + (pdata->second_point_trim - pdata->first_point_trim) + + data->temp_error1; } /* @@ -276,24 +266,14 @@ static int temp_to_code(struct exynos_tmu_data *data, u8 temp) static int code_to_temp(struct exynos_tmu_data *data, u16 temp_code) { struct exynos_tmu_platform_data *pdata = data->pdata; - int temp; - switch (pdata->cal_type) { - case TYPE_TWO_POINT_TRIMMING: - temp = (temp_code - data->temp_error1) * - (pdata->second_point_trim - pdata->first_point_trim) / - (data->temp_error2 - data->temp_error1) + - pdata->first_point_trim; - break; - case TYPE_ONE_POINT_TRIMMING: - temp = temp_code - data->temp_error1 + pdata->first_point_trim; - break; - default: - temp = temp_code - pdata->default_temp_offset; - break; - } + if (pdata->cal_type == TYPE_ONE_POINT_TRIMMING) + return temp_code - data->temp_error1 + pdata->first_point_trim; - return temp; + return (temp_code - data->temp_error1) * + (pdata->second_point_trim - pdata->first_point_trim) / + (data->temp_error2 - data->temp_error1) + + pdata->first_point_trim; } static void sanitize_temp_error(struct exynos_tmu_data *data, u32 trim_info) @@ -1166,8 +1146,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; };