From patchwork Thu Oct 9 16:38:38 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukasz Majewski X-Patchwork-Id: 5059311 X-Patchwork-Delegate: eduardo.valentin@ti.com Return-Path: X-Original-To: patchwork-linux-pm@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 F070DC11AE for ; Thu, 9 Oct 2014 16:39:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2D867201FE for ; Thu, 9 Oct 2014 16:39:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41DD820212 for ; Thu, 9 Oct 2014 16:39:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755587AbaJIQjS (ORCPT ); Thu, 9 Oct 2014 12:39:18 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:58839 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752014AbaJIQjR (ORCPT ); Thu, 9 Oct 2014 12:39:17 -0400 Received: from epcpsbgm2.samsung.com (epcpsbgm2 [203.254.230.27]) by mailout2.samsung.com (Oracle Communications Messaging Server 7u4-24.01(7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTP id <0ND600H5URLFNZ60@mailout2.samsung.com>; Fri, 10 Oct 2014 01:39:16 +0900 (KST) X-AuditID: cbfee61b-f79d76d0000024d6-1f-5436ba33acd1 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm2.samsung.com (EPCPMTA) with SMTP id 2C.4B.09430.33AB6345; Fri, 10 Oct 2014 01:39:15 +0900 (KST) Received: from mcdsrvbld02.digital.local ([106.116.37.23]) by mmp2.samsung.com (Oracle Communications Messaging Server 7u4-24.01 (7.0.4.24.0) 64bit (built Nov 17 2011)) with ESMTPA id <0ND600M6SRKZPK30@mmp2.samsung.com>; Fri, 10 Oct 2014 01:39:15 +0900 (KST) From: Lukasz Majewski To: Eduardo Valentin , Zhang Rui Cc: "linux-samsung-soc@vger.kernel.org" , linux-arm-kernel@lists.infradead.org, Linux PM list , Kukjin Kim , Bartlomiej Zolnierkiewicz , Lukasz Majewski , Amit Daniel Kachhap , Kyungmin Park , Chanwoo Choi , Lukasz Majewski Subject: [PATCH 02/21] thermal: of: Extend of-thermal.c to provide check if trip point is enabled Date: Thu, 09 Oct 2014 18:38:38 +0200 Message-id: <1412872737-624-3-git-send-email-l.majewski@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1412872737-624-1-git-send-email-l.majewski@samsung.com> References: <1412872737-624-1-git-send-email-l.majewski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrPLMWRmVeSWpSXmKPExsVy+t9jQV3jXWYhBm/vWlg0XA2x2DhjPavF 9S/PWS3mX7nGatG74CqbxdmmN+wWbx5xW7x5uJnRYtNjoPjn3iOMFjPO72OyePKwj82Bx2Pn rLvsHov3vGTy2Lyk3mPdtLfMHn1bVjF6fN4kF8AWxWWTkpqTWZZapG+XwJXRf/Y4a8Eu3or5 Zy6zNzBu5O5i5OSQEDCR+P95IhuELSZx4d56IJuLQ0hgOqNE6+yJzBBOF5PEufPHWEGq2AT0 JD7ffcoEYosIeEu83jedEaSIWeAqs8Tl3SvBioQFkiV2bLwIZrMIqEos/jkZqIiDg1fARWJj XyHENkWJ7mcTwDZzCrhKPH28mhnEFgIquf3oJfsERt4FjAyrGEVTC5ILipPSc430ihNzi0vz 0vWS83M3MYKD8Zn0DsZVDRaHGAU4GJV4eB/8Mw0RYk0sK67MPcQowcGsJMK7faZZiBBvSmJl VWpRfnxRaU5q8SFGaQ4WJXHeg63WgUIC6YklqdmpqQWpRTBZJg5OqQbGFTJX5O6/NvhyvqKv rfwep6XQ82m6xitklKbqm5zQYVpwtuiGJMfGaZk2KZdcqzTSP7GeX/a17npA1Old0xJl12+3 CGs8tjVs97WrzQtvnX8/+c2iy37LVvpOOze/ZtPB4OPTDszo39NloPp4cei3Zdycwc9/TEq7 9pb3g+6kpvQ1a2YpbtrTJqXEUpyRaKjFXFScCABBU1ytQgIAAA== Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable 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 extends the of-thermal.c to provide check if trip point is enabled. Signed-off-by: Lukasz Majewski --- drivers/thermal/of-thermal.c | 9 +++++++++ drivers/thermal/thermal_core.h | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index b2390d9..23c8d6c 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -119,6 +119,15 @@ int of_thermal_get_ntrips(struct thermal_zone_device *tz) return data->ntrips; } +int of_thermal_is_trip_en(struct thermal_zone_device *tz, int trip) +{ + struct __thermal_zone *data = tz->devdata; + + if (trip >= data->ntrips || trip < 0) + return 0; + return 1; +} + static int of_thermal_get_trend(struct thermal_zone_device *tz, int trip, enum thermal_trend *trend) { diff --git a/drivers/thermal/thermal_core.h b/drivers/thermal/thermal_core.h index 587ca5c..ed8ff05 100644 --- a/drivers/thermal/thermal_core.h +++ b/drivers/thermal/thermal_core.h @@ -82,6 +82,7 @@ static inline void thermal_gov_user_space_unregister(void) {} int of_parse_thermal_zones(void); void of_thermal_destroy_zones(void); int of_thermal_get_ntrips(struct thermal_zone_device *); +int of_thermal_is_trip_en(struct thermal_zone_device *, int); #else static inline int of_parse_thermal_zones(void) { return 0; } static inline void of_thermal_destroy_zones(void) { } @@ -89,6 +90,10 @@ static inline int of_thermal_get_ntrips(struct thermal_zone_device *) { return 0; } +int of_thermal_is_trip_en(struct thermal_zone_device *, int) +{ + return 0; +} #endif #endif /* __THERMAL_CORE_H__ */