Received: by 10.192.165.148 with SMTP id m20csp1981254imm; Thu, 26 Apr 2018 05:00:34 -0700 (PDT) X-Google-Smtp-Source: AIpwx48nW5sZ1ogqilF7093ZaakwDa43Lsvjca35b0YIstQS2+ccIveh4kzLnowDb7BwFDdWgEmY X-Received: by 10.98.26.78 with SMTP id a75mr21586503pfa.84.1524744034681; Thu, 26 Apr 2018 05:00:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524744034; cv=none; d=google.com; s=arc-20160816; b=fahZ4JsHIVVvDD8mFDg/3AlLm3QBvvPLKLJWQAxh4rws4niwxDRjM6CXor+T80skKa RXqIv/o59aRwOHqhjGPG5ICXSro7fBpCn1DJ2hvDgne8T2FboBKHOo3X9GiRYOHBESRs Z+UtUhBkh1mn3p+cfZT7XZ5VZkHzL5VTm8yobVJ2KI+GFW47SBFtwIrRY9cI3ABdJuln yOCuHcD9FQJFiepJykCuQchYjxgO0L4FUaSDldRh+WuVZy+i89TFOoM8Khf9dFCeYNnc nx8e/0tw7GcgGwcz8fDXxNNzaTN2JruN73w8ous5LOnfG9tR4nvls/kJiGsBG5QSZsAC AzFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=Khg+GKbxRjTgqB5yPdlo+1AGl32GHvKyccktDRuKJFE=; b=uPAqanTLyUI29PytKVkWMsbNscBUdfwv9e1Pqj5AI9hWt5eTADDY4Pt0i7x+2zRPk+ xVGgWZKCMrN6vkiUcK0o42kJ8mcWsfaZN14jxMYJsV797gogy4RjihldoTX5bol+JNlZ gEBk2vU5sOOAGMXsBUBTXO2MX31BcbsTRjZUjczsnWxnEP974zFfKOhiDwVZ6pVNVW9i FXYauGyP8YDcC6jYXN0AwrIxLn6+hzSNzX6W1hQsjHVIB2soioZbRA+SnD7SuwYnJavn jvb2yKGWtvMIhPBg2gultXGnY/oJT7hXYsAu8tN6PwjT92LhQJ3ySQrlrbYjvfYdFz43 vH8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=cx7u64TP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 1-v6si14350484plj.122.2018.04.26.05.00.19; Thu, 26 Apr 2018 05:00:34 -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=@samsung.com header.s=mail20170921 header.b=cx7u64TP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756053AbeDZL5c (ORCPT + 99 others); Thu, 26 Apr 2018 07:57:32 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:48322 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755771AbeDZLwO (ORCPT ); Thu, 26 Apr 2018 07:52:14 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20180426115212epoutp01d78a8e2b8d63908511d5771dc021ae09~o_iowrcuj0415504155epoutp01H; Thu, 26 Apr 2018 11:52:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20180426115212epoutp01d78a8e2b8d63908511d5771dc021ae09~o_iowrcuj0415504155epoutp01H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1524743533; bh=Khg+GKbxRjTgqB5yPdlo+1AGl32GHvKyccktDRuKJFE=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=cx7u64TPfNpp87fr0IU5ms1roibOlUynUKqudJ//bYjgtqSFpgIbLsHFMGp25tWbF CuU4mVw35hzgCgYxjWJB9bPpreqH5OEvxiE8+zAoGlCE7UzZyAP9TO2VLMYG2cl3Zv +EMaS1e1Gooo0UYN4w/mVSyluR+DQhJB63gnIyac= Received: from epsmges1p1.samsung.com (unknown [182.195.42.53]) by epcas1p1.samsung.com (KnoxPortal) with ESMTP id 20180426115212epcas1p1be480f6b0a41d164fc8ffa16f9f2aa5f~o_ioeWTam2852828528epcas1p1M; Thu, 26 Apr 2018 11:52:12 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id B6.CD.04132.C6DB1EA5; Thu, 26 Apr 2018 20:52:12 +0900 (KST) Received: from epsmgms2p1new.samsung.com (unknown [182.195.42.142]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20180426115211epcas1p3db7cbe215a3dfb49567a771931574a2f~o_inndMSl2320423204epcas1p3_; Thu, 26 Apr 2018 11:52:11 +0000 (GMT) X-AuditID: b6c32a35-9cbff70000001024-d4-5ae1bd6cc984 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 78.8C.03822.B6DB1EA5; Thu, 26 Apr 2018 20:52:11 +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 <0P7S00GD7JMBQG00@mmp2.samsung.com>; Thu, 26 Apr 2018 20:52:11 +0900 (KST) From: Bartlomiej Zolnierkiewicz To: Eduardo Valentin Cc: Zhang Rui , linux-samsung-soc@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, b.zolnierkie@samsung.com Subject: [PATCH 05/18] thermal: exynos: use sanitize_temp_error() in exynos7_tmu_initialize() Date: Thu, 26 Apr 2018 13:51:20 +0200 Message-id: <1524743493-28113-6-git-send-email-b.zolnierkie@samsung.com> X-Mailer: git-send-email 1.9.1 In-reply-to: <1524743493-28113-1-git-send-email-b.zolnierkie@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrBIsWRmVeSWpSXmKPExsWy7bCmrm7O3odRBjM2qlhsnLGe1WL+lWus Fpd3zWGz+Nx7hNFixvl9TBZPHvaxObB57Jx1l91j8Z6XTB59W1YxenzeJBfAEsVlk5Kak1mW WqRvl8CVcWqDYMEk3oqX7Y/ZGxh7uLsYOTkkBEwkFm1ewtLFyMUhJLCDUWLL6wZmCOc7o0TP lH+sXYwcYFVH18qDNAgJbGCU2DGdCaLmF6PEvO8vmUASbAJWEhPbVzGC2CICWhInLm0HK2IW mMMoMathNwtIQlggXuLo5k+sIDaLgKrEtgMP2EBsXgEPie8t01khTpKTOHlsMpjNKeApceFI E9h5EgJ/WSXaH35ghyhykWh9uJUJwhaWeHV8CzvEpdISl47aQtQ3M0p827GHGaJmAqPEnvVC ELa1xOHjF8EWMAvwSbz72gP1Ja9ERxtUiYfEwoZ+qHscJQ48eQP1MdAz23d+ZpvAKLWAkWEV o1hqQXFuemqxYYGhXnFibnFpXrpecn7uJkZw/GmZ7mCccs7nEKMAB6MSD2/AwgdRQqyJZcWV uYcYJTiYlUR441sfRgnxpiRWVqUW5ccXleakFh9ilOZgURLnfepzJkpIID2xJDU7NbUgtQgm y8TBKdXAGC3QoTjNPnWzpplytdjH10tY3TkffDvNsHvOyjWNAswCNYzHvn2Xk5Cw4ph5XoRt XcH8wPVCAnGe4RzCp9Laf6pwKjzXX/pa/zbXzMmPV9QfKwlhexC65XVCxRmV7caH4hO/+Xrn /ZSK/jp/rUnGH9Otx2/2Pe5QcdG/XF9VfW655+zd658eVmIpzkg01GIuKk4EADy7PYe7AgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpkluLIzCtJLcpLzFFi42I5/e+xoG723odRBo/a1S02zljPajH/yjVW i8u75rBZfO49wmgx4/w+JosnD/vYHNg8ds66y+6xeM9LJo++LasYPT5vkgtgieKySUnNySxL LdK3S+DKOLVBsGASb8XL9sfsDYw93F2MHBwSAiYSR9fKdzFycQgJrGOUWPJmKhOE84tRYvKO Q6xdjJwcbAJWEhPbVzGC2CICWhInLm0HK2IWmMMo8XzFHCaQhLBAvMTRzZ/AGlgEVCW2HXjA BmLzCnhIfG+ZDhaXEJCTOHlsMpjNKeApceFIEwuILQRUc7/vPdsERp4FjAyrGCVTC4pz03OL jQoM81LL9YoTc4tL89L1kvNzNzECA2bbYa2+HYz3l8QfYhTgYFTi4Q1Y+CBKiDWxrLgy9xCj BAezkghvfOvDKCHelMTKqtSi/Pii0pzU4kOM0hwsSuK8t/OORQoJpCeWpGanphakFsFkmTg4 pRoYU7YY3F8f7/fg/9aK1RU/nnMa5bBfiJaaP8+gv9xjwtMb9w0y+X0uXN7dJDC/iu+5sp5h 8h6TGz/YVb8KVusu22i1c953j9ctdq/1+UTDmfhrbGYpmdiXK51vubHTl8d1pReP6ry+qEiX z517ixbVpmvVzlvH/6v+clysS0TIiUetMhNrJUSVWIozEg21mIuKEwGLV9f1FAIAAA== X-CMS-MailID: 20180426115211epcas1p3db7cbe215a3dfb49567a771931574a2f X-Msg-Generator: CA CMS-TYPE: 101P X-CMS-RootMailID: 20180426115211epcas1p3db7cbe215a3dfb49567a771931574a2f X-RootMTR: 20180426115211epcas1p3db7cbe215a3dfb49567a771931574a2f References: <1524743493-28113-1-git-send-email-b.zolnierkie@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix sanitize_temp_error() to handle Exynos7 SoCs and then use it in exynos7_tmu_initialize(). There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/thermal/samsung/exynos_tmu.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 3b41666..5a64879 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -286,7 +286,11 @@ static int code_to_temp(struct exynos_tmu_data *data, u16 temp_code) static void sanitize_temp_error(struct exynos_tmu_data *data, u32 trim_info) { - data->temp_error1 = trim_info & EXYNOS_TMU_TEMP_MASK; + u16 tmu_temp_mask = + (data->soc == SOC_ARCH_EXYNOS7) ? EXYNOS7_TMU_TEMP_MASK + : EXYNOS_TMU_TEMP_MASK; + + data->temp_error1 = trim_info & tmu_temp_mask; data->temp_error2 = ((trim_info >> EXYNOS_TRIMINFO_85_SHIFT) & EXYNOS_TMU_TEMP_MASK); @@ -592,12 +596,7 @@ static int exynos7_tmu_initialize(struct platform_device *pdev) unsigned int reg_off, bit_off; trim_info = readl(data->base + EXYNOS_TMU_REG_TRIMINFO); - - data->temp_error1 = trim_info & EXYNOS7_TMU_TEMP_MASK; - if (!data->temp_error1 || - (data->min_efuse_value > data->temp_error1) || - (data->temp_error1 > data->max_efuse_value)) - data->temp_error1 = data->efuse_value & EXYNOS_TMU_TEMP_MASK; + sanitize_temp_error(data, trim_info); /* Write temperature code for rising and falling threshold */ for (i = (of_thermal_get_ntrips(tz) - 1); i >= 0; i--) { -- 1.9.1