From patchwork Fri Mar 22 21:13:07 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 2322771 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: X-Original-To: patchwork-linux-pm@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 D06B7DFE82 for ; Fri, 22 Mar 2013 21:14:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1423092Ab3CVVOP (ORCPT ); Fri, 22 Mar 2013 17:14:15 -0400 Received: from comal.ext.ti.com ([198.47.26.152]:44052 "EHLO comal.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1423058Ab3CVVOO (ORCPT ); Fri, 22 Mar 2013 17:14:14 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2MLEDxi001718; Fri, 22 Mar 2013 16:14:13 -0500 Received: from DFLE72.ent.ti.com (dfle72.ent.ti.com [128.247.5.109]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2MLEC14019516; Fri, 22 Mar 2013 16:14:13 -0500 Received: from dlelxv24.itg.ti.com (172.17.1.199) by DFLE72.ent.ti.com (128.247.5.109) with Microsoft SMTP Server id 14.2.342.3; Fri, 22 Mar 2013 16:14:12 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv24.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2MLECPK029015; Fri, 22 Mar 2013 16:14:12 -0500 Received: from localhost (h68-18.vpn.ti.com [172.24.68.18]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r2MLE9V10144; Fri, 22 Mar 2013 16:14:10 -0500 (CDT) From: Eduardo Valentin To: Zhang Rui CC: , , Eduardo Valentin Subject: [PATCH 2/2] staging: ti-soc-thermal: remove external heat while extrapolating hotspot Date: Fri, 22 Mar 2013 17:13:07 -0400 Message-ID: <1363986787-28147-3-git-send-email-eduardo.valentin@ti.com> X-Mailer: git-send-email 1.7.7.1.488.ge8e1c In-Reply-To: <1363986787-28147-1-git-send-email-eduardo.valentin@ti.com> References: <1363986787-28147-1-git-send-email-eduardo.valentin@ti.com> MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org For boards that provide a PCB sensor close to SoC junction temperature, it is possible to remove the cumulative heat reported by the SoC temperature sensor. This patch changes the extrapolation computation to consider an external sensor in the extrapolation equations. Signed-off-by: Eduardo Valentin --- drivers/staging/ti-soc-thermal/ti-thermal-common.c | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/staging/ti-soc-thermal/ti-thermal-common.c b/drivers/staging/ti-soc-thermal/ti-thermal-common.c index 231c549..52d3c1b 100644 --- a/drivers/staging/ti-soc-thermal/ti-thermal-common.c +++ b/drivers/staging/ti-soc-thermal/ti-thermal-common.c @@ -92,10 +92,9 @@ static inline int ti_thermal_get_temp(struct thermal_zone_device *thermal, if (ret) return ret; - pcb_temp = 0; - /* TODO: Introduce pcb temperature lookup */ + ret = thermal_zone_lookup_temperature("pcb", &pcb_temp); /* In case pcb zone is available, use the extrapolation rule with it */ - if (pcb_temp) { + if (!ret) { tmp -= pcb_temp; slope = s->slope_pcb; constant = s->constant_pcb;