From patchwork Mon Sep 19 01:18:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Kang X-Patchwork-Id: 9338391 X-Patchwork-Delegate: rui.zhang@intel.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 42E98601C2 for ; Mon, 19 Sep 2016 01:29:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AA6D28DCC for ; Mon, 19 Sep 2016 01:29:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1DF7F28DD0; Mon, 19 Sep 2016 01:29:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F29A328DCC for ; Mon, 19 Sep 2016 01:29:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S936308AbcISB3U (ORCPT ); Sun, 18 Sep 2016 21:29:20 -0400 Received: from LGEAMRELO11.lge.com ([156.147.23.51]:42138 "EHLO lgeamrelo11.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932596AbcISB3U (ORCPT ); Sun, 18 Sep 2016 21:29:20 -0400 Received: from unknown (HELO lgeamrelo01.lge.com) (156.147.1.125) by 156.147.23.51 with ESMTP; 19 Sep 2016 10:29:16 +0900 X-Original-SENDERIP: 156.147.1.125 X-Original-MAILFROM: hugh.kang@lge.com Received: from unknown (HELO LGEAEXHB04Q.LGE.NET) (165.244.98.204) by 156.147.1.125 with ESMTP; 19 Sep 2016 10:28:14 +0900 X-Original-SENDERIP: 165.244.98.204 X-Original-MAILFROM: hugh.kang@lge.com Received: from lgekrmhub05.lge.com (10.185.110.15) by LGEAEXHB04Q.LGE.NET (165.244.98.204) with Microsoft SMTP Server id 8.3.264.0; Mon, 19 Sep 2016 10:25:57 +0900 Received: from lgeamrelo01.lge.com ([156.147.1.125]) by lgekrmhub05.lge.com (Lotus Domino Release 8.5.3FP6) with ESMTP id 2016091910255638-798334 ; Mon, 19 Sep 2016 10:25:56 +0900 Received: from unknown (HELO localhost.localdomain) (165.186.175.61) by 156.147.1.125 with ESMTP; 19 Sep 2016 10:25:56 +0900 X-Original-SENDERIP: 165.186.175.61 X-Original-MAILFROM: hugh.kang@lge.com From: Inhyuk Kang To: Zhang Rui , Eduardo Valentin CC: , , Subject: [PATCH] of: thermal: Fixed governor at each thermal zone Date: Mon, 19 Sep 2016 10:18:52 +0900 Message-ID: <1474247932-1026-1-git-send-email-hugh.kang@lge.com> X-Mailer: git-send-email 1.9.1 X-MIMETrack: Itemize by SMTP Server on LGEKRMHUB05/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/09/19 10:25:56, Serialize by Router on LGEKRMHUB05/LGE/LG Group(Release 8.5.3FP6|November 21, 2013) at 2016/09/19 10:25:56, Serialize complete at 2016/09/19 10:25:56 MIME-Version: 1.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP It is necessary to be added governor at each thermal_zone. Because some governors should be operated in the during the kernel booting in order to avoid heating problem. Default governor cannot be covered all thermal zones policy because some thermal zones want to apply different one. For example, the power allocator governor operates differently with step wise governor. Hence, it is better to parse governor parameter from the device tree. Signed-off-by: Inhyuk Kang diff --git a/drivers/thermal/of-thermal.c b/drivers/thermal/of-thermal.c index b8e509c..382c440 100644 --- a/drivers/thermal/of-thermal.c +++ b/drivers/thermal/of-thermal.c @@ -970,6 +970,7 @@ int __init of_parse_thermal_zones(void) struct thermal_zone_device *zone; struct thermal_zone_params *tzp; int i, mask = 0; + const char *governor; u32 prop; tz = thermal_of_build_thermal_zone(child); @@ -996,6 +997,9 @@ int __init of_parse_thermal_zones(void) if (!of_property_read_u32(child, "sustainable-power", &prop)) tzp->sustainable_power = prop; + if (!of_property_read_string(child, "governor-name", &governor)) + strcpy(tzp->governor_name, governor); + for (i = 0; i < tz->ntrips; i++) mask |= 1 << i;