From patchwork Mon Jun 17 06:46:34 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 2731121 Return-Path: X-Original-To: patchwork-linux-samsung-soc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id DB9BCC0AB1 for ; Mon, 17 Jun 2013 06:50:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C21CC201E3 for ; Mon, 17 Jun 2013 06:50:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CA68B201E2 for ; Mon, 17 Jun 2013 06:50:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932601Ab3FQGtA (ORCPT ); Mon, 17 Jun 2013 02:49:00 -0400 Received: from mail-pd0-f169.google.com ([209.85.192.169]:32805 "EHLO mail-pd0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932537Ab3FQGs7 (ORCPT ); Mon, 17 Jun 2013 02:48:59 -0400 Received: by mail-pd0-f169.google.com with SMTP id y10so2474767pdj.28 for ; Sun, 16 Jun 2013 23:48:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=PgncFrlcerx1n3MlbNHKyko/Dpj5qhiBgURB3X6jvQk=; b=WEuDwaUp6IA0HLbhzbOboIZX5WSUuGLu+YHFOgl+Feh/4NqhftFksjuEm68l5RRR4z oD41Qh7wL3SBHUv42KiZhakkAaxOEuMsDFjxA3tIrxexH2WgFhOpIW83zjhZv0NeRc9s 6+f3AecbJKqGVjA0AhiKAxGrWLfAS1o6/whYa6XvLn+5q9J9XsJUYPK/Jnel4Cgt13d4 pAewllxTmaZv5U/cYjaXmoKAbO6FEjTt/NJCQZN0zXZamK4pjbQ0fqIUOJdzni7s7CWP g8UBZTxWsZ+2bFK4P3QSJMxODWtf75bi0d/PJZO2965XzTyzDSx0NNeGWppJpBOSx31/ an4w== X-Received: by 10.66.164.71 with SMTP id yo7mr11767542pab.92.1371451738773; Sun, 16 Jun 2013 23:48:58 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id xl3sm11639859pbb.17.2013.06.16.23.48.54 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Sun, 16 Jun 2013 23:48:57 -0700 (PDT) From: Amit Daniel Kachhap To: linux-pm@vger.kernel.org, Zhang Rui , Eduardo Valentin Cc: linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, amit.kachhap@gmail.com, Kukjin Kim , jonghwa3.lee@samsung.com Subject: [PATCH V6 25/30] thermal: exynos: Fix to set the second point correction value Date: Mon, 17 Jun 2013 12:16:34 +0530 Message-Id: <1371451599-31035-26-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1371451599-31035-1-git-send-email-amit.daniel@samsung.com> References: <1371451599-31035-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 X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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 This patch sets the second point trimming value according to the platform data if the register value is 0. Acked-by: Jonghwa Lee Acked-by: Kukjin Kim Signed-off-by: Amit Daniel Kachhap Acked-by: Eduardo Valentin --- 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 a4dbc84..af0e6ca 100644 --- a/drivers/thermal/samsung/exynos_tmu.c +++ b/drivers/thermal/samsung/exynos_tmu.c @@ -180,10 +180,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; if (pdata->max_trigger_level > MAX_THRESHOLD_LEVS) { dev_err(&pdev->dev, "Invalid max trigger level\n");