From patchwork Fri Nov 14 11:18:01 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Abhilash Kesavan X-Patchwork-Id: 5305121 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C83AB9F440 for ; Fri, 14 Nov 2014 11:20:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 070752015D for ; Fri, 14 Nov 2014 11:20:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 576E2200CA for ; Fri, 14 Nov 2014 11:20:19 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965011AbaKNLUS (ORCPT ); Fri, 14 Nov 2014 06:20:18 -0500 Received: from mailout4.samsung.com ([203.254.224.34]:51854 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964995AbaKNLUQ (ORCPT ); Fri, 14 Nov 2014 06:20:16 -0500 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout4.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0NF1006KY0TROL50@mailout4.samsung.com> for linux-pm@vger.kernel.org; Fri, 14 Nov 2014 20:20:15 +0900 (KST) Received: from epcpsbgm1.samsung.com ( [172.20.52.125]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 33.A5.18484.F65E5645; Fri, 14 Nov 2014 20:20:15 +0900 (KST) X-AuditID: cbfee68f-f791c6d000004834-4f-5465e56f1864 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (EPCPMTA) with SMTP id 1B.C5.20081.F65E5645; Fri, 14 Nov 2014 20:20:15 +0900 (KST) Received: from abhilash-ubuntu.sisodomain.com ([107.108.73.92]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0NF100A1U0Q0B1D0@mmp2.samsung.com>; Fri, 14 Nov 2014 20:20:15 +0900 (KST) From: Abhilash Kesavan To: rui.zhang@intel.com, edubezval@gmail.com, linux-pm@vger.kernel.org Cc: b.zolnierkie@samsung.com, amit.daniel@samsung.com, kesavan.abhilash@gmail.com Subject: [PATCH 3/4] thermal: exynos: modify the prototype for code_to_temp function Date: Fri, 14 Nov 2014 16:48:01 +0530 Message-id: <1415963882-3460-4-git-send-email-a.kesavan@samsung.com> X-Mailer: git-send-email 1.7.9.5 In-reply-to: <1415963882-3460-1-git-send-email-a.kesavan@samsung.com> References: <1415963882-3460-1-git-send-email-a.kesavan@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPLMWRmVeSWpSXmKPExsWyRsSkVjf/aWqIQcsTOYuGqyEWG2esZ7WY f+Uaq8Wav0oWn3uPMFo8edjH5sDmsXPWXXaPxXteMnn0bVnF6PF5k1wASxSXTUpqTmZZapG+ XQJXxpWP0xgL/vNWdNx4x9jAeIG7i5GTQ0LAROLjintMELaYxIV769m6GLk4hASWMko0vj3J CFO06uJPFojEdEaJtn0LmCCcPiaJlj+fwarYBPQkFvz7ygxiiwi4SSxe9I8dxGYWCJZYfPYM WFxYIEzixstDYPUsAqoS/c9XgMV5BVwk+ro+snYxcgBtU5CYM8kGJMwp4Cox9eNZNhBbCKjk /+P1rCB7JQTa2SX+333PDDFHQOLb5EMsEL2yEpsOMEMcLSlxcMUNlgmMwgsYGVYxiqYWJBcU J6UXGesVJ+YWl+al6yXn525iBIbz6X/P+ncw3j1gfYhRgINRiYeXwS01RIg1say4MvcQoynQ honMUqLJ+cCoySuJNzQ2M7Iw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W/PEifum f7Fl6qwydz6o/PBw3uPw4Et2Jy8sUGIpzkg01GIuKk4EAN1++8CsAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Exynos7 has a 9 bit code associated with a temperature as against 8 bits used in earlier SoCs. Modify the code_to_temp function to support this. Signed-off-by: Abhilash Kesavan --- drivers/thermal/samsung/exynos_tmu.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 49d3bcb..9695638 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -64,7 +64,7 @@ struct exynos_tmu_data { struct work_struct irq_work; struct mutex lock; struct clk *clk, *clk_sec, *sclk; - u8 temp_error1, temp_error2; + u16 temp_error1, temp_error2; struct regulator *regulator; struct thermal_sensor_conf *reg_conf; }; @@ -100,7 +100,7 @@ static int temp_to_code(struct exynos_tmu_data *data, u8 temp) * Calculate a temperature value from a temperature code. * The unit of the temperature is degree Celsius. */ -static int code_to_temp(struct exynos_tmu_data *data, u8 temp_code) +static int code_to_temp(struct exynos_tmu_data *data, u16 temp_code) { struct exynos_tmu_platform_data *pdata = data->pdata; int temp; @@ -336,13 +336,14 @@ static int exynos_tmu_read(struct exynos_tmu_data *data) { struct exynos_tmu_platform_data *pdata = data->pdata; const struct exynos_tmu_registers *reg = pdata->registers; - u8 temp_code; + u16 temp_code; int temp; mutex_lock(&data->lock); clk_enable(data->clk); - temp_code = readb(data->base + reg->tmu_cur_temp); + temp_code = readw(data->base + reg->tmu_cur_temp); + temp_code &= reg->triminfo_mask; if (data->soc == SOC_ARCH_EXYNOS4210) /* temp_code should range between 75 and 175 */