From patchwork Tue Mar 19 14:54:26 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eduardo Valentin X-Patchwork-Id: 2301391 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id C764540E68 for ; Tue, 19 Mar 2013 14:58:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932321Ab3CSO6h (ORCPT ); Tue, 19 Mar 2013 10:58:37 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:55089 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755762Ab3CSO6g (ORCPT ); Tue, 19 Mar 2013 10:58:36 -0400 Received: from dlelxv30.itg.ti.com ([172.17.2.17]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id r2JEwXO0006001; Tue, 19 Mar 2013 09:58:33 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dlelxv30.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2JEwXat011810; Tue, 19 Mar 2013 09:58:33 -0500 Received: from dlelxv23.itg.ti.com (172.17.1.198) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.2.342.3; Tue, 19 Mar 2013 09:58:33 -0500 Received: from legion.dal.design.ti.com (legion.dal.design.ti.com [128.247.22.53]) by dlelxv23.itg.ti.com (8.13.8/8.13.8) with ESMTP id r2JEwXpZ025814; Tue, 19 Mar 2013 09:58:33 -0500 Received: from localhost (h64-11.vpn.ti.com [172.24.64.11]) by legion.dal.design.ti.com (8.11.7p1+Sun/8.11.7) with ESMTP id r2JEwTV13466; Tue, 19 Mar 2013 09:58:30 -0500 (CDT) From: Eduardo Valentin To: CC: , , , , Eduardo Valentin Subject: [PATCHv2 10/12] staging: ti-soc-thermal: fix condition to apply hyst Date: Tue, 19 Mar 2013 10:54:26 -0400 Message-ID: <1363704868-11843-11-git-send-email-eduardo.valentin@ti.com> X-Mailer: git-send-email 1.7.7.1.488.ge8e1c In-Reply-To: <1363704868-11843-1-git-send-email-eduardo.valentin@ti.com> References: <1363704868-11843-1-git-send-email-eduardo.valentin@ti.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org While updating talert thresholds, threshold cold must always be lower than threshold hot. This patch fixes the function ti_bandgap_update_alert_threshold to only change the thresholds by applying a hysteresis when they violate this condition. Signed-off-by: Eduardo Valentin --- drivers/staging/ti-soc-thermal/ti-bandgap.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/staging/ti-soc-thermal/ti-bandgap.c b/drivers/staging/ti-soc-thermal/ti-bandgap.c index a9d6d2a..d075186 100644 --- a/drivers/staging/ti-soc-thermal/ti-bandgap.c +++ b/drivers/staging/ti-soc-thermal/ti-bandgap.c @@ -406,7 +406,7 @@ static int ti_bandgap_update_alert_threshold(struct ti_bandgap *bgp, int id, else t_cold = val; - if (t_cold < t_hot) { + if (t_cold > t_hot) { if (hot) err = ti_bandgap_add_hyst(bgp, t_hot, -ts_data->hyst_val,