From patchwork Tue Mar 3 10:43:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Punit Agrawal X-Patchwork-Id: 5921191 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5D66BF440 for ; Tue, 3 Mar 2015 10:43:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7F0FE202B4 for ; Tue, 3 Mar 2015 10:43:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 97DC12012E for ; Tue, 3 Mar 2015 10:43:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756203AbbCCKnH (ORCPT ); Tue, 3 Mar 2015 05:43:07 -0500 Received: from fw-tnat.cambridge.arm.com ([217.140.96.140]:34420 "EHLO cam-smtp0.cambridge.arm.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754819AbbCCKnH (ORCPT ); Tue, 3 Mar 2015 05:43:07 -0500 Received: from e105922-lin.cambridge.arm.com (e105922-lin.cambridge.arm.com [10.2.131.206]) by cam-smtp0.cambridge.arm.com (8.13.8/8.13.8) with SMTP id t23Ah2qh008393; Tue, 3 Mar 2015 10:43:02 GMT Received: by e105922-lin.cambridge.arm.com (sSMTP sendmail emulation); Tue, 03 Mar 2015 10:43:43 +0000 From: Punit Agrawal To: edubezval@gmail.com Cc: linux-pm@vger.kernel.org, rui.zhang@intel.com, Punit Agrawal Subject: [PATCH 2/2] thermal: Default OF created trip points to writable Date: Tue, 3 Mar 2015 10:43:04 +0000 Message-Id: <1425379384-17000-3-git-send-email-punit.agrawal@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1425379384-17000-1-git-send-email-punit.agrawal@arm.com> References: <1425379384-17000-1-git-send-email-punit.agrawal@arm.com> 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 When registering a thermal zone from device tree, default the trip points to writable. By default, only the root user can change these. This allows the trip points to be tweaked after the system has booted. Cc: Eduardo Valentin Cc: Zhang Rui Signed-off-by: Punit Agrawal --- drivers/thermal/of-thermal.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index 668fb1b..b7ad5c0 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -865,6 +865,7 @@ int __init of_parse_thermal_zones(void) for_each_child_of_node(np, child) { struct thermal_zone_device *zone; struct thermal_zone_params *tzp; + int i, mask = 0; /* Check whether child is enabled or not */ if (!of_device_is_available(child)) @@ -891,8 +892,11 @@ int __init of_parse_thermal_zones(void) /* No hwmon because there might be hwmon drivers registering */ tzp->no_hwmon = true; + for (i = 0; i < tz->ntrips; i++) + mask |= 1 << i; + zone = thermal_zone_device_register(child->name, tz->ntrips, - 0, tz, + mask, tz, ops, tzp, tz->passive_delay, tz->polling_delay);