From patchwork Tue May 14 09:58:53 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 2564211 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id E3EC2DF24C for ; Tue, 14 May 2013 10:03:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932249Ab3ENKBL (ORCPT ); Tue, 14 May 2013 06:01:11 -0400 Received: from mail-pd0-f170.google.com ([209.85.192.170]:54319 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932132Ab3ENKBI (ORCPT ); Tue, 14 May 2013 06:01:08 -0400 Received: by mail-pd0-f170.google.com with SMTP id 10so292833pdi.1 for ; Tue, 14 May 2013 03:01:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:sender:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references; bh=Ky/VcRKVP2XeR37pZvuI5D7MncCMoV5ZPDqT+RN5GiI=; b=Dzi2lLE1CkU3NEpSQhCcrb4lpvuvqXpdCXKwBmlhyKlAwa3tMvaxraSfkrCk65ULQL hPGW+wf4836pJCtMPlaIcqAYjp+8rW9et/k98+FKnf8xuvz+6EiaoXZfVrwr+D7D6MPS Jsap6Q/jzLFjRCb80bbAhIwc5WAX5QZYPI1wjNlvVn7eIXOxx+eD5MtE6LU1SrVb9ICX DvFOay6lubd2bTNjtZausv1PBwi7THFpXsFUDvvZIfHoprkjXB5LyD4oeYpis5tDFhjK moD4XW/lPyjBaKyqpMeWFw25D8j52V25g7z+1bEy1TKSs3b1A2F4Cw0zEtxcAwM9j7ke oaFg== X-Received: by 10.68.222.233 with SMTP id qp9mr28494516pbc.63.1368525667784; Tue, 14 May 2013 03:01:07 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id kv2sm17617396pbc.28.2013.05.14.03.01.03 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 14 May 2013 03:01:06 -0700 (PDT) From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org Cc: Zhang Rui , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, Kukjin Kim , Eduardo Valentin Subject: [PATCH V4 23/30] thermal: exynos: Fix to set the second point correction value properly Date: Tue, 14 May 2013 15:28:53 +0530 Message-Id: <1368525540-15034-24-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1368525540-15034-1-git-send-email-amit.daniel@samsung.com> References: <1368525540-15034-1-git-send-email-amit.daniel@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org This patch sets the second point trimming value according to the platform data if the register value is 0. Acked-by: Kukjin Kim Signed-off-by: Amit Daniel Kachhap --- drivers/thermal/samsung/exynos_tmu.c | 13 +++++++++---- 1 files changed, 9 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c index 7ca9c4d..28804a5 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -161,10 +161,15 @@ static int exynos_tmu_initialize(struct platform_device *pdev) data->temp_error2 = ((trim_info >> reg->triminfo_85_shift) & EXYNOS_TMU_TEMP_MASK); - if ((pdata->min_efuse_value > data->temp_error1) || - (data->temp_error1 > pdata->max_efuse_value) || - (data->temp_error2 != 0)) - data->temp_error1 = pdata->efuse_value; + if (!data->temp_error1 || + (pdata->min_efuse_value > data->temp_error1) || + (data->temp_error1 > pdata->max_efuse_value)) + data->temp_error1 = pdata->efuse_value & EXYNOS_TMU_TEMP_MASK; + + if (!data->temp_error2) + data->temp_error2 = + (pdata->efuse_value >> reg->triminfo_85_shift) & + EXYNOS_TMU_TEMP_MASK; /* Count trigger levels to be enabled */ for (i = 0; i < MAX_THRESHOLD_LEVS; i++)