From patchwork Tue Jun 11 12:53:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Kachhap X-Patchwork-Id: 2703341 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 06A93DF23A for ; Tue, 11 Jun 2013 12:56:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755644Ab3FKMzx (ORCPT ); Tue, 11 Jun 2013 08:55:53 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:45306 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755622Ab3FKMzv (ORCPT ); Tue, 11 Jun 2013 08:55:51 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb1so5399245pad.23 for ; Tue, 11 Jun 2013 05:55:50 -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=7PWpGiDPYLAeZxmn8hGL83pKmCGZbYAQkaAyQz0USlE=; b=VP36cJfHkzWjC/DXUqdIQ3DcMBynMKWkcfblkRVCUbmsL+BDNojeB3iAIOnqqTdhsC pM4nInCi39vhZucNo6aXmv3O/7yvG6Tgq5BhCXHJtH88uLs+TYzuESPFS1Z5KyP1Kzo1 YP0EKmHDEnb2VHwK8bvX5rIiBzlWyHYqpGXys1V44H5onkFFTBY+RMM/yBOkaB8arjLQ Ll+GoxOcyQFU4OQQZHCnfdSpCd1CGOlePdIvBMOWrjkWCdeGw1WpVV8l2HLsjnOb6+4k idaAXsgR7FfGocLcpqyYig+JW8ssGN8hPwRjcLxe73NDOw+yY/7YCXRDV/V5WRt1KdBh V8Kg== X-Received: by 10.68.0.131 with SMTP id 3mr14520181pbe.124.1370955350576; Tue, 11 Jun 2013 05:55:50 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPSA id wi6sm14599807pbc.22.2013.06.11.05.55.46 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 11 Jun 2013 05:55:49 -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 V5 25/30] thermal: exynos: Fix to set the second point correction value Date: Tue, 11 Jun 2013 18:23:35 +0530 Message-Id: <1370955220-2949-26-git-send-email-amit.daniel@samsung.com> X-Mailer: git-send-email 1.7.1 In-Reply-To: <1370955220-2949-1-git-send-email-amit.daniel@samsung.com> References: <1370955220-2949-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 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");